From d4acb8b53f9d1c38c0fb4bb14af88be7f9498f1f Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Thu, 29 Aug 2024 17:16:28 +0100 Subject: [PATCH] Fix generation issue --- docs/guides/changelog.md | 20 +- .../profile_parcels/service_route_policy.yaml | 39 -- .../transport_route_policy.yaml | 39 -- ...wan_service_route_policy_profile_parcel.go | 376 +++++++++++------- ...n_transport_route_policy_profile_parcel.go | 376 +++++++++++------- internal/provider/provider.go | 4 +- templates/guides/changelog.md.tmpl | 20 +- 7 files changed, 478 insertions(+), 396 deletions(-) diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 438abe6fb..71942e458 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -1,12 +1,12 @@ ---- -subcategory: "Guides" -page_title: "Changelog" -description: |- - Changelog ---- - -# Changelog - +--- +subcategory: "Guides" +page_title: "Changelog" +description: |- + Changelog +--- + +# Changelog + ## 0.3.14 (unreleased) - Fix issue when reading deleted `sdwan_cli_config_profile_parcel` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/291) @@ -329,4 +329,4 @@ description: |- ## 0.1.0 (July 23, 2021) - Initial Release - + diff --git a/gen/definitions/profile_parcels/service_route_policy.yaml b/gen/definitions/profile_parcels/service_route_policy.yaml index d1b64da23..d0f9615e4 100644 --- a/gen/definitions/profile_parcels/service_route_policy.yaml +++ b/gen/definitions/profile_parcels/service_route_policy.yaml @@ -92,93 +92,54 @@ attributes: attributes: - model_name: enableAcceptAction data_path: [accept] - conditional_attribute: - name: reject - value: false example: true - model_name: prepend tf_name: as_path_prend data_path: [accept, setAsPath] - conditional_attribute: - name: enableAcceptAction - value: true example: 65521 - model_name: additive tf_name: community_additive data_path: [accept, setCommunity] - conditional_attribute: - name: enableAcceptAction - value: true example: false - model_name: community tf_name: community data_path: [accept, setCommunity] - conditional_attribute: - name: enableAcceptAction - value: true example: internet - model_name: setLocalPreference tf_name: local_preference data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 100 - model_name: setMetric tf_name: metric data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 20 - model_name: setMetricType tf_name: metric_type data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: type1 - model_name: setOmpTag tf_name: omp_tag data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 200 - model_name: setOrigin tf_name: origin data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: EGP - model_name: setOspfTag tf_name: ospf_tag data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 1200 - model_name: setWeight tf_name: weight data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 2200 - model_name: setIpv4NextHop tf_name: ipv4_next_hop data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 10.0.0.1 - model_name: setIpv6NextHop tf_name: ipv6_next_hop data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true exclude_test: true example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C diff --git a/gen/definitions/profile_parcels/transport_route_policy.yaml b/gen/definitions/profile_parcels/transport_route_policy.yaml index 5a08c63cb..447ca6db5 100644 --- a/gen/definitions/profile_parcels/transport_route_policy.yaml +++ b/gen/definitions/profile_parcels/transport_route_policy.yaml @@ -92,93 +92,54 @@ attributes: attributes: - model_name: enableAcceptAction data_path: [accept] - conditional_attribute: - name: reject - value: false example: true - model_name: prepend tf_name: as_path_prend data_path: [accept, setAsPath] - conditional_attribute: - name: enableAcceptAction - value: true example: 65521 - model_name: additive tf_name: community_additive data_path: [accept, setCommunity] - conditional_attribute: - name: enableAcceptAction - value: true example: false - model_name: community tf_name: community data_path: [accept, setCommunity] - conditional_attribute: - name: enableAcceptAction - value: true example: internet - model_name: setLocalPreference tf_name: local_preference data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 100 - model_name: setMetric tf_name: metric data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 20 - model_name: setMetricType tf_name: metric_type data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: type1 - model_name: setOmpTag tf_name: omp_tag data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 200 - model_name: setOrigin tf_name: origin data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: EGP - model_name: setOspfTag tf_name: ospf_tag data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 1200 - model_name: setWeight tf_name: weight data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 2200 - model_name: setIpv4NextHop tf_name: ipv4_next_hop data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true example: 10.0.0.1 - model_name: setIpv6NextHop tf_name: ipv6_next_hop data_path: [accept] - conditional_attribute: - name: enableAcceptAction - value: true exclude_test: true example: 28C3EF06-c09a-DeFa-Ab26-a1cc4Ef0D51C diff --git a/internal/provider/model_sdwan_service_route_policy_profile_parcel.go b/internal/provider/model_sdwan_service_route_policy_profile_parcel.go index abbab1981..6258945cb 100644 --- a/internal/provider/model_sdwan_service_route_policy_profile_parcel.go +++ b/internal/provider/model_sdwan_service_route_policy_profile_parcel.go @@ -110,166 +110,246 @@ func (data ServiceRoutePolicy) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.DefaultAction.IsNull() { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") - body, _ = sjson.Set(body, path+"defaultAction.value", "reject") - } else { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") - body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) - } - body, _ = sjson.Set(body, path+"sequences", []interface{}{}) - for _, item := range data.Sequences { - itemBody := "" - if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) - } - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") + body, _ = sjson.Set(body, path+"defaultAction.value", "reject") } - if item.BaseAction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", "reject") - } else { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) - } - if item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "protocol.value", "IPV4") - } else { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } else { + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") + body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) } - - for _, childItem := range item.MatchEntries { - itemChildBody := "" - if !childItem.AsPathListId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.value", childItem.AsPathListId.ValueString()) - } - if !childItem.StandardCommunityListCriteria.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.value", childItem.StandardCommunityListCriteria.ValueString()) - } - - for _, childChildItem := range childItem.StandardCommunityLists { - itemChildChildBody := "" - if !childChildItem.Id.IsNull() { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.optionType", "global") - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.value", childChildItem.Id.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()) } - itemChildBody, _ = sjson.SetRaw(itemChildBody, "communityList.standardCommunityList.-1", itemChildChildBody) - } - if !childItem.ExpandedCommunityListId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.value", childItem.ExpandedCommunityListId.ValueString()) - } - if !childItem.ExtendedCommunityListId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.value", childItem.ExtendedCommunityListId.ValueString()) } - if !childItem.BgpLocalPreference.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.value", childItem.BgpLocalPreference.ValueInt64()) - } - if !childItem.Metric.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "metric.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "metric.value", childItem.Metric.ValueInt64()) - } - if !childItem.OmpTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.value", childItem.OmpTag.ValueInt64()) - } - if !childItem.OspfTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.value", childItem.OspfTag.ValueInt64()) - } - if !childItem.Ipv4AddressId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.value", childItem.Ipv4AddressId.ValueString()) - } - if !childItem.Ipv4NextHopId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.value", childItem.Ipv4NextHopId.ValueString()) - } - if !childItem.Ipv6AddressId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.value", childItem.Ipv6AddressId.ValueString()) + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + } } - if !childItem.Ipv6NextHopId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.value", childItem.Ipv6NextHopId.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()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "matchEntries.-1", itemChildBody) - } - - for _, childItem := range item.Actions { - itemChildBody := "" - itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.value", true) - if !childItem.AsPathPrend.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.optionType", "global") - var values []int64 - childItem.AsPathPrend.ElementsAs(ctx, &values, false) - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.value", values) - } - if childItem.CommunityAdditive.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", false) + if item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "protocol.value", "IPV4") + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", childItem.CommunityAdditive.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } } + if true { - if !childItem.CommunityVariable.IsNull() { - 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() { - 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() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.value", childItem.LocalPreference.ValueInt64()) - } - if !childItem.Metric.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.value", childItem.Metric.ValueInt64()) - } - if !childItem.MetricType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.value", childItem.MetricType.ValueString()) - } - if !childItem.OmpTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.value", childItem.OmpTag.ValueInt64()) - } - if !childItem.Origin.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.value", childItem.Origin.ValueString()) - } - if !childItem.OspfTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.value", childItem.OspfTag.ValueInt64()) - } - if !childItem.Weight.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.value", childItem.Weight.ValueInt64()) - } - if !childItem.Ipv4NextHop.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.value", childItem.Ipv4NextHop.ValueString()) + 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.Ipv4AddressId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.value", childItem.Ipv4AddressId.ValueString()) + } + } + if !childItem.Ipv4NextHopId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.value", childItem.Ipv4NextHopId.ValueString()) + } + } + if !childItem.Ipv6AddressId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.value", childItem.Ipv6AddressId.ValueString()) + } + } + if !childItem.Ipv6NextHopId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.value", childItem.Ipv6NextHopId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "matchEntries.-1", itemChildBody) + } } - if !childItem.Ipv6NextHop.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.value", childItem.Ipv6NextHop.ValueString()) + 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.AsPathPrend.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.optionType", "global") + var values []int64 + childItem.AsPathPrend.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) + } } - itemBody, _ = sjson.SetRaw(itemBody, "actions.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_transport_route_policy_profile_parcel.go b/internal/provider/model_sdwan_transport_route_policy_profile_parcel.go index 2674d23b0..a4acaa923 100644 --- a/internal/provider/model_sdwan_transport_route_policy_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_route_policy_profile_parcel.go @@ -110,166 +110,246 @@ func (data TransportRoutePolicy) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.DefaultAction.IsNull() { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") - body, _ = sjson.Set(body, path+"defaultAction.value", "reject") - } else { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") - body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) - } - body, _ = sjson.Set(body, path+"sequences", []interface{}{}) - for _, item := range data.Sequences { - itemBody := "" - if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) - } - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") + body, _ = sjson.Set(body, path+"defaultAction.value", "reject") } - if item.BaseAction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", "reject") - } else { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) - } - if item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "protocol.value", "IPV4") - } else { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } else { + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") + body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) } - - for _, childItem := range item.MatchEntries { - itemChildBody := "" - if !childItem.AsPathListId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "asPathList.refId.value", childItem.AsPathListId.ValueString()) - } - if !childItem.StandardCommunityListCriteria.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.criteria.value", childItem.StandardCommunityListCriteria.ValueString()) - } - - for _, childChildItem := range childItem.StandardCommunityLists { - itemChildChildBody := "" - if !childChildItem.Id.IsNull() { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.optionType", "global") - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "refId.value", childChildItem.Id.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()) } - itemChildBody, _ = sjson.SetRaw(itemChildBody, "communityList.standardCommunityList.-1", itemChildChildBody) - } - if !childItem.ExpandedCommunityListId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "communityList.expandedCommunityList.refId.value", childItem.ExpandedCommunityListId.ValueString()) - } - if !childItem.ExtendedCommunityListId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "extCommunityList.refId.value", childItem.ExtendedCommunityListId.ValueString()) } - if !childItem.BgpLocalPreference.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "bgpLocalPreference.value", childItem.BgpLocalPreference.ValueInt64()) - } - if !childItem.Metric.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "metric.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "metric.value", childItem.Metric.ValueInt64()) - } - if !childItem.OmpTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ompTag.value", childItem.OmpTag.ValueInt64()) - } - if !childItem.OspfTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ospfTag.value", childItem.OspfTag.ValueInt64()) - } - if !childItem.Ipv4AddressId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.value", childItem.Ipv4AddressId.ValueString()) - } - if !childItem.Ipv4NextHopId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.value", childItem.Ipv4NextHopId.ValueString()) - } - if !childItem.Ipv6AddressId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.value", childItem.Ipv6AddressId.ValueString()) + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + } } - if !childItem.Ipv6NextHopId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.value", childItem.Ipv6NextHopId.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()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "matchEntries.-1", itemChildBody) - } - - for _, childItem := range item.Actions { - itemChildBody := "" - itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.enableAcceptAction.value", true) - if !childItem.AsPathPrend.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.optionType", "global") - var values []int64 - childItem.AsPathPrend.ElementsAs(ctx, &values, false) - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.value", values) - } - if childItem.CommunityAdditive.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", false) + if item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "protocol.value", "IPV4") + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setCommunity.additive.value", childItem.CommunityAdditive.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } } + if true { - if !childItem.CommunityVariable.IsNull() { - 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() { - 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() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setLocalPreference.value", childItem.LocalPreference.ValueInt64()) - } - if !childItem.Metric.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetric.value", childItem.Metric.ValueInt64()) - } - if !childItem.MetricType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setMetricType.value", childItem.MetricType.ValueString()) - } - if !childItem.OmpTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOmpTag.value", childItem.OmpTag.ValueInt64()) - } - if !childItem.Origin.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOrigin.value", childItem.Origin.ValueString()) - } - if !childItem.OspfTag.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setOspfTag.value", childItem.OspfTag.ValueInt64()) - } - if !childItem.Weight.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setWeight.value", childItem.Weight.ValueInt64()) - } - if !childItem.Ipv4NextHop.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv4NextHop.value", childItem.Ipv4NextHop.ValueString()) + 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.Ipv4AddressId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4Address.refId.value", childItem.Ipv4AddressId.ValueString()) + } + } + if !childItem.Ipv4NextHopId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv4NextHop.refId.value", childItem.Ipv4NextHopId.ValueString()) + } + } + if !childItem.Ipv6AddressId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6Address.refId.value", childItem.Ipv6AddressId.ValueString()) + } + } + if !childItem.Ipv6NextHopId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6NextHop.refId.value", childItem.Ipv6NextHopId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "matchEntries.-1", itemChildBody) + } } - if !childItem.Ipv6NextHop.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "accept.setIpv6NextHop.value", childItem.Ipv6NextHop.ValueString()) + 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.AsPathPrend.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "accept.setAsPath.prepend.optionType", "global") + var values []int64 + childItem.AsPathPrend.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) + } } - itemBody, _ = sjson.SetRaw(itemBody, "actions.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } return body } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 4908a9365..925c96324 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -303,10 +303,10 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc NewServiceLANVPNInterfaceSVIProfileParcelResource, NewServiceObjectTrackerProfileParcelResource, NewServiceObjectTrackerGroupProfileParcelResource, + NewServiceRoutePolicyProfileParcelResource, NewServiceRoutingOSPFProfileParcelResource, NewServiceRoutingOSPFv3IPv4ProfileParcelResource, NewServiceRoutingOSPFv3IPv6ProfileParcelResource, - NewServiceRoutePolicyProfileParcelResource, NewServiceTrackerProfileParcelResource, NewServiceTrackerGroupProfileParcelResource, NewSystemAAAProfileParcelResource, @@ -481,10 +481,10 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat NewServiceLANVPNInterfaceSVIProfileParcelDataSource, NewServiceObjectTrackerProfileParcelDataSource, NewServiceObjectTrackerGroupProfileParcelDataSource, + NewServiceRoutePolicyProfileParcelDataSource, NewServiceRoutingOSPFProfileParcelDataSource, NewServiceRoutingOSPFv3IPv4ProfileParcelDataSource, NewServiceRoutingOSPFv3IPv6ProfileParcelDataSource, - NewServiceRoutePolicyProfileParcelDataSource, NewServiceTrackerProfileParcelDataSource, NewServiceTrackerGroupProfileParcelDataSource, NewSystemAAAProfileParcelDataSource, diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 438abe6fb..71942e458 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -1,12 +1,12 @@ ---- -subcategory: "Guides" -page_title: "Changelog" -description: |- - Changelog ---- - -# Changelog - +--- +subcategory: "Guides" +page_title: "Changelog" +description: |- + Changelog +--- + +# Changelog + ## 0.3.14 (unreleased) - Fix issue when reading deleted `sdwan_cli_config_profile_parcel` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/291) @@ -329,4 +329,4 @@ description: |- ## 0.1.0 (July 23, 2021) - Initial Release - +