diff --git a/gen/definitions/ipv4_access_list_entry.yaml b/gen/definitions/ipv4_access_list_entry.yaml index 56173434..29c9682f 100644 --- a/gen/definitions/ipv4_access_list_entry.yaml +++ b/gen/definitions/ipv4_access_list_entry.yaml @@ -8,6 +8,7 @@ doc_path: Security%20and%20Policing/ipv4acl:ACE/ doc_category: IPv4 parents: - IPv4 Access List +status_replace: true attributes: - nxos_name: name tf_name: name diff --git a/gen/generator.go b/gen/generator.go index c2dfeefc..50662934 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -99,6 +99,7 @@ type YamlConfig struct { ClassName string `yaml:"class_name"` Dn string `yaml:"dn"` NoDelete bool `yaml:"no_delete"` + StatusReplace bool `yaml:"status_replace"` TestTags []string `yaml:"test_tags"` DsDescription string `yaml:"ds_description"` ResDescription string `yaml:"res_description"` diff --git a/gen/schema/schema.yaml b/gen/schema/schema.yaml index 2fd498f8..f1ccda2e 100644 --- a/gen/schema/schema.yaml +++ b/gen/schema/schema.yaml @@ -11,6 +11,7 @@ doc_category: str() parents: list(str(), required=False) children: list(str(), required=False) references: list(str(), required=False) +status_replace: bool(required=False) attributes: list(include('attribute'), required=False) child_classes: list(include('child_classes'), required=False) test_prerequisites: list(include('test_prerequisite'), required=False) diff --git a/gen/templates/model.go b/gen/templates/model.go index d563d814..b47f3e22 100644 --- a/gen/templates/model.go +++ b/gen/templates/model.go @@ -83,9 +83,12 @@ func (data {{camelCase .Name}}) getClassName() string { return "{{.ClassName}}" } -func (data {{camelCase .Name}}) toBody() nxos.Body { +func (data {{camelCase .Name}}) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if (statusReplace){ + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } {{- range .Attributes}} {{- if not .ReferenceOnly}} if (!data.{{toGoName .TfName}}.IsUnknown() && !data.{{toGoName .TfName}}.IsNull()) || {{not .OmitEmptyValue}} { diff --git a/gen/templates/resource.go b/gen/templates/resource.go index 31148370..a44f96d6 100644 --- a/gen/templates/resource.go +++ b/gen/templates/resource.go @@ -263,7 +263,7 @@ func (r *{{camelCase .Name}}Resource) Create(ctx context.Context, req resource.C tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -328,7 +328,11 @@ func (r *{{camelCase .Name}}Resource) Update(ctx context.Context, req resource.U tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() +{{ if .StatusReplace}} + body := plan.toBody(true) +{{ else}} + body := plan.toBody(false) +{{ end}} _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/model_nxos_bgp.go b/internal/provider/model_nxos_bgp.go index ba8e27ae..b51d5871 100644 --- a/internal/provider/model_nxos_bgp.go +++ b/internal/provider/model_nxos_bgp.go @@ -40,9 +40,12 @@ func (data BGP) getClassName() string { return "bgpEntity" } -func (data BGP) toBody() nxos.Body { +func (data BGP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_address_family.go b/internal/provider/model_nxos_bgp_address_family.go index f4562a28..41c5f71e 100644 --- a/internal/provider/model_nxos_bgp_address_family.go +++ b/internal/provider/model_nxos_bgp_address_family.go @@ -47,9 +47,12 @@ func (data BGPAddressFamily) getClassName() string { return "bgpDomAf" } -func (data BGPAddressFamily) toBody() nxos.Body { +func (data BGPAddressFamily) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AddressFamily.IsUnknown() && !data.AddressFamily.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"type", data.AddressFamily.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_advertised_prefix.go b/internal/provider/model_nxos_bgp_advertised_prefix.go index d5246761..b721c3f6 100644 --- a/internal/provider/model_nxos_bgp_advertised_prefix.go +++ b/internal/provider/model_nxos_bgp_advertised_prefix.go @@ -46,9 +46,12 @@ func (data BGPAdvertisedPrefix) getClassName() string { return "bgpAdvPrefix" } -func (data BGPAdvertisedPrefix) toBody() nxos.Body { +func (data BGPAdvertisedPrefix) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Prefix.IsUnknown() && !data.Prefix.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"addr", data.Prefix.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_graceful_restart.go b/internal/provider/model_nxos_bgp_graceful_restart.go index f4320d20..db27be49 100644 --- a/internal/provider/model_nxos_bgp_graceful_restart.go +++ b/internal/provider/model_nxos_bgp_graceful_restart.go @@ -46,9 +46,12 @@ func (data BGPGracefulRestart) getClassName() string { return "bgpGr" } -func (data BGPGracefulRestart) toBody() nxos.Body { +func (data BGPGracefulRestart) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.RestartInterval.IsUnknown() && !data.RestartInterval.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"restartIntvl", strconv.FormatInt(data.RestartInterval.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_bgp_instance.go b/internal/provider/model_nxos_bgp_instance.go index f5f0f7a6..de8244e3 100644 --- a/internal/provider/model_nxos_bgp_instance.go +++ b/internal/provider/model_nxos_bgp_instance.go @@ -45,9 +45,12 @@ func (data BGPInstance) getClassName() string { return "bgpInst" } -func (data BGPInstance) toBody() nxos.Body { +func (data BGPInstance) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer.go b/internal/provider/model_nxos_bgp_peer.go index 951ba2ac..c13dc894 100644 --- a/internal/provider/model_nxos_bgp_peer.go +++ b/internal/provider/model_nxos_bgp_peer.go @@ -56,9 +56,12 @@ func (data BGPPeer) getClassName() string { return "bgpPeer" } -func (data BGPPeer) toBody() nxos.Body { +func (data BGPPeer) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Address.IsUnknown() && !data.Address.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"addr", data.Address.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer_address_family.go b/internal/provider/model_nxos_bgp_peer_address_family.go index dea0d776..ea5a5fe4 100644 --- a/internal/provider/model_nxos_bgp_peer_address_family.go +++ b/internal/provider/model_nxos_bgp_peer_address_family.go @@ -48,9 +48,12 @@ func (data BGPPeerAddressFamily) getClassName() string { return "bgpPeerAf" } -func (data BGPPeerAddressFamily) toBody() nxos.Body { +func (data BGPPeerAddressFamily) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AddressFamily.IsUnknown() && !data.AddressFamily.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"type", data.AddressFamily.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer_address_family_prefix_list_control.go b/internal/provider/model_nxos_bgp_peer_address_family_prefix_list_control.go index 9870747c..00529282 100644 --- a/internal/provider/model_nxos_bgp_peer_address_family_prefix_list_control.go +++ b/internal/provider/model_nxos_bgp_peer_address_family_prefix_list_control.go @@ -47,9 +47,12 @@ func (data BGPPeerAddressFamilyPrefixListControl) getClassName() string { return "bgpPfxCtrlP" } -func (data BGPPeerAddressFamilyPrefixListControl) toBody() nxos.Body { +func (data BGPPeerAddressFamilyPrefixListControl) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Direction.IsUnknown() && !data.Direction.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"direction", data.Direction.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer_address_family_route_control.go b/internal/provider/model_nxos_bgp_peer_address_family_route_control.go index f15adcb7..b3638d1e 100644 --- a/internal/provider/model_nxos_bgp_peer_address_family_route_control.go +++ b/internal/provider/model_nxos_bgp_peer_address_family_route_control.go @@ -47,9 +47,12 @@ func (data BGPPeerAddressFamilyRouteControl) getClassName() string { return "bgpRtCtrlP" } -func (data BGPPeerAddressFamilyRouteControl) toBody() nxos.Body { +func (data BGPPeerAddressFamilyRouteControl) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Direction.IsUnknown() && !data.Direction.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"direction", data.Direction.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer_local_asn.go b/internal/provider/model_nxos_bgp_peer_local_asn.go index ab3a9ef8..3c7d477f 100644 --- a/internal/provider/model_nxos_bgp_peer_local_asn.go +++ b/internal/provider/model_nxos_bgp_peer_local_asn.go @@ -45,9 +45,12 @@ func (data BGPPeerLocalASN) getClassName() string { return "bgpLocalAsn" } -func (data BGPPeerLocalASN) toBody() nxos.Body { +func (data BGPPeerLocalASN) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AsnPropagation.IsUnknown() && !data.AsnPropagation.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"asnPropagate", data.AsnPropagation.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer_template.go b/internal/provider/model_nxos_bgp_peer_template.go index 0ba33b73..5df4813c 100644 --- a/internal/provider/model_nxos_bgp_peer_template.go +++ b/internal/provider/model_nxos_bgp_peer_template.go @@ -47,9 +47,12 @@ func (data BGPPeerTemplate) getClassName() string { return "bgpPeerCont" } -func (data BGPPeerTemplate) toBody() nxos.Body { +func (data BGPPeerTemplate) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.TemplateName.IsUnknown() && !data.TemplateName.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.TemplateName.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer_template_address_family.go b/internal/provider/model_nxos_bgp_peer_template_address_family.go index bb195854..d82a38e5 100644 --- a/internal/provider/model_nxos_bgp_peer_template_address_family.go +++ b/internal/provider/model_nxos_bgp_peer_template_address_family.go @@ -47,9 +47,12 @@ func (data BGPPeerTemplateAddressFamily) getClassName() string { return "bgpPeerAf" } -func (data BGPPeerTemplateAddressFamily) toBody() nxos.Body { +func (data BGPPeerTemplateAddressFamily) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AddressFamily.IsUnknown() && !data.AddressFamily.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"type", data.AddressFamily.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_peer_template_max_prefix.go b/internal/provider/model_nxos_bgp_peer_template_max_prefix.go index 10a16f42..cba72218 100644 --- a/internal/provider/model_nxos_bgp_peer_template_max_prefix.go +++ b/internal/provider/model_nxos_bgp_peer_template_max_prefix.go @@ -49,9 +49,12 @@ func (data BGPPeerTemplateMaxPrefix) getClassName() string { return "bgpMaxPfxP" } -func (data BGPPeerTemplateMaxPrefix) toBody() nxos.Body { +func (data BGPPeerTemplateMaxPrefix) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Action.IsUnknown() && !data.Action.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"action", data.Action.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_route_control.go b/internal/provider/model_nxos_bgp_route_control.go index 73485963..dd631029 100644 --- a/internal/provider/model_nxos_bgp_route_control.go +++ b/internal/provider/model_nxos_bgp_route_control.go @@ -47,9 +47,12 @@ func (data BGPRouteControl) getClassName() string { return "bgpRtCtrl" } -func (data BGPRouteControl) toBody() nxos.Body { +func (data BGPRouteControl) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.EnforceFirstAs.IsUnknown() && !data.EnforceFirstAs.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"enforceFirstAs", data.EnforceFirstAs.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_route_redistribution.go b/internal/provider/model_nxos_bgp_route_redistribution.go index ef5b61bd..86a57a86 100644 --- a/internal/provider/model_nxos_bgp_route_redistribution.go +++ b/internal/provider/model_nxos_bgp_route_redistribution.go @@ -49,9 +49,12 @@ func (data BGPRouteRedistribution) getClassName() string { return "bgpInterLeakP" } -func (data BGPRouteRedistribution) toBody() nxos.Body { +func (data BGPRouteRedistribution) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Protocol.IsUnknown() && !data.Protocol.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"proto", data.Protocol.ValueString()) } diff --git a/internal/provider/model_nxos_bgp_vrf.go b/internal/provider/model_nxos_bgp_vrf.go index a9fb4770..8e6223d6 100644 --- a/internal/provider/model_nxos_bgp_vrf.go +++ b/internal/provider/model_nxos_bgp_vrf.go @@ -44,9 +44,12 @@ func (data BGPVRF) getClassName() string { return "bgpDom" } -func (data BGPVRF) toBody() nxos.Body { +func (data BGPVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_bridge_domain.go b/internal/provider/model_nxos_bridge_domain.go index b9391971..1681409f 100644 --- a/internal/provider/model_nxos_bridge_domain.go +++ b/internal/provider/model_nxos_bridge_domain.go @@ -44,9 +44,12 @@ func (data BridgeDomain) getClassName() string { return "l2BD" } -func (data BridgeDomain) toBody() nxos.Body { +func (data BridgeDomain) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.FabricEncap.IsUnknown() && !data.FabricEncap.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"fabEncap", data.FabricEncap.ValueString()) } diff --git a/internal/provider/model_nxos_default_qos_class_map.go b/internal/provider/model_nxos_default_qos_class_map.go index d073fd1f..300285f7 100644 --- a/internal/provider/model_nxos_default_qos_class_map.go +++ b/internal/provider/model_nxos_default_qos_class_map.go @@ -43,9 +43,12 @@ func (data DefaultQOSClassMap) getClassName() string { return "ipqosCMapInst" } -func (data DefaultQOSClassMap) toBody() nxos.Body { +func (data DefaultQOSClassMap) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_default_qos_class_map_dscp.go b/internal/provider/model_nxos_default_qos_class_map_dscp.go index 1303311b..40113408 100644 --- a/internal/provider/model_nxos_default_qos_class_map_dscp.go +++ b/internal/provider/model_nxos_default_qos_class_map_dscp.go @@ -43,9 +43,12 @@ func (data DefaultQOSClassMapDSCP) getClassName() string { return "ipqosDscp" } -func (data DefaultQOSClassMapDSCP) toBody() nxos.Body { +func (data DefaultQOSClassMapDSCP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Value.IsUnknown() && !data.Value.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"val", data.Value.ValueString()) } diff --git a/internal/provider/model_nxos_default_qos_policy_interface_in.go b/internal/provider/model_nxos_default_qos_policy_interface_in.go index 4048f5de..954998c9 100644 --- a/internal/provider/model_nxos_default_qos_policy_interface_in.go +++ b/internal/provider/model_nxos_default_qos_policy_interface_in.go @@ -42,9 +42,12 @@ func (data DefaultQOSPolicyInterfaceIn) getClassName() string { return "ipqosIf" } -func (data DefaultQOSPolicyInterfaceIn) toBody() nxos.Body { +func (data DefaultQOSPolicyInterfaceIn) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_default_qos_policy_interface_in_policy_map.go b/internal/provider/model_nxos_default_qos_policy_interface_in_policy_map.go index 5c2468c0..1ef5ef46 100644 --- a/internal/provider/model_nxos_default_qos_policy_interface_in_policy_map.go +++ b/internal/provider/model_nxos_default_qos_policy_interface_in_policy_map.go @@ -43,9 +43,12 @@ func (data DefaultQOSPolicyInterfaceInPolicyMap) getClassName() string { return "ipqosInst" } -func (data DefaultQOSPolicyInterfaceInPolicyMap) toBody() nxos.Body { +func (data DefaultQOSPolicyInterfaceInPolicyMap) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.PolicyMapName.IsUnknown() && !data.PolicyMapName.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.PolicyMapName.ValueString()) } diff --git a/internal/provider/model_nxos_default_qos_policy_map.go b/internal/provider/model_nxos_default_qos_policy_map.go index aa0f758c..a1ac0c72 100644 --- a/internal/provider/model_nxos_default_qos_policy_map.go +++ b/internal/provider/model_nxos_default_qos_policy_map.go @@ -43,9 +43,12 @@ func (data DefaultQOSPolicyMap) getClassName() string { return "ipqosPMapInst" } -func (data DefaultQOSPolicyMap) toBody() nxos.Body { +func (data DefaultQOSPolicyMap) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_default_qos_policy_map_match_class_map.go b/internal/provider/model_nxos_default_qos_policy_map_match_class_map.go index e9eb90a0..0757765e 100644 --- a/internal/provider/model_nxos_default_qos_policy_map_match_class_map.go +++ b/internal/provider/model_nxos_default_qos_policy_map_match_class_map.go @@ -43,9 +43,12 @@ func (data DefaultQOSPolicyMapMatchClassMap) getClassName() string { return "ipqosMatchCMap" } -func (data DefaultQOSPolicyMapMatchClassMap) toBody() nxos.Body { +func (data DefaultQOSPolicyMapMatchClassMap) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_default_qos_policy_map_match_class_map_police.go b/internal/provider/model_nxos_default_qos_policy_map_match_class_map_police.go index b741cc45..f4bdbd5f 100644 --- a/internal/provider/model_nxos_default_qos_policy_map_match_class_map_police.go +++ b/internal/provider/model_nxos_default_qos_policy_map_match_class_map_police.go @@ -67,9 +67,12 @@ func (data DefaultQOSPolicyMapMatchClassMapPolice) getClassName() string { return "ipqosPolice" } -func (data DefaultQOSPolicyMapMatchClassMapPolice) toBody() nxos.Body { +func (data DefaultQOSPolicyMapMatchClassMapPolice) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.BcRate.IsUnknown() && !data.BcRate.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"bcRate", strconv.FormatInt(data.BcRate.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_default_qos_policy_map_match_class_map_set_qos_group.go b/internal/provider/model_nxos_default_qos_policy_map_match_class_map_set_qos_group.go index 9b4d1e79..a206ee41 100644 --- a/internal/provider/model_nxos_default_qos_policy_map_match_class_map_set_qos_group.go +++ b/internal/provider/model_nxos_default_qos_policy_map_match_class_map_set_qos_group.go @@ -45,9 +45,12 @@ func (data DefaultQOSPolicyMapMatchClassMapSetQOSGroup) getClassName() string { return "ipqosSetQoSGrp" } -func (data DefaultQOSPolicyMapMatchClassMapSetQOSGroup) toBody() nxos.Body { +func (data DefaultQOSPolicyMapMatchClassMapSetQOSGroup) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.QosGroupId.IsUnknown() && !data.QosGroupId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", strconv.FormatInt(data.QosGroupId.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_dhcp_relay_address.go b/internal/provider/model_nxos_dhcp_relay_address.go index 2b7fd340..c13882fc 100644 --- a/internal/provider/model_nxos_dhcp_relay_address.go +++ b/internal/provider/model_nxos_dhcp_relay_address.go @@ -44,9 +44,12 @@ func (data DHCPRelayAddress) getClassName() string { return "dhcpRelayAddr" } -func (data DHCPRelayAddress) toBody() nxos.Body { +func (data DHCPRelayAddress) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Vrf.IsUnknown() && !data.Vrf.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"vrf", data.Vrf.ValueString()) } diff --git a/internal/provider/model_nxos_dhcp_relay_interface.go b/internal/provider/model_nxos_dhcp_relay_interface.go index b0c67e51..cb34ad85 100644 --- a/internal/provider/model_nxos_dhcp_relay_interface.go +++ b/internal/provider/model_nxos_dhcp_relay_interface.go @@ -42,9 +42,12 @@ func (data DHCPRelayInterface) getClassName() string { return "dhcpRelayIf" } -func (data DHCPRelayInterface) toBody() nxos.Body { +func (data DHCPRelayInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_ethernet.go b/internal/provider/model_nxos_ethernet.go index 7fd1ea80..1120709a 100644 --- a/internal/provider/model_nxos_ethernet.go +++ b/internal/provider/model_nxos_ethernet.go @@ -43,9 +43,12 @@ func (data Ethernet) getClassName() string { return "ethpmInst" } -func (data Ethernet) toBody() nxos.Body { +func (data Ethernet) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Mtu.IsUnknown() && !data.Mtu.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"systemJumboMtu", strconv.FormatInt(data.Mtu.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_evpn.go b/internal/provider/model_nxos_evpn.go index 4ca3d435..ac71fa35 100644 --- a/internal/provider/model_nxos_evpn.go +++ b/internal/provider/model_nxos_evpn.go @@ -40,9 +40,12 @@ func (data EVPN) getClassName() string { return "rtctrlL2Evpn" } -func (data EVPN) toBody() nxos.Body { +func (data EVPN) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_evpn_vni.go b/internal/provider/model_nxos_evpn_vni.go index 8470939a..825514b0 100644 --- a/internal/provider/model_nxos_evpn_vni.go +++ b/internal/provider/model_nxos_evpn_vni.go @@ -43,9 +43,12 @@ func (data EVPNVNI) getClassName() string { return "rtctrlBDEvi" } -func (data EVPNVNI) toBody() nxos.Body { +func (data EVPNVNI) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Encap.IsUnknown() && !data.Encap.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"encap", data.Encap.ValueString()) } diff --git a/internal/provider/model_nxos_evpn_vni_route_target.go b/internal/provider/model_nxos_evpn_vni_route_target.go index 70161325..8959e762 100644 --- a/internal/provider/model_nxos_evpn_vni_route_target.go +++ b/internal/provider/model_nxos_evpn_vni_route_target.go @@ -44,9 +44,12 @@ func (data EVPNVNIRouteTarget) getClassName() string { return "rtctrlRttEntry" } -func (data EVPNVNIRouteTarget) toBody() nxos.Body { +func (data EVPNVNIRouteTarget) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.RouteTarget.IsUnknown() && !data.RouteTarget.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"rtt", data.RouteTarget.ValueString()) } diff --git a/internal/provider/model_nxos_evpn_vni_route_target_direction.go b/internal/provider/model_nxos_evpn_vni_route_target_direction.go index eab58a23..b0e2e117 100644 --- a/internal/provider/model_nxos_evpn_vni_route_target_direction.go +++ b/internal/provider/model_nxos_evpn_vni_route_target_direction.go @@ -43,9 +43,12 @@ func (data EVPNVNIRouteTargetDirection) getClassName() string { return "rtctrlRttP" } -func (data EVPNVNIRouteTargetDirection) toBody() nxos.Body { +func (data EVPNVNIRouteTargetDirection) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Direction.IsUnknown() && !data.Direction.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"type", data.Direction.ValueString()) } diff --git a/internal/provider/model_nxos_feature_bfd.go b/internal/provider/model_nxos_feature_bfd.go index 7fe442a5..225fc08e 100644 --- a/internal/provider/model_nxos_feature_bfd.go +++ b/internal/provider/model_nxos_feature_bfd.go @@ -40,9 +40,12 @@ func (data FeatureBFD) getClassName() string { return "fmBfd" } -func (data FeatureBFD) toBody() nxos.Body { +func (data FeatureBFD) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_bgp.go b/internal/provider/model_nxos_feature_bgp.go index 6df9fb8c..3079c7ca 100644 --- a/internal/provider/model_nxos_feature_bgp.go +++ b/internal/provider/model_nxos_feature_bgp.go @@ -40,9 +40,12 @@ func (data FeatureBGP) getClassName() string { return "fmBgp" } -func (data FeatureBGP) toBody() nxos.Body { +func (data FeatureBGP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_dhcp.go b/internal/provider/model_nxos_feature_dhcp.go index b734cae3..01538b53 100644 --- a/internal/provider/model_nxos_feature_dhcp.go +++ b/internal/provider/model_nxos_feature_dhcp.go @@ -40,9 +40,12 @@ func (data FeatureDHCP) getClassName() string { return "fmDhcp" } -func (data FeatureDHCP) toBody() nxos.Body { +func (data FeatureDHCP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_evpn.go b/internal/provider/model_nxos_feature_evpn.go index ecd8f5a6..d3531294 100644 --- a/internal/provider/model_nxos_feature_evpn.go +++ b/internal/provider/model_nxos_feature_evpn.go @@ -40,9 +40,12 @@ func (data FeatureEVPN) getClassName() string { return "fmEvpn" } -func (data FeatureEVPN) toBody() nxos.Body { +func (data FeatureEVPN) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_hmm.go b/internal/provider/model_nxos_feature_hmm.go index 3fe1c7c6..93577339 100644 --- a/internal/provider/model_nxos_feature_hmm.go +++ b/internal/provider/model_nxos_feature_hmm.go @@ -40,9 +40,12 @@ func (data FeatureHMM) getClassName() string { return "fmHmm" } -func (data FeatureHMM) toBody() nxos.Body { +func (data FeatureHMM) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_hsrp.go b/internal/provider/model_nxos_feature_hsrp.go index c01848b6..ce3e8f39 100644 --- a/internal/provider/model_nxos_feature_hsrp.go +++ b/internal/provider/model_nxos_feature_hsrp.go @@ -40,9 +40,12 @@ func (data FeatureHSRP) getClassName() string { return "fmHsrp" } -func (data FeatureHSRP) toBody() nxos.Body { +func (data FeatureHSRP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_interface_vlan.go b/internal/provider/model_nxos_feature_interface_vlan.go index 395528c8..1f11b0c5 100644 --- a/internal/provider/model_nxos_feature_interface_vlan.go +++ b/internal/provider/model_nxos_feature_interface_vlan.go @@ -40,9 +40,12 @@ func (data FeatureInterfaceVLAN) getClassName() string { return "fmInterfaceVlan" } -func (data FeatureInterfaceVLAN) toBody() nxos.Body { +func (data FeatureInterfaceVLAN) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_isis.go b/internal/provider/model_nxos_feature_isis.go index 2f1c4d58..40acb10b 100644 --- a/internal/provider/model_nxos_feature_isis.go +++ b/internal/provider/model_nxos_feature_isis.go @@ -40,9 +40,12 @@ func (data FeatureISIS) getClassName() string { return "fmIsis" } -func (data FeatureISIS) toBody() nxos.Body { +func (data FeatureISIS) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_lacp.go b/internal/provider/model_nxos_feature_lacp.go index b4744edc..6efd72ba 100644 --- a/internal/provider/model_nxos_feature_lacp.go +++ b/internal/provider/model_nxos_feature_lacp.go @@ -40,9 +40,12 @@ func (data FeatureLACP) getClassName() string { return "fmLacp" } -func (data FeatureLACP) toBody() nxos.Body { +func (data FeatureLACP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_lldp.go b/internal/provider/model_nxos_feature_lldp.go index 3f2c1aa2..e1abd9f6 100644 --- a/internal/provider/model_nxos_feature_lldp.go +++ b/internal/provider/model_nxos_feature_lldp.go @@ -40,9 +40,12 @@ func (data FeatureLLDP) getClassName() string { return "fmLldp" } -func (data FeatureLLDP) toBody() nxos.Body { +func (data FeatureLLDP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_macsec.go b/internal/provider/model_nxos_feature_macsec.go index 41e07823..6c249af4 100644 --- a/internal/provider/model_nxos_feature_macsec.go +++ b/internal/provider/model_nxos_feature_macsec.go @@ -40,9 +40,12 @@ func (data FeatureMACsec) getClassName() string { return "fmMacsec" } -func (data FeatureMACsec) toBody() nxos.Body { +func (data FeatureMACsec) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_netflow.go b/internal/provider/model_nxos_feature_netflow.go index 96bd58bd..65d1e788 100644 --- a/internal/provider/model_nxos_feature_netflow.go +++ b/internal/provider/model_nxos_feature_netflow.go @@ -40,9 +40,12 @@ func (data FeatureNetflow) getClassName() string { return "fmNetflow" } -func (data FeatureNetflow) toBody() nxos.Body { +func (data FeatureNetflow) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_nv_overlay.go b/internal/provider/model_nxos_feature_nv_overlay.go index 088ecb8a..190f53a5 100644 --- a/internal/provider/model_nxos_feature_nv_overlay.go +++ b/internal/provider/model_nxos_feature_nv_overlay.go @@ -40,9 +40,12 @@ func (data FeatureNVOverlay) getClassName() string { return "fmNvo" } -func (data FeatureNVOverlay) toBody() nxos.Body { +func (data FeatureNVOverlay) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_ospf.go b/internal/provider/model_nxos_feature_ospf.go index ee9ff2da..d2fddbe1 100644 --- a/internal/provider/model_nxos_feature_ospf.go +++ b/internal/provider/model_nxos_feature_ospf.go @@ -40,9 +40,12 @@ func (data FeatureOSPF) getClassName() string { return "fmOspf" } -func (data FeatureOSPF) toBody() nxos.Body { +func (data FeatureOSPF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_ospfv3.go b/internal/provider/model_nxos_feature_ospfv3.go index b917d552..7cf7e8ea 100644 --- a/internal/provider/model_nxos_feature_ospfv3.go +++ b/internal/provider/model_nxos_feature_ospfv3.go @@ -40,9 +40,12 @@ func (data FeatureOSPFv3) getClassName() string { return "fmOspfv3" } -func (data FeatureOSPFv3) toBody() nxos.Body { +func (data FeatureOSPFv3) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_pim.go b/internal/provider/model_nxos_feature_pim.go index 6e1a914b..950e87c7 100644 --- a/internal/provider/model_nxos_feature_pim.go +++ b/internal/provider/model_nxos_feature_pim.go @@ -40,9 +40,12 @@ func (data FeaturePIM) getClassName() string { return "fmPim" } -func (data FeaturePIM) toBody() nxos.Body { +func (data FeaturePIM) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_ptp.go b/internal/provider/model_nxos_feature_ptp.go index e078dfd5..6a2a23b3 100644 --- a/internal/provider/model_nxos_feature_ptp.go +++ b/internal/provider/model_nxos_feature_ptp.go @@ -40,9 +40,12 @@ func (data FeaturePTP) getClassName() string { return "fmPtp" } -func (data FeaturePTP) toBody() nxos.Body { +func (data FeaturePTP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_pvlan.go b/internal/provider/model_nxos_feature_pvlan.go index 71d2f259..1af5b0fc 100644 --- a/internal/provider/model_nxos_feature_pvlan.go +++ b/internal/provider/model_nxos_feature_pvlan.go @@ -40,9 +40,12 @@ func (data FeaturePVLAN) getClassName() string { return "fmPvlan" } -func (data FeaturePVLAN) toBody() nxos.Body { +func (data FeaturePVLAN) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_ssh.go b/internal/provider/model_nxos_feature_ssh.go index be274895..984e5c0a 100644 --- a/internal/provider/model_nxos_feature_ssh.go +++ b/internal/provider/model_nxos_feature_ssh.go @@ -40,9 +40,12 @@ func (data FeatureSSH) getClassName() string { return "fmSsh" } -func (data FeatureSSH) toBody() nxos.Body { +func (data FeatureSSH) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_tacacs.go b/internal/provider/model_nxos_feature_tacacs.go index bfb7229c..8c05975b 100644 --- a/internal/provider/model_nxos_feature_tacacs.go +++ b/internal/provider/model_nxos_feature_tacacs.go @@ -40,9 +40,12 @@ func (data FeatureTACACS) getClassName() string { return "fmTacacsplus" } -func (data FeatureTACACS) toBody() nxos.Body { +func (data FeatureTACACS) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_telnet.go b/internal/provider/model_nxos_feature_telnet.go index a97c72ff..5ec3160b 100644 --- a/internal/provider/model_nxos_feature_telnet.go +++ b/internal/provider/model_nxos_feature_telnet.go @@ -40,9 +40,12 @@ func (data FeatureTelnet) getClassName() string { return "fmTelnet" } -func (data FeatureTelnet) toBody() nxos.Body { +func (data FeatureTelnet) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_udld.go b/internal/provider/model_nxos_feature_udld.go index 92404005..f51f9f9f 100644 --- a/internal/provider/model_nxos_feature_udld.go +++ b/internal/provider/model_nxos_feature_udld.go @@ -40,9 +40,12 @@ func (data FeatureUDLD) getClassName() string { return "fmUdld" } -func (data FeatureUDLD) toBody() nxos.Body { +func (data FeatureUDLD) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_vn_segment.go b/internal/provider/model_nxos_feature_vn_segment.go index eb60019f..0de35e89 100644 --- a/internal/provider/model_nxos_feature_vn_segment.go +++ b/internal/provider/model_nxos_feature_vn_segment.go @@ -40,9 +40,12 @@ func (data FeatureVNSegment) getClassName() string { return "fmVnSegment" } -func (data FeatureVNSegment) toBody() nxos.Body { +func (data FeatureVNSegment) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_feature_vpc.go b/internal/provider/model_nxos_feature_vpc.go index f3aa66bf..d3e7c415 100644 --- a/internal/provider/model_nxos_feature_vpc.go +++ b/internal/provider/model_nxos_feature_vpc.go @@ -40,9 +40,12 @@ func (data FeatureVPC) getClassName() string { return "fmVpc" } -func (data FeatureVPC) toBody() nxos.Body { +func (data FeatureVPC) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_hmm.go b/internal/provider/model_nxos_hmm.go index 6042852f..7851a4a8 100644 --- a/internal/provider/model_nxos_hmm.go +++ b/internal/provider/model_nxos_hmm.go @@ -40,9 +40,12 @@ func (data HMM) getClassName() string { return "hmmEntity" } -func (data HMM) toBody() nxos.Body { +func (data HMM) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_hmm_instance.go b/internal/provider/model_nxos_hmm_instance.go index 1badf148..0a3f4640 100644 --- a/internal/provider/model_nxos_hmm_instance.go +++ b/internal/provider/model_nxos_hmm_instance.go @@ -41,9 +41,12 @@ func (data HMMInstance) getClassName() string { return "hmmFwdInst" } -func (data HMMInstance) toBody() nxos.Body { +func (data HMMInstance) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_hmm_interface.go b/internal/provider/model_nxos_hmm_interface.go index 8197e801..92e55014 100644 --- a/internal/provider/model_nxos_hmm_interface.go +++ b/internal/provider/model_nxos_hmm_interface.go @@ -44,9 +44,12 @@ func (data HMMInterface) getClassName() string { return "hmmFwdIf" } -func (data HMMInterface) toBody() nxos.Body { +func (data HMMInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_access_list.go b/internal/provider/model_nxos_ipv4_access_list.go index e701e7e2..abf3f944 100644 --- a/internal/provider/model_nxos_ipv4_access_list.go +++ b/internal/provider/model_nxos_ipv4_access_list.go @@ -42,9 +42,12 @@ func (data IPv4AccessList) getClassName() string { return "ipv4aclACL" } -func (data IPv4AccessList) toBody() nxos.Body { +func (data IPv4AccessList) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_access_list_entry.go b/internal/provider/model_nxos_ipv4_access_list_entry.go index 4a506241..9862c570 100644 --- a/internal/provider/model_nxos_ipv4_access_list_entry.go +++ b/internal/provider/model_nxos_ipv4_access_list_entry.go @@ -90,9 +90,12 @@ func (data IPv4AccessListEntry) getClassName() string { return "ipv4aclACE" } -func (data IPv4AccessListEntry) toBody() nxos.Body { +func (data IPv4AccessListEntry) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.SequenceNumber.IsUnknown() && !data.SequenceNumber.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"seqNum", strconv.FormatInt(data.SequenceNumber.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_ipv4_access_list_policy_egress_interface.go b/internal/provider/model_nxos_ipv4_access_list_policy_egress_interface.go index c8c88b2e..74a3fa33 100644 --- a/internal/provider/model_nxos_ipv4_access_list_policy_egress_interface.go +++ b/internal/provider/model_nxos_ipv4_access_list_policy_egress_interface.go @@ -43,9 +43,12 @@ func (data IPv4AccessListPolicyEgressInterface) getClassName() string { return "aclIf" } -func (data IPv4AccessListPolicyEgressInterface) toBody() nxos.Body { +func (data IPv4AccessListPolicyEgressInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_access_list_policy_ingress_interface.go b/internal/provider/model_nxos_ipv4_access_list_policy_ingress_interface.go index db9a9ee3..b8f72dba 100644 --- a/internal/provider/model_nxos_ipv4_access_list_policy_ingress_interface.go +++ b/internal/provider/model_nxos_ipv4_access_list_policy_ingress_interface.go @@ -43,9 +43,12 @@ func (data IPv4AccessListPolicyIngressInterface) getClassName() string { return "aclIf" } -func (data IPv4AccessListPolicyIngressInterface) toBody() nxos.Body { +func (data IPv4AccessListPolicyIngressInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_interface.go b/internal/provider/model_nxos_ipv4_interface.go index 4ae35e00..8b71d02d 100644 --- a/internal/provider/model_nxos_ipv4_interface.go +++ b/internal/provider/model_nxos_ipv4_interface.go @@ -47,9 +47,12 @@ func (data IPv4Interface) getClassName() string { return "ipv4If" } -func (data IPv4Interface) toBody() nxos.Body { +func (data IPv4Interface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_interface_address.go b/internal/provider/model_nxos_ipv4_interface_address.go index 3f2c9c83..0b9ede57 100644 --- a/internal/provider/model_nxos_ipv4_interface_address.go +++ b/internal/provider/model_nxos_ipv4_interface_address.go @@ -45,9 +45,12 @@ func (data IPv4InterfaceAddress) getClassName() string { return "ipv4Addr" } -func (data IPv4InterfaceAddress) toBody() nxos.Body { +func (data IPv4InterfaceAddress) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Address.IsUnknown() && !data.Address.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"addr", data.Address.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_prefix_list_rule.go b/internal/provider/model_nxos_ipv4_prefix_list_rule.go index c2091f53..2f70376b 100644 --- a/internal/provider/model_nxos_ipv4_prefix_list_rule.go +++ b/internal/provider/model_nxos_ipv4_prefix_list_rule.go @@ -42,9 +42,12 @@ func (data IPv4PrefixListRule) getClassName() string { return "rtpfxRuleV4" } -func (data IPv4PrefixListRule) toBody() nxos.Body { +func (data IPv4PrefixListRule) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_prefix_list_rule_entry.go b/internal/provider/model_nxos_ipv4_prefix_list_rule_entry.go index 02081d96..29b952c5 100644 --- a/internal/provider/model_nxos_ipv4_prefix_list_rule_entry.go +++ b/internal/provider/model_nxos_ipv4_prefix_list_rule_entry.go @@ -49,9 +49,12 @@ func (data IPv4PrefixListRuleEntry) getClassName() string { return "rtpfxEntry" } -func (data IPv4PrefixListRuleEntry) toBody() nxos.Body { +func (data IPv4PrefixListRuleEntry) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Order.IsUnknown() && !data.Order.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"order", strconv.FormatInt(data.Order.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_ipv4_static_route.go b/internal/provider/model_nxos_ipv4_static_route.go index 25846098..fecf7976 100644 --- a/internal/provider/model_nxos_ipv4_static_route.go +++ b/internal/provider/model_nxos_ipv4_static_route.go @@ -57,9 +57,12 @@ func (data IPv4StaticRoute) getClassName() string { return "ipv4Route" } -func (data IPv4StaticRoute) toBody() nxos.Body { +func (data IPv4StaticRoute) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Prefix.IsUnknown() && !data.Prefix.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"prefix", data.Prefix.ValueString()) } diff --git a/internal/provider/model_nxos_ipv4_vrf.go b/internal/provider/model_nxos_ipv4_vrf.go index 0f114446..c67e648b 100644 --- a/internal/provider/model_nxos_ipv4_vrf.go +++ b/internal/provider/model_nxos_ipv4_vrf.go @@ -42,9 +42,12 @@ func (data IPv4VRF) getClassName() string { return "ipv4Dom" } -func (data IPv4VRF) toBody() nxos.Body { +func (data IPv4VRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_isis.go b/internal/provider/model_nxos_isis.go index 8d5ba75d..604958ce 100644 --- a/internal/provider/model_nxos_isis.go +++ b/internal/provider/model_nxos_isis.go @@ -40,9 +40,12 @@ func (data ISIS) getClassName() string { return "isisEntity" } -func (data ISIS) toBody() nxos.Body { +func (data ISIS) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_isis_instance.go b/internal/provider/model_nxos_isis_instance.go index 441f5e67..b507c3c1 100644 --- a/internal/provider/model_nxos_isis_instance.go +++ b/internal/provider/model_nxos_isis_instance.go @@ -43,9 +43,12 @@ func (data ISISInstance) getClassName() string { return "isisInst" } -func (data ISISInstance) toBody() nxos.Body { +func (data ISISInstance) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_isis_interface.go b/internal/provider/model_nxos_isis_interface.go index 14b4fb33..768c4ae8 100644 --- a/internal/provider/model_nxos_isis_interface.go +++ b/internal/provider/model_nxos_isis_interface.go @@ -73,9 +73,12 @@ func (data ISISInterface) getClassName() string { return "isisInternalIf" } -func (data ISISInterface) toBody() nxos.Body { +func (data ISISInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_isis_vrf.go b/internal/provider/model_nxos_isis_vrf.go index b5fb387b..4267fcc1 100644 --- a/internal/provider/model_nxos_isis_vrf.go +++ b/internal/provider/model_nxos_isis_vrf.go @@ -59,9 +59,12 @@ func (data ISISVRF) getClassName() string { return "isisDom" } -func (data ISISVRF) toBody() nxos.Body { +func (data ISISVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_loopback_interface.go b/internal/provider/model_nxos_loopback_interface.go index 475a9b04..0975392d 100644 --- a/internal/provider/model_nxos_loopback_interface.go +++ b/internal/provider/model_nxos_loopback_interface.go @@ -44,9 +44,12 @@ func (data LoopbackInterface) getClassName() string { return "l3LbRtdIf" } -func (data LoopbackInterface) toBody() nxos.Body { +func (data LoopbackInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_loopback_interface_vrf.go b/internal/provider/model_nxos_loopback_interface_vrf.go index b6514ca4..f1a4de42 100644 --- a/internal/provider/model_nxos_loopback_interface_vrf.go +++ b/internal/provider/model_nxos_loopback_interface_vrf.go @@ -43,9 +43,12 @@ func (data LoopbackInterfaceVRF) getClassName() string { return "nwRtVrfMbr" } -func (data LoopbackInterfaceVRF) toBody() nxos.Body { +func (data LoopbackInterfaceVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.VrfDn.IsUnknown() && !data.VrfDn.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"tDn", data.VrfDn.ValueString()) } diff --git a/internal/provider/model_nxos_ntp_server.go b/internal/provider/model_nxos_ntp_server.go index 20c8741d..4619ebf1 100644 --- a/internal/provider/model_nxos_ntp_server.go +++ b/internal/provider/model_nxos_ntp_server.go @@ -48,9 +48,12 @@ func (data NTPServer) getClassName() string { return "datetimeNtpProvider" } -func (data NTPServer) toBody() nxos.Body { +func (data NTPServer) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_nve_interface.go b/internal/provider/model_nxos_nve_interface.go index d4492212..8c416d3a 100644 --- a/internal/provider/model_nxos_nve_interface.go +++ b/internal/provider/model_nxos_nve_interface.go @@ -53,9 +53,12 @@ func (data NVEInterface) getClassName() string { return "nvoEp" } -func (data NVEInterface) toBody() nxos.Body { +func (data NVEInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_nve_vni.go b/internal/provider/model_nxos_nve_vni.go index a3230225..fc947aca 100644 --- a/internal/provider/model_nxos_nve_vni.go +++ b/internal/provider/model_nxos_nve_vni.go @@ -48,9 +48,12 @@ func (data NVEVNI) getClassName() string { return "nvoNw" } -func (data NVEVNI) toBody() nxos.Body { +func (data NVEVNI) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Vni.IsUnknown() && !data.Vni.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"vni", strconv.FormatInt(data.Vni.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_nve_vni_container.go b/internal/provider/model_nxos_nve_vni_container.go index 8ca43830..7becc24c 100644 --- a/internal/provider/model_nxos_nve_vni_container.go +++ b/internal/provider/model_nxos_nve_vni_container.go @@ -39,9 +39,12 @@ func (data NVEVNIContainer) getClassName() string { return "nvoNws" } -func (data NVEVNIContainer) toBody() nxos.Body { +func (data NVEVNIContainer) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } return nxos.Body{body} } diff --git a/internal/provider/model_nxos_nve_vni_ingress_replication.go b/internal/provider/model_nxos_nve_vni_ingress_replication.go index ae37bbe5..862e2da6 100644 --- a/internal/provider/model_nxos_nve_vni_ingress_replication.go +++ b/internal/provider/model_nxos_nve_vni_ingress_replication.go @@ -43,9 +43,12 @@ func (data NVEVNIIngressReplication) getClassName() string { return "nvoIngRepl" } -func (data NVEVNIIngressReplication) toBody() nxos.Body { +func (data NVEVNIIngressReplication) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Protocol.IsUnknown() && !data.Protocol.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"proto", data.Protocol.ValueString()) } diff --git a/internal/provider/model_nxos_ospf.go b/internal/provider/model_nxos_ospf.go index 749f1f6a..02b8d6fa 100644 --- a/internal/provider/model_nxos_ospf.go +++ b/internal/provider/model_nxos_ospf.go @@ -40,9 +40,12 @@ func (data OSPF) getClassName() string { return "ospfEntity" } -func (data OSPF) toBody() nxos.Body { +func (data OSPF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_ospf_area.go b/internal/provider/model_nxos_ospf_area.go index 6e6072f8..ffc41bca 100644 --- a/internal/provider/model_nxos_ospf_area.go +++ b/internal/provider/model_nxos_ospf_area.go @@ -48,9 +48,12 @@ func (data OSPFArea) getClassName() string { return "ospfArea" } -func (data OSPFArea) toBody() nxos.Body { +func (data OSPFArea) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AreaId.IsUnknown() && !data.AreaId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.AreaId.ValueString()) } diff --git a/internal/provider/model_nxos_ospf_authentication.go b/internal/provider/model_nxos_ospf_authentication.go index 858cec9c..a027cadd 100644 --- a/internal/provider/model_nxos_ospf_authentication.go +++ b/internal/provider/model_nxos_ospf_authentication.go @@ -53,9 +53,12 @@ func (data OSPFAuthentication) getClassName() string { return "ospfAuthNewP" } -func (data OSPFAuthentication) toBody() nxos.Body { +func (data OSPFAuthentication) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Key.IsUnknown() && !data.Key.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"key", data.Key.ValueString()) } diff --git a/internal/provider/model_nxos_ospf_instance.go b/internal/provider/model_nxos_ospf_instance.go index 831bc28e..77a9da38 100644 --- a/internal/provider/model_nxos_ospf_instance.go +++ b/internal/provider/model_nxos_ospf_instance.go @@ -43,9 +43,12 @@ func (data OSPFInstance) getClassName() string { return "ospfInst" } -func (data OSPFInstance) toBody() nxos.Body { +func (data OSPFInstance) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_ospf_interface.go b/internal/provider/model_nxos_ospf_interface.go index 239a5941..66728bdb 100644 --- a/internal/provider/model_nxos_ospf_interface.go +++ b/internal/provider/model_nxos_ospf_interface.go @@ -55,9 +55,12 @@ func (data OSPFInterface) getClassName() string { return "ospfIf" } -func (data OSPFInterface) toBody() nxos.Body { +func (data OSPFInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_ospf_vrf.go b/internal/provider/model_nxos_ospf_vrf.go index fedf9179..c0dc47f0 100644 --- a/internal/provider/model_nxos_ospf_vrf.go +++ b/internal/provider/model_nxos_ospf_vrf.go @@ -50,9 +50,12 @@ func (data OSPFVRF) getClassName() string { return "ospfDom" } -func (data OSPFVRF) toBody() nxos.Body { +func (data OSPFVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_physical_interface.go b/internal/provider/model_nxos_physical_interface.go index c44997a4..3cb9aed8 100644 --- a/internal/provider/model_nxos_physical_interface.go +++ b/internal/provider/model_nxos_physical_interface.go @@ -64,9 +64,12 @@ func (data PhysicalInterface) getClassName() string { return "l1PhysIf" } -func (data PhysicalInterface) toBody() nxos.Body { +func (data PhysicalInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_physical_interface_vrf.go b/internal/provider/model_nxos_physical_interface_vrf.go index 39f425ff..b1ab2817 100644 --- a/internal/provider/model_nxos_physical_interface_vrf.go +++ b/internal/provider/model_nxos_physical_interface_vrf.go @@ -43,9 +43,12 @@ func (data PhysicalInterfaceVRF) getClassName() string { return "nwRtVrfMbr" } -func (data PhysicalInterfaceVRF) toBody() nxos.Body { +func (data PhysicalInterfaceVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.VrfDn.IsUnknown() && !data.VrfDn.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"tDn", data.VrfDn.ValueString()) } diff --git a/internal/provider/model_nxos_pim.go b/internal/provider/model_nxos_pim.go index 66902b30..48926f44 100644 --- a/internal/provider/model_nxos_pim.go +++ b/internal/provider/model_nxos_pim.go @@ -40,9 +40,12 @@ func (data PIM) getClassName() string { return "pimEntity" } -func (data PIM) toBody() nxos.Body { +func (data PIM) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_pim_anycast_rp.go b/internal/provider/model_nxos_pim_anycast_rp.go index ac9ef5ef..486c0fa6 100644 --- a/internal/provider/model_nxos_pim_anycast_rp.go +++ b/internal/provider/model_nxos_pim_anycast_rp.go @@ -44,9 +44,12 @@ func (data PIMAnycastRP) getClassName() string { return "pimAcastRPFuncP" } -func (data PIMAnycastRP) toBody() nxos.Body { +func (data PIMAnycastRP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.LocalInterface.IsUnknown() && !data.LocalInterface.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"localIf", data.LocalInterface.ValueString()) } diff --git a/internal/provider/model_nxos_pim_anycast_rp_peer.go b/internal/provider/model_nxos_pim_anycast_rp_peer.go index d9a00e47..95a61122 100644 --- a/internal/provider/model_nxos_pim_anycast_rp_peer.go +++ b/internal/provider/model_nxos_pim_anycast_rp_peer.go @@ -44,9 +44,12 @@ func (data PIMAnycastRPPeer) getClassName() string { return "pimAcastRPPeer" } -func (data PIMAnycastRPPeer) toBody() nxos.Body { +func (data PIMAnycastRPPeer) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Address.IsUnknown() && !data.Address.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"addr", data.Address.ValueString()) } diff --git a/internal/provider/model_nxos_pim_instance.go b/internal/provider/model_nxos_pim_instance.go index d9ff6bc1..cb318d08 100644 --- a/internal/provider/model_nxos_pim_instance.go +++ b/internal/provider/model_nxos_pim_instance.go @@ -40,9 +40,12 @@ func (data PIMInstance) getClassName() string { return "pimInst" } -func (data PIMInstance) toBody() nxos.Body { +func (data PIMInstance) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_pim_interface.go b/internal/provider/model_nxos_pim_interface.go index 9cb77c21..e317724c 100644 --- a/internal/provider/model_nxos_pim_interface.go +++ b/internal/provider/model_nxos_pim_interface.go @@ -50,9 +50,12 @@ func (data PIMInterface) getClassName() string { return "pimIf" } -func (data PIMInterface) toBody() nxos.Body { +func (data PIMInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_pim_ssm_policy.go b/internal/provider/model_nxos_pim_ssm_policy.go index 987f3599..3bd21e6a 100644 --- a/internal/provider/model_nxos_pim_ssm_policy.go +++ b/internal/provider/model_nxos_pim_ssm_policy.go @@ -43,9 +43,12 @@ func (data PIMSSMPolicy) getClassName() string { return "pimSSMPatP" } -func (data PIMSSMPolicy) toBody() nxos.Body { +func (data PIMSSMPolicy) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_pim_ssm_range.go b/internal/provider/model_nxos_pim_ssm_range.go index d4310273..bf22793c 100644 --- a/internal/provider/model_nxos_pim_ssm_range.go +++ b/internal/provider/model_nxos_pim_ssm_range.go @@ -51,9 +51,12 @@ func (data PIMSSMRange) getClassName() string { return "pimSSMRangeP" } -func (data PIMSSMRange) toBody() nxos.Body { +func (data PIMSSMRange) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.GroupList1.IsUnknown() && !data.GroupList1.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"grpList", data.GroupList1.ValueString()) } diff --git a/internal/provider/model_nxos_pim_static_rp.go b/internal/provider/model_nxos_pim_static_rp.go index f1910fb0..cee5ef94 100644 --- a/internal/provider/model_nxos_pim_static_rp.go +++ b/internal/provider/model_nxos_pim_static_rp.go @@ -43,9 +43,12 @@ func (data PIMStaticRP) getClassName() string { return "pimStaticRP" } -func (data PIMStaticRP) toBody() nxos.Body { +func (data PIMStaticRP) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Address.IsUnknown() && !data.Address.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"addr", data.Address.ValueString()) } diff --git a/internal/provider/model_nxos_pim_static_rp_group_list.go b/internal/provider/model_nxos_pim_static_rp_group_list.go index 63a3f94c..00af82a5 100644 --- a/internal/provider/model_nxos_pim_static_rp_group_list.go +++ b/internal/provider/model_nxos_pim_static_rp_group_list.go @@ -48,9 +48,12 @@ func (data PIMStaticRPGroupList) getClassName() string { return "pimRPGrpList" } -func (data PIMStaticRPGroupList) toBody() nxos.Body { +func (data PIMStaticRPGroupList) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Address.IsUnknown() && !data.Address.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"grpListName", data.Address.ValueString()) } diff --git a/internal/provider/model_nxos_pim_static_rp_policy.go b/internal/provider/model_nxos_pim_static_rp_policy.go index 2098b6fd..05065b51 100644 --- a/internal/provider/model_nxos_pim_static_rp_policy.go +++ b/internal/provider/model_nxos_pim_static_rp_policy.go @@ -43,9 +43,12 @@ func (data PIMStaticRPPolicy) getClassName() string { return "pimStaticRPP" } -func (data PIMStaticRPPolicy) toBody() nxos.Body { +func (data PIMStaticRPPolicy) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_pim_vrf.go b/internal/provider/model_nxos_pim_vrf.go index bf644ec7..50a738e1 100644 --- a/internal/provider/model_nxos_pim_vrf.go +++ b/internal/provider/model_nxos_pim_vrf.go @@ -46,9 +46,12 @@ func (data PIMVRF) getClassName() string { return "pimDom" } -func (data PIMVRF) toBody() nxos.Body { +func (data PIMVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_port_channel_interface.go b/internal/provider/model_nxos_port_channel_interface.go index aa813fb2..7564e840 100644 --- a/internal/provider/model_nxos_port_channel_interface.go +++ b/internal/provider/model_nxos_port_channel_interface.go @@ -63,9 +63,12 @@ func (data PortChannelInterface) getClassName() string { return "pcAggrIf" } -func (data PortChannelInterface) toBody() nxos.Body { +func (data PortChannelInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_port_channel_interface_member.go b/internal/provider/model_nxos_port_channel_interface_member.go index 7a628a2e..7338f54c 100644 --- a/internal/provider/model_nxos_port_channel_interface_member.go +++ b/internal/provider/model_nxos_port_channel_interface_member.go @@ -46,9 +46,12 @@ func (data PortChannelInterfaceMember) getClassName() string { return "pcRsMbrIfs" } -func (data PortChannelInterfaceMember) toBody() nxos.Body { +func (data PortChannelInterfaceMember) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceDn.IsUnknown() && !data.InterfaceDn.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"tDn", data.InterfaceDn.ValueString()) } diff --git a/internal/provider/model_nxos_port_channel_interface_vrf.go b/internal/provider/model_nxos_port_channel_interface_vrf.go index a12b76ff..06fa41ff 100644 --- a/internal/provider/model_nxos_port_channel_interface_vrf.go +++ b/internal/provider/model_nxos_port_channel_interface_vrf.go @@ -43,9 +43,12 @@ func (data PortChannelInterfaceVRF) getClassName() string { return "nwRtVrfMbr" } -func (data PortChannelInterfaceVRF) toBody() nxos.Body { +func (data PortChannelInterfaceVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.VrfDn.IsUnknown() && !data.VrfDn.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"tDn", data.VrfDn.ValueString()) } diff --git a/internal/provider/model_nxos_queuing_qos_policy_map.go b/internal/provider/model_nxos_queuing_qos_policy_map.go index 628705fb..4a611c5d 100644 --- a/internal/provider/model_nxos_queuing_qos_policy_map.go +++ b/internal/provider/model_nxos_queuing_qos_policy_map.go @@ -43,9 +43,12 @@ func (data QueuingQOSPolicyMap) getClassName() string { return "ipqosPMapInst" } -func (data QueuingQOSPolicyMap) toBody() nxos.Body { +func (data QueuingQOSPolicyMap) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map.go b/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map.go index 16404b3e..022036ed 100644 --- a/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map.go +++ b/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map.go @@ -43,9 +43,12 @@ func (data QueuingQOSPolicyMapMatchClassMap) getClassName() string { return "ipqosMatchCMap" } -func (data QueuingQOSPolicyMapMatchClassMap) toBody() nxos.Body { +func (data QueuingQOSPolicyMapMatchClassMap) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_priority.go b/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_priority.go index a30779b8..d2428a6d 100644 --- a/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_priority.go +++ b/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_priority.go @@ -45,9 +45,12 @@ func (data QueuingQOSPolicyMapMatchClassMapPriority) getClassName() string { return "ipqosPriority" } -func (data QueuingQOSPolicyMapMatchClassMapPriority) toBody() nxos.Body { +func (data QueuingQOSPolicyMapMatchClassMapPriority) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Level.IsUnknown() && !data.Level.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"level", strconv.FormatInt(data.Level.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go b/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go index e2b0876c..10ce58d1 100644 --- a/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go +++ b/internal/provider/model_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go @@ -45,9 +45,12 @@ func (data QueuingQOSPolicyMapMatchClassMapRemainingBandwidth) getClassName() st return "ipqosSetRemBW" } -func (data QueuingQOSPolicyMapMatchClassMapRemainingBandwidth) toBody() nxos.Body { +func (data QueuingQOSPolicyMapMatchClassMapRemainingBandwidth) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Value.IsUnknown() && !data.Value.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"val", strconv.FormatInt(data.Value.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_queuing_qos_policy_system_out.go b/internal/provider/model_nxos_queuing_qos_policy_system_out.go index f965399f..3885c936 100644 --- a/internal/provider/model_nxos_queuing_qos_policy_system_out.go +++ b/internal/provider/model_nxos_queuing_qos_policy_system_out.go @@ -39,9 +39,12 @@ func (data QueuingQOSPolicySystemOut) getClassName() string { return "ipqosSystem" } -func (data QueuingQOSPolicySystemOut) toBody() nxos.Body { +func (data QueuingQOSPolicySystemOut) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } return nxos.Body{body} } diff --git a/internal/provider/model_nxos_queuing_qos_policy_system_out_policy_map.go b/internal/provider/model_nxos_queuing_qos_policy_system_out_policy_map.go index f1ffcca1..8a3ee3c4 100644 --- a/internal/provider/model_nxos_queuing_qos_policy_system_out_policy_map.go +++ b/internal/provider/model_nxos_queuing_qos_policy_system_out_policy_map.go @@ -40,9 +40,12 @@ func (data QueuingQOSPolicySystemOutPolicyMap) getClassName() string { return "ipqosInst" } -func (data QueuingQOSPolicySystemOutPolicyMap) toBody() nxos.Body { +func (data QueuingQOSPolicySystemOutPolicyMap) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.PolicyMapName.IsUnknown() && !data.PolicyMapName.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.PolicyMapName.ValueString()) } diff --git a/internal/provider/model_nxos_route_map_rule.go b/internal/provider/model_nxos_route_map_rule.go index 470ea5f3..055d1b23 100644 --- a/internal/provider/model_nxos_route_map_rule.go +++ b/internal/provider/model_nxos_route_map_rule.go @@ -42,9 +42,12 @@ func (data RouteMapRule) getClassName() string { return "rtmapRule" } -func (data RouteMapRule) toBody() nxos.Body { +func (data RouteMapRule) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_route_map_rule_entry.go b/internal/provider/model_nxos_route_map_rule_entry.go index d300bf43..01375e0d 100644 --- a/internal/provider/model_nxos_route_map_rule_entry.go +++ b/internal/provider/model_nxos_route_map_rule_entry.go @@ -45,9 +45,12 @@ func (data RouteMapRuleEntry) getClassName() string { return "rtmapEntry" } -func (data RouteMapRuleEntry) toBody() nxos.Body { +func (data RouteMapRuleEntry) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Order.IsUnknown() && !data.Order.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"order", strconv.FormatInt(data.Order.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_route_map_rule_entry_match_route.go b/internal/provider/model_nxos_route_map_rule_entry_match_route.go index b9855d02..ce8c3aa7 100644 --- a/internal/provider/model_nxos_route_map_rule_entry_match_route.go +++ b/internal/provider/model_nxos_route_map_rule_entry_match_route.go @@ -43,9 +43,12 @@ func (data RouteMapRuleEntryMatchRoute) getClassName() string { return "rtmapMatchRtDst" } -func (data RouteMapRuleEntryMatchRoute) toBody() nxos.Body { +func (data RouteMapRuleEntryMatchRoute) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } return nxos.Body{body} } diff --git a/internal/provider/model_nxos_route_map_rule_entry_match_route_prefix_list.go b/internal/provider/model_nxos_route_map_rule_entry_match_route_prefix_list.go index 10e2408c..6f449c38 100644 --- a/internal/provider/model_nxos_route_map_rule_entry_match_route_prefix_list.go +++ b/internal/provider/model_nxos_route_map_rule_entry_match_route_prefix_list.go @@ -44,9 +44,12 @@ func (data RouteMapRuleEntryMatchRoutePrefixList) getClassName() string { return "rtmapRsRtDstAtt" } -func (data RouteMapRuleEntryMatchRoutePrefixList) toBody() nxos.Body { +func (data RouteMapRuleEntryMatchRoutePrefixList) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.PrefixListDn.IsUnknown() && !data.PrefixListDn.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"tDn", data.PrefixListDn.ValueString()) } diff --git a/internal/provider/model_nxos_route_map_rule_entry_set_regular_community.go b/internal/provider/model_nxos_route_map_rule_entry_set_regular_community.go index 81e8ad91..0e3f5070 100644 --- a/internal/provider/model_nxos_route_map_rule_entry_set_regular_community.go +++ b/internal/provider/model_nxos_route_map_rule_entry_set_regular_community.go @@ -46,9 +46,12 @@ func (data RouteMapRuleEntrySetRegularCommunity) getClassName() string { return "rtmapSetRegComm" } -func (data RouteMapRuleEntrySetRegularCommunity) toBody() nxos.Body { +func (data RouteMapRuleEntrySetRegularCommunity) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Additive.IsUnknown() && !data.Additive.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"additive", data.Additive.ValueString()) } diff --git a/internal/provider/model_nxos_route_map_rule_entry_set_regular_community_item.go b/internal/provider/model_nxos_route_map_rule_entry_set_regular_community_item.go index 1f7a88ff..a0ba704f 100644 --- a/internal/provider/model_nxos_route_map_rule_entry_set_regular_community_item.go +++ b/internal/provider/model_nxos_route_map_rule_entry_set_regular_community_item.go @@ -44,9 +44,12 @@ func (data RouteMapRuleEntrySetRegularCommunityItem) getClassName() string { return "rtregcomItem" } -func (data RouteMapRuleEntrySetRegularCommunityItem) toBody() nxos.Body { +func (data RouteMapRuleEntrySetRegularCommunityItem) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Community.IsUnknown() && !data.Community.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"community", data.Community.ValueString()) } diff --git a/internal/provider/model_nxos_spanning_tree_interface.go b/internal/provider/model_nxos_spanning_tree_interface.go index 278a1326..6b7806dc 100644 --- a/internal/provider/model_nxos_spanning_tree_interface.go +++ b/internal/provider/model_nxos_spanning_tree_interface.go @@ -51,9 +51,12 @@ func (data SpanningTreeInterface) getClassName() string { return "stpIf" } -func (data SpanningTreeInterface) toBody() nxos.Body { +func (data SpanningTreeInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_subinterface.go b/internal/provider/model_nxos_subinterface.go index 53079824..6e26e57c 100644 --- a/internal/provider/model_nxos_subinterface.go +++ b/internal/provider/model_nxos_subinterface.go @@ -51,9 +51,12 @@ func (data Subinterface) getClassName() string { return "l3EncRtdIf" } -func (data Subinterface) toBody() nxos.Body { +func (data Subinterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_subinterface_vrf.go b/internal/provider/model_nxos_subinterface_vrf.go index a9d0957f..8235fb57 100644 --- a/internal/provider/model_nxos_subinterface_vrf.go +++ b/internal/provider/model_nxos_subinterface_vrf.go @@ -43,9 +43,12 @@ func (data SubinterfaceVRF) getClassName() string { return "nwRtVrfMbr" } -func (data SubinterfaceVRF) toBody() nxos.Body { +func (data SubinterfaceVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.VrfDn.IsUnknown() && !data.VrfDn.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"tDn", data.VrfDn.ValueString()) } diff --git a/internal/provider/model_nxos_svi_interface.go b/internal/provider/model_nxos_svi_interface.go index 922de2c1..581c3429 100644 --- a/internal/provider/model_nxos_svi_interface.go +++ b/internal/provider/model_nxos_svi_interface.go @@ -49,9 +49,12 @@ func (data SVIInterface) getClassName() string { return "sviIf" } -func (data SVIInterface) toBody() nxos.Body { +func (data SVIInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.InterfaceId.IsUnknown() && !data.InterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.InterfaceId.ValueString()) } diff --git a/internal/provider/model_nxos_svi_interface_vrf.go b/internal/provider/model_nxos_svi_interface_vrf.go index 9b7f6594..2cd6a7b4 100644 --- a/internal/provider/model_nxos_svi_interface_vrf.go +++ b/internal/provider/model_nxos_svi_interface_vrf.go @@ -43,9 +43,12 @@ func (data SVIInterfaceVRF) getClassName() string { return "nwRtVrfMbr" } -func (data SVIInterfaceVRF) toBody() nxos.Body { +func (data SVIInterfaceVRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.VrfDn.IsUnknown() && !data.VrfDn.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"tDn", data.VrfDn.ValueString()) } diff --git a/internal/provider/model_nxos_system.go b/internal/provider/model_nxos_system.go index 0189e811..9225ca49 100644 --- a/internal/provider/model_nxos_system.go +++ b/internal/provider/model_nxos_system.go @@ -40,9 +40,12 @@ func (data System) getClassName() string { return "topSystem" } -func (data System) toBody() nxos.Body { +func (data System) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_vpc_domain.go b/internal/provider/model_nxos_vpc_domain.go index b7020f21..c72387e0 100644 --- a/internal/provider/model_nxos_vpc_domain.go +++ b/internal/provider/model_nxos_vpc_domain.go @@ -62,9 +62,12 @@ func (data VPCDomain) getClassName() string { return "vpcDom" } -func (data VPCDomain) toBody() nxos.Body { +func (data VPCDomain) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_vpc_instance.go b/internal/provider/model_nxos_vpc_instance.go index ea13402b..babd1452 100644 --- a/internal/provider/model_nxos_vpc_instance.go +++ b/internal/provider/model_nxos_vpc_instance.go @@ -40,9 +40,12 @@ func (data VPCInstance) getClassName() string { return "vpcInst" } -func (data VPCInstance) toBody() nxos.Body { +func (data VPCInstance) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/model_nxos_vpc_interface.go b/internal/provider/model_nxos_vpc_interface.go index b4e10ea2..5c45b483 100644 --- a/internal/provider/model_nxos_vpc_interface.go +++ b/internal/provider/model_nxos_vpc_interface.go @@ -44,9 +44,12 @@ func (data VPCInterface) getClassName() string { return "vpcIf" } -func (data VPCInterface) toBody() nxos.Body { +func (data VPCInterface) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.VpcInterfaceId.IsUnknown() && !data.VpcInterfaceId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", strconv.FormatInt(data.VpcInterfaceId.ValueInt64(), 10)) } diff --git a/internal/provider/model_nxos_vpc_keepalive.go b/internal/provider/model_nxos_vpc_keepalive.go index e3522972..157de492 100644 --- a/internal/provider/model_nxos_vpc_keepalive.go +++ b/internal/provider/model_nxos_vpc_keepalive.go @@ -54,9 +54,12 @@ func (data VPCKeepalive) getClassName() string { return "vpcKeepalive" } -func (data VPCKeepalive) toBody() nxos.Body { +func (data VPCKeepalive) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.DestinationIp.IsUnknown() && !data.DestinationIp.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"destIp", data.DestinationIp.ValueString()) } diff --git a/internal/provider/model_nxos_vpc_peerlink.go b/internal/provider/model_nxos_vpc_peerlink.go index a19962e3..59c565b0 100644 --- a/internal/provider/model_nxos_vpc_peerlink.go +++ b/internal/provider/model_nxos_vpc_peerlink.go @@ -40,9 +40,12 @@ func (data VPCPeerlink) getClassName() string { return "vpcPeerLink" } -func (data VPCPeerlink) toBody() nxos.Body { +func (data VPCPeerlink) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.PortChannelId.IsUnknown() && !data.PortChannelId.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"id", data.PortChannelId.ValueString()) } diff --git a/internal/provider/model_nxos_vrf.go b/internal/provider/model_nxos_vrf.go index 3d4ca1ca..b5e811d8 100644 --- a/internal/provider/model_nxos_vrf.go +++ b/internal/provider/model_nxos_vrf.go @@ -44,9 +44,12 @@ func (data VRF) getClassName() string { return "l3Inst" } -func (data VRF) toBody() nxos.Body { +func (data VRF) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Name.IsUnknown() && !data.Name.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"name", data.Name.ValueString()) } diff --git a/internal/provider/model_nxos_vrf_address_family.go b/internal/provider/model_nxos_vrf_address_family.go index 4ba06dd0..e64a11f8 100644 --- a/internal/provider/model_nxos_vrf_address_family.go +++ b/internal/provider/model_nxos_vrf_address_family.go @@ -43,9 +43,12 @@ func (data VRFAddressFamily) getClassName() string { return "rtctrlDomAf" } -func (data VRFAddressFamily) toBody() nxos.Body { +func (data VRFAddressFamily) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AddressFamily.IsUnknown() && !data.AddressFamily.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"type", data.AddressFamily.ValueString()) } diff --git a/internal/provider/model_nxos_vrf_route_target.go b/internal/provider/model_nxos_vrf_route_target.go index 6c05ec8d..c739adff 100644 --- a/internal/provider/model_nxos_vrf_route_target.go +++ b/internal/provider/model_nxos_vrf_route_target.go @@ -46,9 +46,12 @@ func (data VRFRouteTarget) getClassName() string { return "rtctrlRttEntry" } -func (data VRFRouteTarget) toBody() nxos.Body { +func (data VRFRouteTarget) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.RouteTarget.IsUnknown() && !data.RouteTarget.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"rtt", data.RouteTarget.ValueString()) } diff --git a/internal/provider/model_nxos_vrf_route_target_address_family.go b/internal/provider/model_nxos_vrf_route_target_address_family.go index 509e3780..25fc2664 100644 --- a/internal/provider/model_nxos_vrf_route_target_address_family.go +++ b/internal/provider/model_nxos_vrf_route_target_address_family.go @@ -44,9 +44,12 @@ func (data VRFRouteTargetAddressFamily) getClassName() string { return "rtctrlAfCtrl" } -func (data VRFRouteTargetAddressFamily) toBody() nxos.Body { +func (data VRFRouteTargetAddressFamily) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.RouteTargetAddressFamily.IsUnknown() && !data.RouteTargetAddressFamily.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"type", data.RouteTargetAddressFamily.ValueString()) } diff --git a/internal/provider/model_nxos_vrf_route_target_direction.go b/internal/provider/model_nxos_vrf_route_target_direction.go index c9df957f..dd0a275a 100644 --- a/internal/provider/model_nxos_vrf_route_target_direction.go +++ b/internal/provider/model_nxos_vrf_route_target_direction.go @@ -45,9 +45,12 @@ func (data VRFRouteTargetDirection) getClassName() string { return "rtctrlRttP" } -func (data VRFRouteTargetDirection) toBody() nxos.Body { +func (data VRFRouteTargetDirection) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.Direction.IsUnknown() && !data.Direction.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"type", data.Direction.ValueString()) } diff --git a/internal/provider/model_nxos_vrf_routing.go b/internal/provider/model_nxos_vrf_routing.go index 2d3a373c..51b23428 100644 --- a/internal/provider/model_nxos_vrf_routing.go +++ b/internal/provider/model_nxos_vrf_routing.go @@ -43,9 +43,12 @@ func (data VRFRouting) getClassName() string { return "rtctrlDom" } -func (data VRFRouting) toBody() nxos.Body { +func (data VRFRouting) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.RouteDistinguisher.IsUnknown() && !data.RouteDistinguisher.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"rd", data.RouteDistinguisher.ValueString()) } diff --git a/internal/provider/resource_nxos_bgp.go b/internal/provider/resource_nxos_bgp.go index 77185524..59e74221 100644 --- a/internal/provider/resource_nxos_bgp.go +++ b/internal/provider/resource_nxos_bgp.go @@ -105,7 +105,7 @@ func (r *BGPResource) Create(ctx context.Context, req resource.CreateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *BGPResource) Update(ctx context.Context, req resource.UpdateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_address_family.go b/internal/provider/resource_nxos_bgp_address_family.go index 59451963..70511589 100644 --- a/internal/provider/resource_nxos_bgp_address_family.go +++ b/internal/provider/resource_nxos_bgp_address_family.go @@ -139,7 +139,7 @@ func (r *BGPAddressFamilyResource) Create(ctx context.Context, req resource.Crea tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -201,7 +201,8 @@ func (r *BGPAddressFamilyResource) Update(ctx context.Context, req resource.Upda tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_advertised_prefix.go b/internal/provider/resource_nxos_bgp_advertised_prefix.go index fdd30c46..e7493764 100644 --- a/internal/provider/resource_nxos_bgp_advertised_prefix.go +++ b/internal/provider/resource_nxos_bgp_advertised_prefix.go @@ -130,7 +130,7 @@ func (r *BGPAdvertisedPrefixResource) Create(ctx context.Context, req resource.C tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -192,7 +192,8 @@ func (r *BGPAdvertisedPrefixResource) Update(ctx context.Context, req resource.U tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_graceful_restart.go b/internal/provider/resource_nxos_bgp_graceful_restart.go index a213766e..aeb26df3 100644 --- a/internal/provider/resource_nxos_bgp_graceful_restart.go +++ b/internal/provider/resource_nxos_bgp_graceful_restart.go @@ -128,7 +128,7 @@ func (r *BGPGracefulRestartResource) Create(ctx context.Context, req resource.Cr tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -190,7 +190,8 @@ func (r *BGPGracefulRestartResource) Update(ctx context.Context, req resource.Up tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_instance.go b/internal/provider/resource_nxos_bgp_instance.go index 081db37d..eb59bad3 100644 --- a/internal/provider/resource_nxos_bgp_instance.go +++ b/internal/provider/resource_nxos_bgp_instance.go @@ -119,7 +119,7 @@ func (r *BGPInstanceResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -181,7 +181,8 @@ func (r *BGPInstanceResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer.go b/internal/provider/resource_nxos_bgp_peer.go index 599a0714..dce2887f 100644 --- a/internal/provider/resource_nxos_bgp_peer.go +++ b/internal/provider/resource_nxos_bgp_peer.go @@ -186,7 +186,7 @@ func (r *BGPPeerResource) Create(ctx context.Context, req resource.CreateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -248,7 +248,8 @@ func (r *BGPPeerResource) Update(ctx context.Context, req resource.UpdateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer_address_family.go b/internal/provider/resource_nxos_bgp_peer_address_family.go index 270bc84c..0b0fa84a 100644 --- a/internal/provider/resource_nxos_bgp_peer_address_family.go +++ b/internal/provider/resource_nxos_bgp_peer_address_family.go @@ -149,7 +149,7 @@ func (r *BGPPeerAddressFamilyResource) Create(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -211,7 +211,8 @@ func (r *BGPPeerAddressFamilyResource) Update(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer_address_family_prefix_list_control.go b/internal/provider/resource_nxos_bgp_peer_address_family_prefix_list_control.go index de4fda60..e56b2130 100644 --- a/internal/provider/resource_nxos_bgp_peer_address_family_prefix_list_control.go +++ b/internal/provider/resource_nxos_bgp_peer_address_family_prefix_list_control.go @@ -140,7 +140,7 @@ func (r *BGPPeerAddressFamilyPrefixListControlResource) Create(ctx context.Conte tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -202,7 +202,8 @@ func (r *BGPPeerAddressFamilyPrefixListControlResource) Update(ctx context.Conte tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer_address_family_route_control.go b/internal/provider/resource_nxos_bgp_peer_address_family_route_control.go index 142fef02..d484cfd4 100644 --- a/internal/provider/resource_nxos_bgp_peer_address_family_route_control.go +++ b/internal/provider/resource_nxos_bgp_peer_address_family_route_control.go @@ -140,7 +140,7 @@ func (r *BGPPeerAddressFamilyRouteControlResource) Create(ctx context.Context, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -202,7 +202,8 @@ func (r *BGPPeerAddressFamilyRouteControlResource) Update(ctx context.Context, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer_local_asn.go b/internal/provider/resource_nxos_bgp_peer_local_asn.go index e97655ba..185d55f1 100644 --- a/internal/provider/resource_nxos_bgp_peer_local_asn.go +++ b/internal/provider/resource_nxos_bgp_peer_local_asn.go @@ -123,7 +123,7 @@ func (r *BGPPeerLocalASNResource) Create(ctx context.Context, req resource.Creat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -185,7 +185,8 @@ func (r *BGPPeerLocalASNResource) Update(ctx context.Context, req resource.Updat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer_template.go b/internal/provider/resource_nxos_bgp_peer_template.go index 08b48c80..e635bcbc 100644 --- a/internal/provider/resource_nxos_bgp_peer_template.go +++ b/internal/provider/resource_nxos_bgp_peer_template.go @@ -133,7 +133,7 @@ func (r *BGPPeerTemplateResource) Create(ctx context.Context, req resource.Creat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -195,7 +195,8 @@ func (r *BGPPeerTemplateResource) Update(ctx context.Context, req resource.Updat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer_template_address_family.go b/internal/provider/resource_nxos_bgp_peer_template_address_family.go index 5374bd25..4cf5f01a 100644 --- a/internal/provider/resource_nxos_bgp_peer_template_address_family.go +++ b/internal/provider/resource_nxos_bgp_peer_template_address_family.go @@ -142,7 +142,7 @@ func (r *BGPPeerTemplateAddressFamilyResource) Create(ctx context.Context, req r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -204,7 +204,8 @@ func (r *BGPPeerTemplateAddressFamilyResource) Update(ctx context.Context, req r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_peer_template_max_prefix.go b/internal/provider/resource_nxos_bgp_peer_template_max_prefix.go index 75dffda7..5e8f1fdb 100644 --- a/internal/provider/resource_nxos_bgp_peer_template_max_prefix.go +++ b/internal/provider/resource_nxos_bgp_peer_template_max_prefix.go @@ -153,7 +153,7 @@ func (r *BGPPeerTemplateMaxPrefixResource) Create(ctx context.Context, req resou tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -215,7 +215,8 @@ func (r *BGPPeerTemplateMaxPrefixResource) Update(ctx context.Context, req resou tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_route_control.go b/internal/provider/resource_nxos_bgp_route_control.go index 6370dca6..d80b7c6f 100644 --- a/internal/provider/resource_nxos_bgp_route_control.go +++ b/internal/provider/resource_nxos_bgp_route_control.go @@ -146,7 +146,7 @@ func (r *BGPRouteControlResource) Create(ctx context.Context, req resource.Creat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -208,7 +208,8 @@ func (r *BGPRouteControlResource) Update(ctx context.Context, req resource.Updat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_route_redistribution.go b/internal/provider/resource_nxos_bgp_route_redistribution.go index a561cff5..5151a05a 100644 --- a/internal/provider/resource_nxos_bgp_route_redistribution.go +++ b/internal/provider/resource_nxos_bgp_route_redistribution.go @@ -159,7 +159,7 @@ func (r *BGPRouteRedistributionResource) Create(ctx context.Context, req resourc tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -221,7 +221,8 @@ func (r *BGPRouteRedistributionResource) Update(ctx context.Context, req resourc tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bgp_vrf.go b/internal/provider/resource_nxos_bgp_vrf.go index 8ec27408..e97bf4f7 100644 --- a/internal/provider/resource_nxos_bgp_vrf.go +++ b/internal/provider/resource_nxos_bgp_vrf.go @@ -111,7 +111,7 @@ func (r *BGPVRFResource) Create(ctx context.Context, req resource.CreateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -173,7 +173,8 @@ func (r *BGPVRFResource) Update(ctx context.Context, req resource.UpdateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_bridge_domain.go b/internal/provider/resource_nxos_bridge_domain.go index d04bd542..820c4878 100644 --- a/internal/provider/resource_nxos_bridge_domain.go +++ b/internal/provider/resource_nxos_bridge_domain.go @@ -111,7 +111,7 @@ func (r *BridgeDomainResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -173,7 +173,8 @@ func (r *BridgeDomainResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_class_map.go b/internal/provider/resource_nxos_default_qos_class_map.go index 43f34d5d..76d594cb 100644 --- a/internal/provider/resource_nxos_default_qos_class_map.go +++ b/internal/provider/resource_nxos_default_qos_class_map.go @@ -112,7 +112,7 @@ func (r *DefaultQOSClassMapResource) Create(ctx context.Context, req resource.Cr tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -174,7 +174,8 @@ func (r *DefaultQOSClassMapResource) Update(ctx context.Context, req resource.Up tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_class_map_dscp.go b/internal/provider/resource_nxos_default_qos_class_map_dscp.go index 863a08ab..821ac422 100644 --- a/internal/provider/resource_nxos_default_qos_class_map_dscp.go +++ b/internal/provider/resource_nxos_default_qos_class_map_dscp.go @@ -107,7 +107,7 @@ func (r *DefaultQOSClassMapDSCPResource) Create(ctx context.Context, req resourc tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -169,7 +169,8 @@ func (r *DefaultQOSClassMapDSCPResource) Update(ctx context.Context, req resourc tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_policy_interface_in.go b/internal/provider/resource_nxos_default_qos_policy_interface_in.go index ba8fe636..7e586404 100644 --- a/internal/provider/resource_nxos_default_qos_policy_interface_in.go +++ b/internal/provider/resource_nxos_default_qos_policy_interface_in.go @@ -100,7 +100,7 @@ func (r *DefaultQOSPolicyInterfaceInResource) Create(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -162,7 +162,8 @@ func (r *DefaultQOSPolicyInterfaceInResource) Update(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_policy_interface_in_policy_map.go b/internal/provider/resource_nxos_default_qos_policy_interface_in_policy_map.go index 514eab79..a137081e 100644 --- a/internal/provider/resource_nxos_default_qos_policy_interface_in_policy_map.go +++ b/internal/provider/resource_nxos_default_qos_policy_interface_in_policy_map.go @@ -104,7 +104,7 @@ func (r *DefaultQOSPolicyInterfaceInPolicyMapResource) Create(ctx context.Contex tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *DefaultQOSPolicyInterfaceInPolicyMapResource) Update(ctx context.Contex tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_policy_map.go b/internal/provider/resource_nxos_default_qos_policy_map.go index aac6eed3..81b570bf 100644 --- a/internal/provider/resource_nxos_default_qos_policy_map.go +++ b/internal/provider/resource_nxos_default_qos_policy_map.go @@ -112,7 +112,7 @@ func (r *DefaultQOSPolicyMapResource) Create(ctx context.Context, req resource.C tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -174,7 +174,8 @@ func (r *DefaultQOSPolicyMapResource) Update(ctx context.Context, req resource.U tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_policy_map_match_class_map.go b/internal/provider/resource_nxos_default_qos_policy_map_match_class_map.go index 63aa19ff..cc172914 100644 --- a/internal/provider/resource_nxos_default_qos_policy_map_match_class_map.go +++ b/internal/provider/resource_nxos_default_qos_policy_map_match_class_map.go @@ -107,7 +107,7 @@ func (r *DefaultQOSPolicyMapMatchClassMapResource) Create(ctx context.Context, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -169,7 +169,8 @@ func (r *DefaultQOSPolicyMapMatchClassMapResource) Update(ctx context.Context, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_police.go b/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_police.go index 1fcbc4a0..c3e73563 100644 --- a/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_police.go +++ b/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_police.go @@ -317,7 +317,7 @@ func (r *DefaultQOSPolicyMapMatchClassMapPoliceResource) Create(ctx context.Cont tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -379,7 +379,8 @@ func (r *DefaultQOSPolicyMapMatchClassMapPoliceResource) Update(ctx context.Cont tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_set_qos_group.go b/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_set_qos_group.go index 9d0024e2..275dedce 100644 --- a/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_set_qos_group.go +++ b/internal/provider/resource_nxos_default_qos_policy_map_match_class_map_set_qos_group.go @@ -119,7 +119,7 @@ func (r *DefaultQOSPolicyMapMatchClassMapSetQOSGroupResource) Create(ctx context tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -181,7 +181,8 @@ func (r *DefaultQOSPolicyMapMatchClassMapSetQOSGroupResource) Update(ctx context tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_dhcp_relay_address.go b/internal/provider/resource_nxos_dhcp_relay_address.go index 2c5ba497..a0c756c4 100644 --- a/internal/provider/resource_nxos_dhcp_relay_address.go +++ b/internal/provider/resource_nxos_dhcp_relay_address.go @@ -114,7 +114,7 @@ func (r *DHCPRelayAddressResource) Create(ctx context.Context, req resource.Crea tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -176,7 +176,8 @@ func (r *DHCPRelayAddressResource) Update(ctx context.Context, req resource.Upda tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_dhcp_relay_interface.go b/internal/provider/resource_nxos_dhcp_relay_interface.go index c381af83..1b8657a1 100644 --- a/internal/provider/resource_nxos_dhcp_relay_interface.go +++ b/internal/provider/resource_nxos_dhcp_relay_interface.go @@ -100,7 +100,7 @@ func (r *DHCPRelayInterfaceResource) Create(ctx context.Context, req resource.Cr tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -162,7 +162,8 @@ func (r *DHCPRelayInterfaceResource) Update(ctx context.Context, req resource.Up tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ethernet.go b/internal/provider/resource_nxos_ethernet.go index 5a611e72..64210ca3 100644 --- a/internal/provider/resource_nxos_ethernet.go +++ b/internal/provider/resource_nxos_ethernet.go @@ -116,7 +116,7 @@ func (r *EthernetResource) Create(ctx context.Context, req resource.CreateReques tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -178,7 +178,8 @@ func (r *EthernetResource) Update(ctx context.Context, req resource.UpdateReques tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_evpn.go b/internal/provider/resource_nxos_evpn.go index 21afd59b..92ed9c27 100644 --- a/internal/provider/resource_nxos_evpn.go +++ b/internal/provider/resource_nxos_evpn.go @@ -105,7 +105,7 @@ func (r *EVPNResource) Create(ctx context.Context, req resource.CreateRequest, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *EVPNResource) Update(ctx context.Context, req resource.UpdateRequest, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_evpn_vni.go b/internal/provider/resource_nxos_evpn_vni.go index 1fc3f760..dbed28a0 100644 --- a/internal/provider/resource_nxos_evpn_vni.go +++ b/internal/provider/resource_nxos_evpn_vni.go @@ -107,7 +107,7 @@ func (r *EVPNVNIResource) Create(ctx context.Context, req resource.CreateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -169,7 +169,8 @@ func (r *EVPNVNIResource) Update(ctx context.Context, req resource.UpdateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_evpn_vni_route_target.go b/internal/provider/resource_nxos_evpn_vni_route_target.go index f4ffef7c..4c804a5d 100644 --- a/internal/provider/resource_nxos_evpn_vni_route_target.go +++ b/internal/provider/resource_nxos_evpn_vni_route_target.go @@ -119,7 +119,7 @@ func (r *EVPNVNIRouteTargetResource) Create(ctx context.Context, req resource.Cr tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -181,7 +181,8 @@ func (r *EVPNVNIRouteTargetResource) Update(ctx context.Context, req resource.Up tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_evpn_vni_route_target_direction.go b/internal/provider/resource_nxos_evpn_vni_route_target_direction.go index fa1678c3..2a526e89 100644 --- a/internal/provider/resource_nxos_evpn_vni_route_target_direction.go +++ b/internal/provider/resource_nxos_evpn_vni_route_target_direction.go @@ -112,7 +112,7 @@ func (r *EVPNVNIRouteTargetDirectionResource) Create(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -174,7 +174,8 @@ func (r *EVPNVNIRouteTargetDirectionResource) Update(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_bfd.go b/internal/provider/resource_nxos_feature_bfd.go index 911b13f6..c58b9886 100644 --- a/internal/provider/resource_nxos_feature_bfd.go +++ b/internal/provider/resource_nxos_feature_bfd.go @@ -102,7 +102,7 @@ func (r *FeatureBFDResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureBFDResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_bgp.go b/internal/provider/resource_nxos_feature_bgp.go index d8dc70c4..9c4d0550 100644 --- a/internal/provider/resource_nxos_feature_bgp.go +++ b/internal/provider/resource_nxos_feature_bgp.go @@ -102,7 +102,7 @@ func (r *FeatureBGPResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureBGPResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_dhcp.go b/internal/provider/resource_nxos_feature_dhcp.go index 220ded0e..94f7069c 100644 --- a/internal/provider/resource_nxos_feature_dhcp.go +++ b/internal/provider/resource_nxos_feature_dhcp.go @@ -102,7 +102,7 @@ func (r *FeatureDHCPResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureDHCPResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_evpn.go b/internal/provider/resource_nxos_feature_evpn.go index 3ff26a5f..74c3eb03 100644 --- a/internal/provider/resource_nxos_feature_evpn.go +++ b/internal/provider/resource_nxos_feature_evpn.go @@ -102,7 +102,7 @@ func (r *FeatureEVPNResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureEVPNResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_hmm.go b/internal/provider/resource_nxos_feature_hmm.go index d81ef20c..5abe1c83 100644 --- a/internal/provider/resource_nxos_feature_hmm.go +++ b/internal/provider/resource_nxos_feature_hmm.go @@ -102,7 +102,7 @@ func (r *FeatureHMMResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureHMMResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_hsrp.go b/internal/provider/resource_nxos_feature_hsrp.go index ec6e6c4d..f11c6513 100644 --- a/internal/provider/resource_nxos_feature_hsrp.go +++ b/internal/provider/resource_nxos_feature_hsrp.go @@ -102,7 +102,7 @@ func (r *FeatureHSRPResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureHSRPResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_interface_vlan.go b/internal/provider/resource_nxos_feature_interface_vlan.go index e6b6aa43..3aa7ac2c 100644 --- a/internal/provider/resource_nxos_feature_interface_vlan.go +++ b/internal/provider/resource_nxos_feature_interface_vlan.go @@ -102,7 +102,7 @@ func (r *FeatureInterfaceVLANResource) Create(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureInterfaceVLANResource) Update(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_isis.go b/internal/provider/resource_nxos_feature_isis.go index 4292f40b..c066d7d9 100644 --- a/internal/provider/resource_nxos_feature_isis.go +++ b/internal/provider/resource_nxos_feature_isis.go @@ -102,7 +102,7 @@ func (r *FeatureISISResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureISISResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_lacp.go b/internal/provider/resource_nxos_feature_lacp.go index a3f27cfd..3e9b8e09 100644 --- a/internal/provider/resource_nxos_feature_lacp.go +++ b/internal/provider/resource_nxos_feature_lacp.go @@ -102,7 +102,7 @@ func (r *FeatureLACPResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureLACPResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_lldp.go b/internal/provider/resource_nxos_feature_lldp.go index d3956280..2ae891b3 100644 --- a/internal/provider/resource_nxos_feature_lldp.go +++ b/internal/provider/resource_nxos_feature_lldp.go @@ -102,7 +102,7 @@ func (r *FeatureLLDPResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureLLDPResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_macsec.go b/internal/provider/resource_nxos_feature_macsec.go index 18c08a8f..02d5b7b5 100644 --- a/internal/provider/resource_nxos_feature_macsec.go +++ b/internal/provider/resource_nxos_feature_macsec.go @@ -102,7 +102,7 @@ func (r *FeatureMACsecResource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureMACsecResource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_netflow.go b/internal/provider/resource_nxos_feature_netflow.go index 5a37afc7..32688e64 100644 --- a/internal/provider/resource_nxos_feature_netflow.go +++ b/internal/provider/resource_nxos_feature_netflow.go @@ -102,7 +102,7 @@ func (r *FeatureNetflowResource) Create(ctx context.Context, req resource.Create tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureNetflowResource) Update(ctx context.Context, req resource.Update tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_nv_overlay.go b/internal/provider/resource_nxos_feature_nv_overlay.go index c389483e..2428cc53 100644 --- a/internal/provider/resource_nxos_feature_nv_overlay.go +++ b/internal/provider/resource_nxos_feature_nv_overlay.go @@ -102,7 +102,7 @@ func (r *FeatureNVOverlayResource) Create(ctx context.Context, req resource.Crea tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureNVOverlayResource) Update(ctx context.Context, req resource.Upda tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_ospf.go b/internal/provider/resource_nxos_feature_ospf.go index ebfea0d0..7ec496af 100644 --- a/internal/provider/resource_nxos_feature_ospf.go +++ b/internal/provider/resource_nxos_feature_ospf.go @@ -102,7 +102,7 @@ func (r *FeatureOSPFResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureOSPFResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_ospfv3.go b/internal/provider/resource_nxos_feature_ospfv3.go index fa77a016..fd945b8b 100644 --- a/internal/provider/resource_nxos_feature_ospfv3.go +++ b/internal/provider/resource_nxos_feature_ospfv3.go @@ -102,7 +102,7 @@ func (r *FeatureOSPFv3Resource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureOSPFv3Resource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_pim.go b/internal/provider/resource_nxos_feature_pim.go index cd92f60d..12e5e152 100644 --- a/internal/provider/resource_nxos_feature_pim.go +++ b/internal/provider/resource_nxos_feature_pim.go @@ -102,7 +102,7 @@ func (r *FeaturePIMResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeaturePIMResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_ptp.go b/internal/provider/resource_nxos_feature_ptp.go index 35b5eecf..d94de75c 100644 --- a/internal/provider/resource_nxos_feature_ptp.go +++ b/internal/provider/resource_nxos_feature_ptp.go @@ -102,7 +102,7 @@ func (r *FeaturePTPResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeaturePTPResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_pvlan.go b/internal/provider/resource_nxos_feature_pvlan.go index 647f18cf..046b440e 100644 --- a/internal/provider/resource_nxos_feature_pvlan.go +++ b/internal/provider/resource_nxos_feature_pvlan.go @@ -102,7 +102,7 @@ func (r *FeaturePVLANResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeaturePVLANResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_ssh.go b/internal/provider/resource_nxos_feature_ssh.go index 90349d8c..6782afc3 100644 --- a/internal/provider/resource_nxos_feature_ssh.go +++ b/internal/provider/resource_nxos_feature_ssh.go @@ -102,7 +102,7 @@ func (r *FeatureSSHResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureSSHResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_tacacs.go b/internal/provider/resource_nxos_feature_tacacs.go index 6c03ab7a..7158cbc3 100644 --- a/internal/provider/resource_nxos_feature_tacacs.go +++ b/internal/provider/resource_nxos_feature_tacacs.go @@ -102,7 +102,7 @@ func (r *FeatureTACACSResource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureTACACSResource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_telnet.go b/internal/provider/resource_nxos_feature_telnet.go index 168be5b4..eab26be2 100644 --- a/internal/provider/resource_nxos_feature_telnet.go +++ b/internal/provider/resource_nxos_feature_telnet.go @@ -102,7 +102,7 @@ func (r *FeatureTelnetResource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureTelnetResource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_udld.go b/internal/provider/resource_nxos_feature_udld.go index f17f9def..066d3d64 100644 --- a/internal/provider/resource_nxos_feature_udld.go +++ b/internal/provider/resource_nxos_feature_udld.go @@ -102,7 +102,7 @@ func (r *FeatureUDLDResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureUDLDResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_vn_segment.go b/internal/provider/resource_nxos_feature_vn_segment.go index 410f56f3..f2e3dd7a 100644 --- a/internal/provider/resource_nxos_feature_vn_segment.go +++ b/internal/provider/resource_nxos_feature_vn_segment.go @@ -102,7 +102,7 @@ func (r *FeatureVNSegmentResource) Create(ctx context.Context, req resource.Crea tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureVNSegmentResource) Update(ctx context.Context, req resource.Upda tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_feature_vpc.go b/internal/provider/resource_nxos_feature_vpc.go index 8780277d..9ec9c033 100644 --- a/internal/provider/resource_nxos_feature_vpc.go +++ b/internal/provider/resource_nxos_feature_vpc.go @@ -102,7 +102,7 @@ func (r *FeatureVPCResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureVPCResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_hmm.go b/internal/provider/resource_nxos_hmm.go index c5fab95a..5eee1815 100644 --- a/internal/provider/resource_nxos_hmm.go +++ b/internal/provider/resource_nxos_hmm.go @@ -105,7 +105,7 @@ func (r *HMMResource) Create(ctx context.Context, req resource.CreateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *HMMResource) Update(ctx context.Context, req resource.UpdateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_hmm_instance.go b/internal/provider/resource_nxos_hmm_instance.go index f978c9ff..c79f3d7f 100644 --- a/internal/provider/resource_nxos_hmm_instance.go +++ b/internal/provider/resource_nxos_hmm_instance.go @@ -111,7 +111,7 @@ func (r *HMMInstanceResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -173,7 +173,8 @@ func (r *HMMInstanceResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_hmm_interface.go b/internal/provider/resource_nxos_hmm_interface.go index 226c3e1a..87625ae4 100644 --- a/internal/provider/resource_nxos_hmm_interface.go +++ b/internal/provider/resource_nxos_hmm_interface.go @@ -121,7 +121,7 @@ func (r *HMMInterfaceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -183,7 +183,8 @@ func (r *HMMInterfaceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_access_list.go b/internal/provider/resource_nxos_ipv4_access_list.go index 1d92b12a..5245036e 100644 --- a/internal/provider/resource_nxos_ipv4_access_list.go +++ b/internal/provider/resource_nxos_ipv4_access_list.go @@ -100,7 +100,7 @@ func (r *IPv4AccessListResource) Create(ctx context.Context, req resource.Create tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -162,7 +162,8 @@ func (r *IPv4AccessListResource) Update(ctx context.Context, req resource.Update tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_access_list_entry.go b/internal/provider/resource_nxos_ipv4_access_list_entry.go index 368c6cca..2368ffdd 100644 --- a/internal/provider/resource_nxos_ipv4_access_list_entry.go +++ b/internal/provider/resource_nxos_ipv4_access_list_entry.go @@ -352,7 +352,7 @@ func (r *IPv4AccessListEntryResource) Create(ctx context.Context, req resource.C tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -414,7 +414,8 @@ func (r *IPv4AccessListEntryResource) Update(ctx context.Context, req resource.U tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(true) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_access_list_policy_egress_interface.go b/internal/provider/resource_nxos_ipv4_access_list_policy_egress_interface.go index cfa4fdfd..61911625 100644 --- a/internal/provider/resource_nxos_ipv4_access_list_policy_egress_interface.go +++ b/internal/provider/resource_nxos_ipv4_access_list_policy_egress_interface.go @@ -104,7 +104,7 @@ func (r *IPv4AccessListPolicyEgressInterfaceResource) Create(ctx context.Context tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *IPv4AccessListPolicyEgressInterfaceResource) Update(ctx context.Context tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_access_list_policy_ingress_interface.go b/internal/provider/resource_nxos_ipv4_access_list_policy_ingress_interface.go index 3d2b5af8..d5823b42 100644 --- a/internal/provider/resource_nxos_ipv4_access_list_policy_ingress_interface.go +++ b/internal/provider/resource_nxos_ipv4_access_list_policy_ingress_interface.go @@ -104,7 +104,7 @@ func (r *IPv4AccessListPolicyIngressInterfaceResource) Create(ctx context.Contex tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *IPv4AccessListPolicyIngressInterfaceResource) Update(ctx context.Contex tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_interface.go b/internal/provider/resource_nxos_ipv4_interface.go index f54cf9fb..1d7feba7 100644 --- a/internal/provider/resource_nxos_ipv4_interface.go +++ b/internal/provider/resource_nxos_ipv4_interface.go @@ -143,7 +143,7 @@ func (r *IPv4InterfaceResource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -205,7 +205,8 @@ func (r *IPv4InterfaceResource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_interface_address.go b/internal/provider/resource_nxos_ipv4_interface_address.go index cc03c4d9..b79b12c0 100644 --- a/internal/provider/resource_nxos_ipv4_interface_address.go +++ b/internal/provider/resource_nxos_ipv4_interface_address.go @@ -126,7 +126,7 @@ func (r *IPv4InterfaceAddressResource) Create(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -188,7 +188,8 @@ func (r *IPv4InterfaceAddressResource) Update(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_prefix_list_rule.go b/internal/provider/resource_nxos_ipv4_prefix_list_rule.go index 06ebe2f6..787a6fa8 100644 --- a/internal/provider/resource_nxos_ipv4_prefix_list_rule.go +++ b/internal/provider/resource_nxos_ipv4_prefix_list_rule.go @@ -100,7 +100,7 @@ func (r *IPv4PrefixListRuleResource) Create(ctx context.Context, req resource.Cr tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -162,7 +162,8 @@ func (r *IPv4PrefixListRuleResource) Update(ctx context.Context, req resource.Up tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_prefix_list_rule_entry.go b/internal/provider/resource_nxos_ipv4_prefix_list_rule_entry.go index 78694463..38363717 100644 --- a/internal/provider/resource_nxos_ipv4_prefix_list_rule_entry.go +++ b/internal/provider/resource_nxos_ipv4_prefix_list_rule_entry.go @@ -156,7 +156,7 @@ func (r *IPv4PrefixListRuleEntryResource) Create(ctx context.Context, req resour tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -218,7 +218,8 @@ func (r *IPv4PrefixListRuleEntryResource) Update(ctx context.Context, req resour tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_static_route.go b/internal/provider/resource_nxos_ipv4_static_route.go index 05550e41..877cadf9 100644 --- a/internal/provider/resource_nxos_ipv4_static_route.go +++ b/internal/provider/resource_nxos_ipv4_static_route.go @@ -163,7 +163,7 @@ func (r *IPv4StaticRouteResource) Create(ctx context.Context, req resource.Creat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -226,7 +226,8 @@ func (r *IPv4StaticRouteResource) Update(ctx context.Context, req resource.Updat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ipv4_vrf.go b/internal/provider/resource_nxos_ipv4_vrf.go index d73a488c..773f98be 100644 --- a/internal/provider/resource_nxos_ipv4_vrf.go +++ b/internal/provider/resource_nxos_ipv4_vrf.go @@ -100,7 +100,7 @@ func (r *IPv4VRFResource) Create(ctx context.Context, req resource.CreateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -162,7 +162,8 @@ func (r *IPv4VRFResource) Update(ctx context.Context, req resource.UpdateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_isis.go b/internal/provider/resource_nxos_isis.go index 2e7cd38b..4ce82e2a 100644 --- a/internal/provider/resource_nxos_isis.go +++ b/internal/provider/resource_nxos_isis.go @@ -105,7 +105,7 @@ func (r *ISISResource) Create(ctx context.Context, req resource.CreateRequest, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *ISISResource) Update(ctx context.Context, req resource.UpdateRequest, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_isis_instance.go b/internal/provider/resource_nxos_isis_instance.go index 6547916c..e14c6ea5 100644 --- a/internal/provider/resource_nxos_isis_instance.go +++ b/internal/provider/resource_nxos_isis_instance.go @@ -112,7 +112,7 @@ func (r *ISISInstanceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -174,7 +174,8 @@ func (r *ISISInstanceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_isis_interface.go b/internal/provider/resource_nxos_isis_interface.go index 29ded9ee..0dd3e883 100644 --- a/internal/provider/resource_nxos_isis_interface.go +++ b/internal/provider/resource_nxos_isis_interface.go @@ -321,7 +321,7 @@ func (r *ISISInterfaceResource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -383,7 +383,8 @@ func (r *ISISInterfaceResource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_isis_vrf.go b/internal/provider/resource_nxos_isis_vrf.go index 4b0d819e..c86439f5 100644 --- a/internal/provider/resource_nxos_isis_vrf.go +++ b/internal/provider/resource_nxos_isis_vrf.go @@ -218,7 +218,7 @@ func (r *ISISVRFResource) Create(ctx context.Context, req resource.CreateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -280,7 +280,8 @@ func (r *ISISVRFResource) Update(ctx context.Context, req resource.UpdateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_loopback_interface.go b/internal/provider/resource_nxos_loopback_interface.go index 088565dc..db66c614 100644 --- a/internal/provider/resource_nxos_loopback_interface.go +++ b/internal/provider/resource_nxos_loopback_interface.go @@ -116,7 +116,7 @@ func (r *LoopbackInterfaceResource) Create(ctx context.Context, req resource.Cre tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -178,7 +178,8 @@ func (r *LoopbackInterfaceResource) Update(ctx context.Context, req resource.Upd tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_loopback_interface_vrf.go b/internal/provider/resource_nxos_loopback_interface_vrf.go index 831536f5..9e256575 100644 --- a/internal/provider/resource_nxos_loopback_interface_vrf.go +++ b/internal/provider/resource_nxos_loopback_interface_vrf.go @@ -104,7 +104,7 @@ func (r *LoopbackInterfaceVRFResource) Create(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *LoopbackInterfaceVRFResource) Update(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ntp_server.go b/internal/provider/resource_nxos_ntp_server.go index 5dfa5b80..dd2501ef 100644 --- a/internal/provider/resource_nxos_ntp_server.go +++ b/internal/provider/resource_nxos_ntp_server.go @@ -143,7 +143,7 @@ func (r *NTPServerResource) Create(ctx context.Context, req resource.CreateReque tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -205,7 +205,8 @@ func (r *NTPServerResource) Update(ctx context.Context, req resource.UpdateReque tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_nve_interface.go b/internal/provider/resource_nxos_nve_interface.go index 9f844ed7..061290d1 100644 --- a/internal/provider/resource_nxos_nve_interface.go +++ b/internal/provider/resource_nxos_nve_interface.go @@ -174,7 +174,7 @@ func (r *NVEInterfaceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -236,7 +236,8 @@ func (r *NVEInterfaceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_nve_vni.go b/internal/provider/resource_nxos_nve_vni.go index 5767911e..72a506cf 100644 --- a/internal/provider/resource_nxos_nve_vni.go +++ b/internal/provider/resource_nxos_nve_vni.go @@ -143,7 +143,7 @@ func (r *NVEVNIResource) Create(ctx context.Context, req resource.CreateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -205,7 +205,8 @@ func (r *NVEVNIResource) Update(ctx context.Context, req resource.UpdateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_nve_vni_container.go b/internal/provider/resource_nxos_nve_vni_container.go index 42c8f452..0d611f1e 100644 --- a/internal/provider/resource_nxos_nve_vni_container.go +++ b/internal/provider/resource_nxos_nve_vni_container.go @@ -93,7 +93,7 @@ func (r *NVEVNIContainerResource) Create(ctx context.Context, req resource.Creat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -155,7 +155,8 @@ func (r *NVEVNIContainerResource) Update(ctx context.Context, req resource.Updat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_nve_vni_ingress_replication.go b/internal/provider/resource_nxos_nve_vni_ingress_replication.go index be779758..fe0d85aa 100644 --- a/internal/provider/resource_nxos_nve_vni_ingress_replication.go +++ b/internal/provider/resource_nxos_nve_vni_ingress_replication.go @@ -117,7 +117,7 @@ func (r *NVEVNIIngressReplicationResource) Create(ctx context.Context, req resou tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -179,7 +179,8 @@ func (r *NVEVNIIngressReplicationResource) Update(ctx context.Context, req resou tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ospf.go b/internal/provider/resource_nxos_ospf.go index 7157ad6f..7ba833a4 100644 --- a/internal/provider/resource_nxos_ospf.go +++ b/internal/provider/resource_nxos_ospf.go @@ -105,7 +105,7 @@ func (r *OSPFResource) Create(ctx context.Context, req resource.CreateRequest, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *OSPFResource) Update(ctx context.Context, req resource.UpdateRequest, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ospf_area.go b/internal/provider/resource_nxos_ospf_area.go index 2cc0a282..c4e4317a 100644 --- a/internal/provider/resource_nxos_ospf_area.go +++ b/internal/provider/resource_nxos_ospf_area.go @@ -146,7 +146,7 @@ func (r *OSPFAreaResource) Create(ctx context.Context, req resource.CreateReques tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -208,7 +208,8 @@ func (r *OSPFAreaResource) Update(ctx context.Context, req resource.UpdateReques tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ospf_authentication.go b/internal/provider/resource_nxos_ospf_authentication.go index 4a1f4e7e..a3adc8bc 100644 --- a/internal/provider/resource_nxos_ospf_authentication.go +++ b/internal/provider/resource_nxos_ospf_authentication.go @@ -162,7 +162,7 @@ func (r *OSPFAuthenticationResource) Create(ctx context.Context, req resource.Cr tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -224,7 +224,8 @@ func (r *OSPFAuthenticationResource) Update(ctx context.Context, req resource.Up tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ospf_instance.go b/internal/provider/resource_nxos_ospf_instance.go index 58440535..c65f7498 100644 --- a/internal/provider/resource_nxos_ospf_instance.go +++ b/internal/provider/resource_nxos_ospf_instance.go @@ -112,7 +112,7 @@ func (r *OSPFInstanceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -174,7 +174,8 @@ func (r *OSPFInstanceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ospf_interface.go b/internal/provider/resource_nxos_ospf_interface.go index bb9320c0..b6ad9dd5 100644 --- a/internal/provider/resource_nxos_ospf_interface.go +++ b/internal/provider/resource_nxos_ospf_interface.go @@ -195,7 +195,7 @@ func (r *OSPFInterfaceResource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -257,7 +257,8 @@ func (r *OSPFInterfaceResource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_ospf_vrf.go b/internal/provider/resource_nxos_ospf_vrf.go index ba539ff8..d6205ed0 100644 --- a/internal/provider/resource_nxos_ospf_vrf.go +++ b/internal/provider/resource_nxos_ospf_vrf.go @@ -158,7 +158,7 @@ func (r *OSPFVRFResource) Create(ctx context.Context, req resource.CreateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -220,7 +220,8 @@ func (r *OSPFVRFResource) Update(ctx context.Context, req resource.UpdateRequest tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_physical_interface.go b/internal/provider/resource_nxos_physical_interface.go index b05cb8e9..1200a7a4 100644 --- a/internal/provider/resource_nxos_physical_interface.go +++ b/internal/provider/resource_nxos_physical_interface.go @@ -275,7 +275,7 @@ func (r *PhysicalInterfaceResource) Create(ctx context.Context, req resource.Cre tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -337,7 +337,8 @@ func (r *PhysicalInterfaceResource) Update(ctx context.Context, req resource.Upd tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_physical_interface_vrf.go b/internal/provider/resource_nxos_physical_interface_vrf.go index 190b3124..ab691aed 100644 --- a/internal/provider/resource_nxos_physical_interface_vrf.go +++ b/internal/provider/resource_nxos_physical_interface_vrf.go @@ -104,7 +104,7 @@ func (r *PhysicalInterfaceVRFResource) Create(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *PhysicalInterfaceVRFResource) Update(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim.go b/internal/provider/resource_nxos_pim.go index 8e2763f3..d63b34a3 100644 --- a/internal/provider/resource_nxos_pim.go +++ b/internal/provider/resource_nxos_pim.go @@ -105,7 +105,7 @@ func (r *PIMResource) Create(ctx context.Context, req resource.CreateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *PIMResource) Update(ctx context.Context, req resource.UpdateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_anycast_rp.go b/internal/provider/resource_nxos_pim_anycast_rp.go index 9b2c067e..4da597ad 100644 --- a/internal/provider/resource_nxos_pim_anycast_rp.go +++ b/internal/provider/resource_nxos_pim_anycast_rp.go @@ -108,7 +108,7 @@ func (r *PIMAnycastRPResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -170,7 +170,8 @@ func (r *PIMAnycastRPResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_anycast_rp_peer.go b/internal/provider/resource_nxos_pim_anycast_rp_peer.go index c577a5f1..ca5d2e7d 100644 --- a/internal/provider/resource_nxos_pim_anycast_rp_peer.go +++ b/internal/provider/resource_nxos_pim_anycast_rp_peer.go @@ -114,7 +114,7 @@ func (r *PIMAnycastRPPeerResource) Create(ctx context.Context, req resource.Crea tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -176,7 +176,8 @@ func (r *PIMAnycastRPPeerResource) Update(ctx context.Context, req resource.Upda tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_instance.go b/internal/provider/resource_nxos_pim_instance.go index f1d9dfe7..32df2d2f 100644 --- a/internal/provider/resource_nxos_pim_instance.go +++ b/internal/provider/resource_nxos_pim_instance.go @@ -105,7 +105,7 @@ func (r *PIMInstanceResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *PIMInstanceResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_interface.go b/internal/provider/resource_nxos_pim_interface.go index 32068de0..e89c019d 100644 --- a/internal/provider/resource_nxos_pim_interface.go +++ b/internal/provider/resource_nxos_pim_interface.go @@ -152,7 +152,7 @@ func (r *PIMInterfaceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -214,7 +214,8 @@ func (r *PIMInterfaceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_ssm_policy.go b/internal/provider/resource_nxos_pim_ssm_policy.go index fbb56185..4dc767c7 100644 --- a/internal/provider/resource_nxos_pim_ssm_policy.go +++ b/internal/provider/resource_nxos_pim_ssm_policy.go @@ -104,7 +104,7 @@ func (r *PIMSSMPolicyResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *PIMSSMPolicyResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_ssm_range.go b/internal/provider/resource_nxos_pim_ssm_range.go index 5284b1ca..41d20bc5 100644 --- a/internal/provider/resource_nxos_pim_ssm_range.go +++ b/internal/provider/resource_nxos_pim_ssm_range.go @@ -140,7 +140,7 @@ func (r *PIMSSMRangeResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -202,7 +202,8 @@ func (r *PIMSSMRangeResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_static_rp.go b/internal/provider/resource_nxos_pim_static_rp.go index 99b1eb91..2b7e5c21 100644 --- a/internal/provider/resource_nxos_pim_static_rp.go +++ b/internal/provider/resource_nxos_pim_static_rp.go @@ -107,7 +107,7 @@ func (r *PIMStaticRPResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -169,7 +169,8 @@ func (r *PIMStaticRPResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_static_rp_group_list.go b/internal/provider/resource_nxos_pim_static_rp_group_list.go index ada04f68..3aa43d60 100644 --- a/internal/provider/resource_nxos_pim_static_rp_group_list.go +++ b/internal/provider/resource_nxos_pim_static_rp_group_list.go @@ -127,7 +127,7 @@ func (r *PIMStaticRPGroupListResource) Create(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -189,7 +189,8 @@ func (r *PIMStaticRPGroupListResource) Update(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_static_rp_policy.go b/internal/provider/resource_nxos_pim_static_rp_policy.go index 9e06adaf..f1b2a133 100644 --- a/internal/provider/resource_nxos_pim_static_rp_policy.go +++ b/internal/provider/resource_nxos_pim_static_rp_policy.go @@ -104,7 +104,7 @@ func (r *PIMStaticRPPolicyResource) Create(ctx context.Context, req resource.Cre tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *PIMStaticRPPolicyResource) Update(ctx context.Context, req resource.Upd tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_pim_vrf.go b/internal/provider/resource_nxos_pim_vrf.go index dbed2de2..3ce82b4d 100644 --- a/internal/provider/resource_nxos_pim_vrf.go +++ b/internal/provider/resource_nxos_pim_vrf.go @@ -119,7 +119,7 @@ func (r *PIMVRFResource) Create(ctx context.Context, req resource.CreateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -181,7 +181,8 @@ func (r *PIMVRFResource) Update(ctx context.Context, req resource.UpdateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_port_channel_interface.go b/internal/provider/resource_nxos_port_channel_interface.go index 69b8d031..de700730 100644 --- a/internal/provider/resource_nxos_port_channel_interface.go +++ b/internal/provider/resource_nxos_port_channel_interface.go @@ -266,7 +266,7 @@ func (r *PortChannelInterfaceResource) Create(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -328,7 +328,8 @@ func (r *PortChannelInterfaceResource) Update(ctx context.Context, req resource. tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_port_channel_interface_member.go b/internal/provider/resource_nxos_port_channel_interface_member.go index 99568825..df1a29a9 100644 --- a/internal/provider/resource_nxos_port_channel_interface_member.go +++ b/internal/provider/resource_nxos_port_channel_interface_member.go @@ -111,7 +111,7 @@ func (r *PortChannelInterfaceMemberResource) Create(ctx context.Context, req res tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -173,7 +173,8 @@ func (r *PortChannelInterfaceMemberResource) Update(ctx context.Context, req res tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_port_channel_interface_vrf.go b/internal/provider/resource_nxos_port_channel_interface_vrf.go index acdf335b..83a0195e 100644 --- a/internal/provider/resource_nxos_port_channel_interface_vrf.go +++ b/internal/provider/resource_nxos_port_channel_interface_vrf.go @@ -104,7 +104,7 @@ func (r *PortChannelInterfaceVRFResource) Create(ctx context.Context, req resour tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *PortChannelInterfaceVRFResource) Update(ctx context.Context, req resour tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_queuing_qos_policy_map.go b/internal/provider/resource_nxos_queuing_qos_policy_map.go index 186b7c33..97e4da37 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_map.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_map.go @@ -112,7 +112,7 @@ func (r *QueuingQOSPolicyMapResource) Create(ctx context.Context, req resource.C tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -174,7 +174,8 @@ func (r *QueuingQOSPolicyMapResource) Update(ctx context.Context, req resource.U tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map.go b/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map.go index 172e3341..5cdbac76 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map.go @@ -107,7 +107,7 @@ func (r *QueuingQOSPolicyMapMatchClassMapResource) Create(ctx context.Context, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -169,7 +169,8 @@ func (r *QueuingQOSPolicyMapMatchClassMapResource) Update(ctx context.Context, r tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_priority.go b/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_priority.go index 5891220c..3a6f9271 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_priority.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_priority.go @@ -116,7 +116,7 @@ func (r *QueuingQOSPolicyMapMatchClassMapPriorityResource) Create(ctx context.Co tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -178,7 +178,8 @@ func (r *QueuingQOSPolicyMapMatchClassMapPriorityResource) Update(ctx context.Co tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go b/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go index 50fe78fe..12fe580d 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_map_match_class_map_remaining_bandwidth.go @@ -116,7 +116,7 @@ func (r *QueuingQOSPolicyMapMatchClassMapRemainingBandwidthResource) Create(ctx tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -178,7 +178,8 @@ func (r *QueuingQOSPolicyMapMatchClassMapRemainingBandwidthResource) Update(ctx tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_queuing_qos_policy_system_out.go b/internal/provider/resource_nxos_queuing_qos_policy_system_out.go index 507eb194..fc3054ba 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_system_out.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_system_out.go @@ -93,7 +93,7 @@ func (r *QueuingQOSPolicySystemOutResource) Create(ctx context.Context, req reso tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -155,7 +155,8 @@ func (r *QueuingQOSPolicySystemOutResource) Update(ctx context.Context, req reso tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_queuing_qos_policy_system_out_policy_map.go b/internal/provider/resource_nxos_queuing_qos_policy_system_out_policy_map.go index 0867523c..0bf16e51 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_system_out_policy_map.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_system_out_policy_map.go @@ -97,7 +97,7 @@ func (r *QueuingQOSPolicySystemOutPolicyMapResource) Create(ctx context.Context, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -159,7 +159,8 @@ func (r *QueuingQOSPolicySystemOutPolicyMapResource) Update(ctx context.Context, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_route_map_rule.go b/internal/provider/resource_nxos_route_map_rule.go index 694a1403..bd23b1c4 100644 --- a/internal/provider/resource_nxos_route_map_rule.go +++ b/internal/provider/resource_nxos_route_map_rule.go @@ -100,7 +100,7 @@ func (r *RouteMapRuleResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -162,7 +162,8 @@ func (r *RouteMapRuleResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_route_map_rule_entry.go b/internal/provider/resource_nxos_route_map_rule_entry.go index 8878ed05..4b8c78ba 100644 --- a/internal/provider/resource_nxos_route_map_rule_entry.go +++ b/internal/provider/resource_nxos_route_map_rule_entry.go @@ -124,7 +124,7 @@ func (r *RouteMapRuleEntryResource) Create(ctx context.Context, req resource.Cre tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -186,7 +186,8 @@ func (r *RouteMapRuleEntryResource) Update(ctx context.Context, req resource.Upd tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_route_map_rule_entry_match_route.go b/internal/provider/resource_nxos_route_map_rule_entry_match_route.go index b050221b..46560b71 100644 --- a/internal/provider/resource_nxos_route_map_rule_entry_match_route.go +++ b/internal/provider/resource_nxos_route_map_rule_entry_match_route.go @@ -113,7 +113,7 @@ func (r *RouteMapRuleEntryMatchRouteResource) Create(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -175,7 +175,8 @@ func (r *RouteMapRuleEntryMatchRouteResource) Update(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_route_map_rule_entry_match_route_prefix_list.go b/internal/provider/resource_nxos_route_map_rule_entry_match_route_prefix_list.go index d765366b..84ae5e35 100644 --- a/internal/provider/resource_nxos_route_map_rule_entry_match_route_prefix_list.go +++ b/internal/provider/resource_nxos_route_map_rule_entry_match_route_prefix_list.go @@ -120,7 +120,7 @@ func (r *RouteMapRuleEntryMatchRoutePrefixListResource) Create(ctx context.Conte tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -182,7 +182,8 @@ func (r *RouteMapRuleEntryMatchRoutePrefixListResource) Update(ctx context.Conte tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community.go b/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community.go index a70892a5..e7161635 100644 --- a/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community.go +++ b/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community.go @@ -142,7 +142,7 @@ func (r *RouteMapRuleEntrySetRegularCommunityResource) Create(ctx context.Contex tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -204,7 +204,8 @@ func (r *RouteMapRuleEntrySetRegularCommunityResource) Update(ctx context.Contex tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community_item.go b/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community_item.go index ba6286d6..cde3dee5 100644 --- a/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community_item.go +++ b/internal/provider/resource_nxos_route_map_rule_entry_set_regular_community_item.go @@ -120,7 +120,7 @@ func (r *RouteMapRuleEntrySetRegularCommunityItemResource) Create(ctx context.Co tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -182,7 +182,8 @@ func (r *RouteMapRuleEntrySetRegularCommunityItemResource) Update(ctx context.Co tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_spanning_tree_interface.go b/internal/provider/resource_nxos_spanning_tree_interface.go index c31f823b..92926cce 100644 --- a/internal/provider/resource_nxos_spanning_tree_interface.go +++ b/internal/provider/resource_nxos_spanning_tree_interface.go @@ -177,7 +177,7 @@ func (r *SpanningTreeInterfaceResource) Create(ctx context.Context, req resource tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -239,7 +239,8 @@ func (r *SpanningTreeInterfaceResource) Update(ctx context.Context, req resource tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_subinterface.go b/internal/provider/resource_nxos_subinterface.go index 16d919be..9330cd02 100644 --- a/internal/provider/resource_nxos_subinterface.go +++ b/internal/provider/resource_nxos_subinterface.go @@ -169,7 +169,7 @@ func (r *SubinterfaceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -231,7 +231,8 @@ func (r *SubinterfaceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_subinterface_vrf.go b/internal/provider/resource_nxos_subinterface_vrf.go index 09028776..eb0b65f3 100644 --- a/internal/provider/resource_nxos_subinterface_vrf.go +++ b/internal/provider/resource_nxos_subinterface_vrf.go @@ -104,7 +104,7 @@ func (r *SubinterfaceVRFResource) Create(ctx context.Context, req resource.Creat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *SubinterfaceVRFResource) Update(ctx context.Context, req resource.Updat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_svi_interface.go b/internal/provider/resource_nxos_svi_interface.go index 5b0fbefe..bb5e39f7 100644 --- a/internal/provider/resource_nxos_svi_interface.go +++ b/internal/provider/resource_nxos_svi_interface.go @@ -154,7 +154,7 @@ func (r *SVIInterfaceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -216,7 +216,8 @@ func (r *SVIInterfaceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_svi_interface_vrf.go b/internal/provider/resource_nxos_svi_interface_vrf.go index ce519ebd..03284ec7 100644 --- a/internal/provider/resource_nxos_svi_interface_vrf.go +++ b/internal/provider/resource_nxos_svi_interface_vrf.go @@ -104,7 +104,7 @@ func (r *SVIInterfaceVRFResource) Create(ctx context.Context, req resource.Creat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -166,7 +166,8 @@ func (r *SVIInterfaceVRFResource) Update(ctx context.Context, req resource.Updat tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_system.go b/internal/provider/resource_nxos_system.go index 4eecc7fa..2bfa10ce 100644 --- a/internal/provider/resource_nxos_system.go +++ b/internal/provider/resource_nxos_system.go @@ -97,7 +97,7 @@ func (r *SystemResource) Create(ctx context.Context, req resource.CreateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -159,7 +159,8 @@ func (r *SystemResource) Update(ctx context.Context, req resource.UpdateRequest, tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vpc_domain.go b/internal/provider/resource_nxos_vpc_domain.go index d821e2b3..0bdb754c 100644 --- a/internal/provider/resource_nxos_vpc_domain.go +++ b/internal/provider/resource_nxos_vpc_domain.go @@ -270,7 +270,7 @@ func (r *VPCDomainResource) Create(ctx context.Context, req resource.CreateReque tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -332,7 +332,8 @@ func (r *VPCDomainResource) Update(ctx context.Context, req resource.UpdateReque tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vpc_instance.go b/internal/provider/resource_nxos_vpc_instance.go index c20e98b4..66b6b3c4 100644 --- a/internal/provider/resource_nxos_vpc_instance.go +++ b/internal/provider/resource_nxos_vpc_instance.go @@ -105,7 +105,7 @@ func (r *VPCInstanceResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -167,7 +167,8 @@ func (r *VPCInstanceResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vpc_interface.go b/internal/provider/resource_nxos_vpc_interface.go index d7f8ecee..da5d7275 100644 --- a/internal/provider/resource_nxos_vpc_interface.go +++ b/internal/provider/resource_nxos_vpc_interface.go @@ -110,7 +110,7 @@ func (r *VPCInterfaceResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -173,7 +173,8 @@ func (r *VPCInterfaceResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vpc_keepalive.go b/internal/provider/resource_nxos_vpc_keepalive.go index f32b692f..dfef1402 100644 --- a/internal/provider/resource_nxos_vpc_keepalive.go +++ b/internal/provider/resource_nxos_vpc_keepalive.go @@ -196,7 +196,7 @@ func (r *VPCKeepaliveResource) Create(ctx context.Context, req resource.CreateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -258,7 +258,8 @@ func (r *VPCKeepaliveResource) Update(ctx context.Context, req resource.UpdateRe tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vpc_peerlink.go b/internal/provider/resource_nxos_vpc_peerlink.go index cbc3cfda..c2113fe6 100644 --- a/internal/provider/resource_nxos_vpc_peerlink.go +++ b/internal/provider/resource_nxos_vpc_peerlink.go @@ -97,7 +97,7 @@ func (r *VPCPeerlinkResource) Create(ctx context.Context, req resource.CreateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -159,7 +159,8 @@ func (r *VPCPeerlinkResource) Update(ctx context.Context, req resource.UpdateReq tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vrf.go b/internal/provider/resource_nxos_vrf.go index 6fc63c95..1d624e08 100644 --- a/internal/provider/resource_nxos_vrf.go +++ b/internal/provider/resource_nxos_vrf.go @@ -111,7 +111,7 @@ func (r *VRFResource) Create(ctx context.Context, req resource.CreateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -173,7 +173,8 @@ func (r *VRFResource) Update(ctx context.Context, req resource.UpdateRequest, re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vrf_address_family.go b/internal/provider/resource_nxos_vrf_address_family.go index 620a22de..7b4e5b68 100644 --- a/internal/provider/resource_nxos_vrf_address_family.go +++ b/internal/provider/resource_nxos_vrf_address_family.go @@ -112,7 +112,7 @@ func (r *VRFAddressFamilyResource) Create(ctx context.Context, req resource.Crea tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -174,7 +174,8 @@ func (r *VRFAddressFamilyResource) Update(ctx context.Context, req resource.Upda tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vrf_route_target.go b/internal/provider/resource_nxos_vrf_route_target.go index 6e65d174..0f9ab5bd 100644 --- a/internal/provider/resource_nxos_vrf_route_target.go +++ b/internal/provider/resource_nxos_vrf_route_target.go @@ -139,7 +139,7 @@ func (r *VRFRouteTargetResource) Create(ctx context.Context, req resource.Create tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -201,7 +201,8 @@ func (r *VRFRouteTargetResource) Update(ctx context.Context, req resource.Update tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vrf_route_target_address_family.go b/internal/provider/resource_nxos_vrf_route_target_address_family.go index 58ed2674..1c102d1f 100644 --- a/internal/provider/resource_nxos_vrf_route_target_address_family.go +++ b/internal/provider/resource_nxos_vrf_route_target_address_family.go @@ -122,7 +122,7 @@ func (r *VRFRouteTargetAddressFamilyResource) Create(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -184,7 +184,8 @@ func (r *VRFRouteTargetAddressFamilyResource) Update(ctx context.Context, req re tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vrf_route_target_direction.go b/internal/provider/resource_nxos_vrf_route_target_direction.go index 04677d0d..20706e63 100644 --- a/internal/provider/resource_nxos_vrf_route_target_direction.go +++ b/internal/provider/resource_nxos_vrf_route_target_direction.go @@ -132,7 +132,7 @@ func (r *VRFRouteTargetDirectionResource) Create(ctx context.Context, req resour tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -194,7 +194,8 @@ func (r *VRFRouteTargetDirectionResource) Update(ctx context.Context, req resour tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/internal/provider/resource_nxos_vrf_routing.go b/internal/provider/resource_nxos_vrf_routing.go index 007ed3ef..7ae030f0 100644 --- a/internal/provider/resource_nxos_vrf_routing.go +++ b/internal/provider/resource_nxos_vrf_routing.go @@ -107,7 +107,7 @@ func (r *VRFRoutingResource) Create(ctx context.Context, req resource.CreateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -169,7 +169,8 @@ func (r *VRFRoutingResource) Update(ctx context.Context, req resource.UpdateRequ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err))