diff --git a/gen/templates/model.go b/gen/templates/model.go index af91c06b..d563d814 100644 --- a/gen/templates/model.go +++ b/gen/templates/model.go @@ -70,12 +70,12 @@ func (data {{camelCase .Name}}) getDn() string { {{- range .ChildClasses}} {{- if eq .Type "list"}} func (data {{$name}}{{toGoName .TfName}}) getRn() string { - {{- if hasId .Attributes}} - return fmt.Sprintf("{{.Rn}}"{{range .Attributes}}{{if .Id}}, data.{{toGoName .TfName}}.Value{{.Type}}(){{end}}{{end}}) - {{- else}} - return "{{.Rn}}" - {{- end}} - } +{{- if hasId .Attributes}} + return fmt.Sprintf("{{.Rn}}"{{range .Attributes}}{{if .Id}}, data.{{toGoName .TfName}}.Value{{.Type}}(){{end}}{{end}}) +{{- else}} + return "{{.Rn}}" +{{- end}} +} {{- end}} {{- end}} @@ -252,17 +252,15 @@ func (data *{{camelCase .Name}}) fromBody(res gjson.Result, all bool) { func (data {{camelCase .Name}}) toDeleteBody() nxos.Body { body := "" - {{- range .Attributes}} - {{- if not .ReferenceOnly}} - {{- if .DeleteValue}} - {{- if eq .Type "Int64"}} - body, _ = sjson.Set(body, data.getClassName()+".attributes."+"{{.NxosName}}", strconv.FormatInt({{ .DeleteValue}}, 10)) - {{- else if eq .Type "Bool"}} - body, _ = sjson.Set(body, data.getClassName()+".attributes."+"{{.NxosName}}", strconv.FormatBool({{ .DeleteValue}})) - {{- else if eq .Type "String"}} - body, _ = sjson.Set(body, data.getClassName()+".attributes."+"{{.NxosName}}", "{{ .DeleteValue}}") - {{- end}} + {{- range .Attributes}} + {{- if and (not .ReferenceOnly) (.DeleteValue)}} + {{- if eq .Type "Int64"}} + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"{{.NxosName}}", strconv.FormatInt({{ .DeleteValue}}, 10)) + {{- else if eq .Type "Bool"}} + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"{{.NxosName}}", strconv.FormatBool({{ .DeleteValue}})) + {{- else if eq .Type "String"}} + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"{{.NxosName}}", "{{ .DeleteValue}}") {{- end}} {{- end}} {{- end}} diff --git a/gen/templates/resource.go b/gen/templates/resource.go index 857174c7..e0d96bc6 100644 --- a/gen/templates/resource.go +++ b/gen/templates/resource.go @@ -360,7 +360,7 @@ func (r *{{camelCase .Name}}Resource) Delete(ctx context.Context, req resource.D errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/model_nxos_bgp_route_redistribution.go b/internal/provider/model_nxos_bgp_route_redistribution.go index 6a366e6c..ef5b61bd 100644 --- a/internal/provider/model_nxos_bgp_route_redistribution.go +++ b/internal/provider/model_nxos_bgp_route_redistribution.go @@ -98,3 +98,9 @@ func (data *BGPRouteRedistribution) fromBody(res gjson.Result, all bool) { data.Srv6PrefixType = types.StringNull() } } + +func (data BGPRouteRedistribution) toDeleteBody() nxos.Body { + body := "" + + return nxos.Body{body} +} diff --git a/internal/provider/resource_nxos_bgp.go b/internal/provider/resource_nxos_bgp.go index 9fc19c00..34b5a935 100644 --- a/internal/provider/resource_nxos_bgp.go +++ b/internal/provider/resource_nxos_bgp.go @@ -198,7 +198,7 @@ func (r *BGPResource) Delete(ctx context.Context, req resource.DeleteRequest, re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_address_family.go b/internal/provider/resource_nxos_bgp_address_family.go index c00b4b87..ba580f4f 100644 --- a/internal/provider/resource_nxos_bgp_address_family.go +++ b/internal/provider/resource_nxos_bgp_address_family.go @@ -232,7 +232,7 @@ func (r *BGPAddressFamilyResource) Delete(ctx context.Context, req resource.Dele errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_advertised_prefix.go b/internal/provider/resource_nxos_bgp_advertised_prefix.go index f14777c1..163e9db0 100644 --- a/internal/provider/resource_nxos_bgp_advertised_prefix.go +++ b/internal/provider/resource_nxos_bgp_advertised_prefix.go @@ -223,7 +223,7 @@ func (r *BGPAdvertisedPrefixResource) Delete(ctx context.Context, req resource.D errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_graceful_restart.go b/internal/provider/resource_nxos_bgp_graceful_restart.go index 897f70a0..abeb8c18 100644 --- a/internal/provider/resource_nxos_bgp_graceful_restart.go +++ b/internal/provider/resource_nxos_bgp_graceful_restart.go @@ -221,7 +221,7 @@ func (r *BGPGracefulRestartResource) Delete(ctx context.Context, req resource.De errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_instance.go b/internal/provider/resource_nxos_bgp_instance.go index e992235b..e00d4428 100644 --- a/internal/provider/resource_nxos_bgp_instance.go +++ b/internal/provider/resource_nxos_bgp_instance.go @@ -212,7 +212,7 @@ func (r *BGPInstanceResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_peer.go b/internal/provider/resource_nxos_bgp_peer.go index 858acf3d..2fe07cd9 100644 --- a/internal/provider/resource_nxos_bgp_peer.go +++ b/internal/provider/resource_nxos_bgp_peer.go @@ -257,7 +257,7 @@ func (r *BGPPeerResource) Delete(ctx context.Context, req resource.DeleteRequest errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_peer_address_family.go b/internal/provider/resource_nxos_bgp_peer_address_family.go index aa17f812..ca299518 100644 --- a/internal/provider/resource_nxos_bgp_peer_address_family.go +++ b/internal/provider/resource_nxos_bgp_peer_address_family.go @@ -242,7 +242,7 @@ func (r *BGPPeerAddressFamilyResource) Delete(ctx context.Context, req resource. errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 43879dfc..cdc8d350 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 @@ -233,7 +233,7 @@ func (r *BGPPeerAddressFamilyPrefixListControlResource) Delete(ctx context.Conte errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 b59dfd5d..b6a6ef53 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 @@ -233,7 +233,7 @@ func (r *BGPPeerAddressFamilyRouteControlResource) Delete(ctx context.Context, r errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_peer_template.go b/internal/provider/resource_nxos_bgp_peer_template.go index 0cf226cf..e2450c36 100644 --- a/internal/provider/resource_nxos_bgp_peer_template.go +++ b/internal/provider/resource_nxos_bgp_peer_template.go @@ -226,7 +226,7 @@ func (r *BGPPeerTemplateResource) Delete(ctx context.Context, req resource.Delet errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 fee412a3..218e2874 100644 --- a/internal/provider/resource_nxos_bgp_peer_template_address_family.go +++ b/internal/provider/resource_nxos_bgp_peer_template_address_family.go @@ -235,7 +235,7 @@ func (r *BGPPeerTemplateAddressFamilyResource) Delete(ctx context.Context, req r errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 e8c0a370..5a65d1af 100644 --- a/internal/provider/resource_nxos_bgp_peer_template_max_prefix.go +++ b/internal/provider/resource_nxos_bgp_peer_template_max_prefix.go @@ -246,7 +246,7 @@ func (r *BGPPeerTemplateMaxPrefixResource) Delete(ctx context.Context, req resou errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_route_control.go b/internal/provider/resource_nxos_bgp_route_control.go index 026ed8e5..4df33e2f 100644 --- a/internal/provider/resource_nxos_bgp_route_control.go +++ b/internal/provider/resource_nxos_bgp_route_control.go @@ -239,7 +239,7 @@ func (r *BGPRouteControlResource) Delete(ctx context.Context, req resource.Delet errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bgp_route_redistribution.go b/internal/provider/resource_nxos_bgp_route_redistribution.go index 5c2adf70..966074bf 100644 --- a/internal/provider/resource_nxos_bgp_route_redistribution.go +++ b/internal/provider/resource_nxos_bgp_route_redistribution.go @@ -238,14 +238,24 @@ func (r *BGPRouteRedistributionResource) Delete(ctx context.Context, req resourc tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Delete", state.Dn.ValueString())) - res, err := r.clients[state.Device.ValueString()].DeleteDn(state.Dn.ValueString()) - if err != nil { - errCode := res.Get("imdata.0.error.attributes.code").Str - // Ignore errors of type "Cannot delete object" - if errCode != "1" && errCode != "107" { + body := state.toDeleteBody() + + if len(body.Str) > 0 { + _, err := r.clients[state.Device.ValueString()].Post(state.getDn(), body.Str) + if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) return } + } else { + res, err := r.clients[state.Device.ValueString()].DeleteDn(state.Dn.ValueString()) + if err != nil { + errCode := res.Get("imdata.0.error.attributes.code").Str + // Ignore errors of type "Cannot delete object" + if errCode != "1" && errCode != "107" { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) + return + } + } } tflog.Debug(ctx, fmt.Sprintf("%s: Delete finished successfully", state.Dn.ValueString())) diff --git a/internal/provider/resource_nxos_bgp_vrf.go b/internal/provider/resource_nxos_bgp_vrf.go index 914f37a8..2be665a6 100644 --- a/internal/provider/resource_nxos_bgp_vrf.go +++ b/internal/provider/resource_nxos_bgp_vrf.go @@ -204,7 +204,7 @@ func (r *BGPVRFResource) Delete(ctx context.Context, req resource.DeleteRequest, errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_bridge_domain.go b/internal/provider/resource_nxos_bridge_domain.go index 0d49f772..f6e37d58 100644 --- a/internal/provider/resource_nxos_bridge_domain.go +++ b/internal/provider/resource_nxos_bridge_domain.go @@ -204,7 +204,7 @@ func (r *BridgeDomainResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_default_qos_class_map.go b/internal/provider/resource_nxos_default_qos_class_map.go index 3c8ced68..8aeda9d6 100644 --- a/internal/provider/resource_nxos_default_qos_class_map.go +++ b/internal/provider/resource_nxos_default_qos_class_map.go @@ -205,7 +205,7 @@ func (r *DefaultQOSClassMapResource) Delete(ctx context.Context, req resource.De errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 1a14ab42..8255c98b 100644 --- a/internal/provider/resource_nxos_default_qos_class_map_dscp.go +++ b/internal/provider/resource_nxos_default_qos_class_map_dscp.go @@ -200,7 +200,7 @@ func (r *DefaultQOSClassMapDSCPResource) Delete(ctx context.Context, req resourc errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 04fb8558..9044555d 100644 --- a/internal/provider/resource_nxos_default_qos_policy_interface_in.go +++ b/internal/provider/resource_nxos_default_qos_policy_interface_in.go @@ -193,7 +193,7 @@ func (r *DefaultQOSPolicyInterfaceInResource) Delete(ctx context.Context, req re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 0a1e7cf9..e73479b7 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 @@ -197,7 +197,7 @@ func (r *DefaultQOSPolicyInterfaceInPolicyMapResource) Delete(ctx context.Contex errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_default_qos_policy_map.go b/internal/provider/resource_nxos_default_qos_policy_map.go index 9b1954f5..5fec92af 100644 --- a/internal/provider/resource_nxos_default_qos_policy_map.go +++ b/internal/provider/resource_nxos_default_qos_policy_map.go @@ -205,7 +205,7 @@ func (r *DefaultQOSPolicyMapResource) Delete(ctx context.Context, req resource.D errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 2d1a5e83..33c5e823 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 @@ -200,7 +200,7 @@ func (r *DefaultQOSPolicyMapMatchClassMapResource) Delete(ctx context.Context, r errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 57403296..f59a8f63 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 @@ -410,7 +410,7 @@ func (r *DefaultQOSPolicyMapMatchClassMapPoliceResource) Delete(ctx context.Cont errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 89c8d297..b37cb751 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 @@ -212,7 +212,7 @@ func (r *DefaultQOSPolicyMapMatchClassMapSetQOSGroupResource) Delete(ctx context errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_dhcp_relay_address.go b/internal/provider/resource_nxos_dhcp_relay_address.go index 8a04a67e..1dce1df3 100644 --- a/internal/provider/resource_nxos_dhcp_relay_address.go +++ b/internal/provider/resource_nxos_dhcp_relay_address.go @@ -207,7 +207,7 @@ func (r *DHCPRelayAddressResource) Delete(ctx context.Context, req resource.Dele errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_dhcp_relay_interface.go b/internal/provider/resource_nxos_dhcp_relay_interface.go index 2f6cbcff..d97dbc1c 100644 --- a/internal/provider/resource_nxos_dhcp_relay_interface.go +++ b/internal/provider/resource_nxos_dhcp_relay_interface.go @@ -193,7 +193,7 @@ func (r *DHCPRelayInterfaceResource) Delete(ctx context.Context, req resource.De errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ethernet.go b/internal/provider/resource_nxos_ethernet.go index 8db9faf9..957b10f8 100644 --- a/internal/provider/resource_nxos_ethernet.go +++ b/internal/provider/resource_nxos_ethernet.go @@ -198,7 +198,7 @@ func (r *EthernetResource) Delete(ctx context.Context, req resource.DeleteReques errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_evpn.go b/internal/provider/resource_nxos_evpn.go index 87495fc8..c9c13fea 100644 --- a/internal/provider/resource_nxos_evpn.go +++ b/internal/provider/resource_nxos_evpn.go @@ -198,7 +198,7 @@ func (r *EVPNResource) Delete(ctx context.Context, req resource.DeleteRequest, r errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_evpn_vni.go b/internal/provider/resource_nxos_evpn_vni.go index a2437ae9..dff8a91d 100644 --- a/internal/provider/resource_nxos_evpn_vni.go +++ b/internal/provider/resource_nxos_evpn_vni.go @@ -200,7 +200,7 @@ func (r *EVPNVNIResource) Delete(ctx context.Context, req resource.DeleteRequest errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_evpn_vni_route_target.go b/internal/provider/resource_nxos_evpn_vni_route_target.go index 5bf4e990..8f23ae06 100644 --- a/internal/provider/resource_nxos_evpn_vni_route_target.go +++ b/internal/provider/resource_nxos_evpn_vni_route_target.go @@ -212,7 +212,7 @@ func (r *EVPNVNIRouteTargetResource) Delete(ctx context.Context, req resource.De errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 372a77d1..62d8ddf7 100644 --- a/internal/provider/resource_nxos_evpn_vni_route_target_direction.go +++ b/internal/provider/resource_nxos_evpn_vni_route_target_direction.go @@ -205,7 +205,7 @@ func (r *EVPNVNIRouteTargetDirectionResource) Delete(ctx context.Context, req re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_bfd.go b/internal/provider/resource_nxos_feature_bfd.go index b8780c57..365a34ff 100644 --- a/internal/provider/resource_nxos_feature_bfd.go +++ b/internal/provider/resource_nxos_feature_bfd.go @@ -195,7 +195,7 @@ func (r *FeatureBFDResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_bgp.go b/internal/provider/resource_nxos_feature_bgp.go index 6251b76b..5e6f4763 100644 --- a/internal/provider/resource_nxos_feature_bgp.go +++ b/internal/provider/resource_nxos_feature_bgp.go @@ -195,7 +195,7 @@ func (r *FeatureBGPResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_dhcp.go b/internal/provider/resource_nxos_feature_dhcp.go index 8c3b8b7d..8dde82bd 100644 --- a/internal/provider/resource_nxos_feature_dhcp.go +++ b/internal/provider/resource_nxos_feature_dhcp.go @@ -195,7 +195,7 @@ func (r *FeatureDHCPResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_evpn.go b/internal/provider/resource_nxos_feature_evpn.go index 92419516..e69644be 100644 --- a/internal/provider/resource_nxos_feature_evpn.go +++ b/internal/provider/resource_nxos_feature_evpn.go @@ -195,7 +195,7 @@ func (r *FeatureEVPNResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_hmm.go b/internal/provider/resource_nxos_feature_hmm.go index 92ddde47..7a75b082 100644 --- a/internal/provider/resource_nxos_feature_hmm.go +++ b/internal/provider/resource_nxos_feature_hmm.go @@ -195,7 +195,7 @@ func (r *FeatureHMMResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_hsrp.go b/internal/provider/resource_nxos_feature_hsrp.go index 0dfd5546..8bb74cce 100644 --- a/internal/provider/resource_nxos_feature_hsrp.go +++ b/internal/provider/resource_nxos_feature_hsrp.go @@ -195,7 +195,7 @@ func (r *FeatureHSRPResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_interface_vlan.go b/internal/provider/resource_nxos_feature_interface_vlan.go index b0fb3d9d..8064b6ef 100644 --- a/internal/provider/resource_nxos_feature_interface_vlan.go +++ b/internal/provider/resource_nxos_feature_interface_vlan.go @@ -195,7 +195,7 @@ func (r *FeatureInterfaceVLANResource) Delete(ctx context.Context, req resource. errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_isis.go b/internal/provider/resource_nxos_feature_isis.go index 97169781..c4cdf44e 100644 --- a/internal/provider/resource_nxos_feature_isis.go +++ b/internal/provider/resource_nxos_feature_isis.go @@ -195,7 +195,7 @@ func (r *FeatureISISResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_lacp.go b/internal/provider/resource_nxos_feature_lacp.go index 2e74c721..3f82bc6f 100644 --- a/internal/provider/resource_nxos_feature_lacp.go +++ b/internal/provider/resource_nxos_feature_lacp.go @@ -195,7 +195,7 @@ func (r *FeatureLACPResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_lldp.go b/internal/provider/resource_nxos_feature_lldp.go index 57937e9c..4db670a5 100644 --- a/internal/provider/resource_nxos_feature_lldp.go +++ b/internal/provider/resource_nxos_feature_lldp.go @@ -195,7 +195,7 @@ func (r *FeatureLLDPResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_macsec.go b/internal/provider/resource_nxos_feature_macsec.go index 54b58ced..d393edfc 100644 --- a/internal/provider/resource_nxos_feature_macsec.go +++ b/internal/provider/resource_nxos_feature_macsec.go @@ -195,7 +195,7 @@ func (r *FeatureMACsecResource) Delete(ctx context.Context, req resource.DeleteR errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_netflow.go b/internal/provider/resource_nxos_feature_netflow.go index e2cd4dbf..85e62dcc 100644 --- a/internal/provider/resource_nxos_feature_netflow.go +++ b/internal/provider/resource_nxos_feature_netflow.go @@ -195,7 +195,7 @@ func (r *FeatureNetflowResource) Delete(ctx context.Context, req resource.Delete errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_nv_overlay.go b/internal/provider/resource_nxos_feature_nv_overlay.go index 37f04026..33449c27 100644 --- a/internal/provider/resource_nxos_feature_nv_overlay.go +++ b/internal/provider/resource_nxos_feature_nv_overlay.go @@ -195,7 +195,7 @@ func (r *FeatureNVOverlayResource) Delete(ctx context.Context, req resource.Dele errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_ospf.go b/internal/provider/resource_nxos_feature_ospf.go index bbb0e4b3..c2b7ce7a 100644 --- a/internal/provider/resource_nxos_feature_ospf.go +++ b/internal/provider/resource_nxos_feature_ospf.go @@ -195,7 +195,7 @@ func (r *FeatureOSPFResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_ospfv3.go b/internal/provider/resource_nxos_feature_ospfv3.go index af349f8e..0846e026 100644 --- a/internal/provider/resource_nxos_feature_ospfv3.go +++ b/internal/provider/resource_nxos_feature_ospfv3.go @@ -195,7 +195,7 @@ func (r *FeatureOSPFv3Resource) Delete(ctx context.Context, req resource.DeleteR errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_pim.go b/internal/provider/resource_nxos_feature_pim.go index 3455d37e..8c0f960c 100644 --- a/internal/provider/resource_nxos_feature_pim.go +++ b/internal/provider/resource_nxos_feature_pim.go @@ -195,7 +195,7 @@ func (r *FeaturePIMResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_ptp.go b/internal/provider/resource_nxos_feature_ptp.go index ea58e0de..60956589 100644 --- a/internal/provider/resource_nxos_feature_ptp.go +++ b/internal/provider/resource_nxos_feature_ptp.go @@ -195,7 +195,7 @@ func (r *FeaturePTPResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_pvlan.go b/internal/provider/resource_nxos_feature_pvlan.go index 2922711d..22de8a97 100644 --- a/internal/provider/resource_nxos_feature_pvlan.go +++ b/internal/provider/resource_nxos_feature_pvlan.go @@ -195,7 +195,7 @@ func (r *FeaturePVLANResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_ssh.go b/internal/provider/resource_nxos_feature_ssh.go index cfea685f..9f1ea5ba 100644 --- a/internal/provider/resource_nxos_feature_ssh.go +++ b/internal/provider/resource_nxos_feature_ssh.go @@ -195,7 +195,7 @@ func (r *FeatureSSHResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_tacacs.go b/internal/provider/resource_nxos_feature_tacacs.go index 1fe3f7e2..3272f7dd 100644 --- a/internal/provider/resource_nxos_feature_tacacs.go +++ b/internal/provider/resource_nxos_feature_tacacs.go @@ -195,7 +195,7 @@ func (r *FeatureTACACSResource) Delete(ctx context.Context, req resource.DeleteR errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_telnet.go b/internal/provider/resource_nxos_feature_telnet.go index 22795fc6..9d15d3a2 100644 --- a/internal/provider/resource_nxos_feature_telnet.go +++ b/internal/provider/resource_nxos_feature_telnet.go @@ -195,7 +195,7 @@ func (r *FeatureTelnetResource) Delete(ctx context.Context, req resource.DeleteR errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_udld.go b/internal/provider/resource_nxos_feature_udld.go index baef43d0..ff9df203 100644 --- a/internal/provider/resource_nxos_feature_udld.go +++ b/internal/provider/resource_nxos_feature_udld.go @@ -195,7 +195,7 @@ func (r *FeatureUDLDResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_vn_segment.go b/internal/provider/resource_nxos_feature_vn_segment.go index c48bc6a4..7f0dd2e4 100644 --- a/internal/provider/resource_nxos_feature_vn_segment.go +++ b/internal/provider/resource_nxos_feature_vn_segment.go @@ -195,7 +195,7 @@ func (r *FeatureVNSegmentResource) Delete(ctx context.Context, req resource.Dele errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_feature_vpc.go b/internal/provider/resource_nxos_feature_vpc.go index c89a3fa2..1892e3ea 100644 --- a/internal/provider/resource_nxos_feature_vpc.go +++ b/internal/provider/resource_nxos_feature_vpc.go @@ -195,7 +195,7 @@ func (r *FeatureVPCResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_hmm.go b/internal/provider/resource_nxos_hmm.go index 983caaf6..187af0bb 100644 --- a/internal/provider/resource_nxos_hmm.go +++ b/internal/provider/resource_nxos_hmm.go @@ -198,7 +198,7 @@ func (r *HMMResource) Delete(ctx context.Context, req resource.DeleteRequest, re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_hmm_instance.go b/internal/provider/resource_nxos_hmm_instance.go index 800f8dd1..dce1533d 100644 --- a/internal/provider/resource_nxos_hmm_instance.go +++ b/internal/provider/resource_nxos_hmm_instance.go @@ -204,7 +204,7 @@ func (r *HMMInstanceResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_hmm_interface.go b/internal/provider/resource_nxos_hmm_interface.go index 0827bb5e..4421c417 100644 --- a/internal/provider/resource_nxos_hmm_interface.go +++ b/internal/provider/resource_nxos_hmm_interface.go @@ -214,7 +214,7 @@ func (r *HMMInterfaceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ipv4_access_list.go b/internal/provider/resource_nxos_ipv4_access_list.go index 26292edc..199c26f7 100644 --- a/internal/provider/resource_nxos_ipv4_access_list.go +++ b/internal/provider/resource_nxos_ipv4_access_list.go @@ -193,7 +193,7 @@ func (r *IPv4AccessListResource) Delete(ctx context.Context, req resource.Delete errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ipv4_access_list_entry.go b/internal/provider/resource_nxos_ipv4_access_list_entry.go index e9e381ac..a868eaae 100644 --- a/internal/provider/resource_nxos_ipv4_access_list_entry.go +++ b/internal/provider/resource_nxos_ipv4_access_list_entry.go @@ -445,7 +445,7 @@ func (r *IPv4AccessListEntryResource) Delete(ctx context.Context, req resource.D errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 c1de8569..2f928657 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 @@ -198,7 +198,7 @@ func (r *IPv4AccessListPolicyEgressInterfaceResource) Delete(ctx context.Context errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 1ab0c855..ab803c50 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 @@ -198,7 +198,7 @@ func (r *IPv4AccessListPolicyIngressInterfaceResource) Delete(ctx context.Contex errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ipv4_interface.go b/internal/provider/resource_nxos_ipv4_interface.go index d3a388e6..298fb9dd 100644 --- a/internal/provider/resource_nxos_ipv4_interface.go +++ b/internal/provider/resource_nxos_ipv4_interface.go @@ -236,7 +236,7 @@ func (r *IPv4InterfaceResource) Delete(ctx context.Context, req resource.DeleteR errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ipv4_interface_address.go b/internal/provider/resource_nxos_ipv4_interface_address.go index 91f951e2..79cba6b1 100644 --- a/internal/provider/resource_nxos_ipv4_interface_address.go +++ b/internal/provider/resource_nxos_ipv4_interface_address.go @@ -219,7 +219,7 @@ func (r *IPv4InterfaceAddressResource) Delete(ctx context.Context, req resource. errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ipv4_prefix_list_rule.go b/internal/provider/resource_nxos_ipv4_prefix_list_rule.go index ca8b3398..eff2b793 100644 --- a/internal/provider/resource_nxos_ipv4_prefix_list_rule.go +++ b/internal/provider/resource_nxos_ipv4_prefix_list_rule.go @@ -193,7 +193,7 @@ func (r *IPv4PrefixListRuleResource) Delete(ctx context.Context, req resource.De errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 2c2fcd09..c9a503f5 100644 --- a/internal/provider/resource_nxos_ipv4_prefix_list_rule_entry.go +++ b/internal/provider/resource_nxos_ipv4_prefix_list_rule_entry.go @@ -249,7 +249,7 @@ func (r *IPv4PrefixListRuleEntryResource) Delete(ctx context.Context, req resour errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ipv4_static_route.go b/internal/provider/resource_nxos_ipv4_static_route.go index 114b7fa2..a0d176c6 100644 --- a/internal/provider/resource_nxos_ipv4_static_route.go +++ b/internal/provider/resource_nxos_ipv4_static_route.go @@ -257,7 +257,7 @@ func (r *IPv4StaticRouteResource) Delete(ctx context.Context, req resource.Delet errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ipv4_vrf.go b/internal/provider/resource_nxos_ipv4_vrf.go index f0c3a45c..d7807952 100644 --- a/internal/provider/resource_nxos_ipv4_vrf.go +++ b/internal/provider/resource_nxos_ipv4_vrf.go @@ -193,7 +193,7 @@ func (r *IPv4VRFResource) Delete(ctx context.Context, req resource.DeleteRequest errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_isis.go b/internal/provider/resource_nxos_isis.go index 07eb4751..ed8fd81c 100644 --- a/internal/provider/resource_nxos_isis.go +++ b/internal/provider/resource_nxos_isis.go @@ -198,7 +198,7 @@ func (r *ISISResource) Delete(ctx context.Context, req resource.DeleteRequest, r errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_isis_instance.go b/internal/provider/resource_nxos_isis_instance.go index 3cb65d25..271d24f1 100644 --- a/internal/provider/resource_nxos_isis_instance.go +++ b/internal/provider/resource_nxos_isis_instance.go @@ -205,7 +205,7 @@ func (r *ISISInstanceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_isis_interface.go b/internal/provider/resource_nxos_isis_interface.go index 4d552be1..f6b7641b 100644 --- a/internal/provider/resource_nxos_isis_interface.go +++ b/internal/provider/resource_nxos_isis_interface.go @@ -414,7 +414,7 @@ func (r *ISISInterfaceResource) Delete(ctx context.Context, req resource.DeleteR errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_isis_vrf.go b/internal/provider/resource_nxos_isis_vrf.go index 3b8b132e..6adf3c7e 100644 --- a/internal/provider/resource_nxos_isis_vrf.go +++ b/internal/provider/resource_nxos_isis_vrf.go @@ -311,7 +311,7 @@ func (r *ISISVRFResource) Delete(ctx context.Context, req resource.DeleteRequest errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_loopback_interface.go b/internal/provider/resource_nxos_loopback_interface.go index 13a70696..ed03f623 100644 --- a/internal/provider/resource_nxos_loopback_interface.go +++ b/internal/provider/resource_nxos_loopback_interface.go @@ -209,7 +209,7 @@ func (r *LoopbackInterfaceResource) Delete(ctx context.Context, req resource.Del errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_loopback_interface_vrf.go b/internal/provider/resource_nxos_loopback_interface_vrf.go index 111512ca..9b1dc05d 100644 --- a/internal/provider/resource_nxos_loopback_interface_vrf.go +++ b/internal/provider/resource_nxos_loopback_interface_vrf.go @@ -197,7 +197,7 @@ func (r *LoopbackInterfaceVRFResource) Delete(ctx context.Context, req resource. errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ntp_server.go b/internal/provider/resource_nxos_ntp_server.go index affda296..322509d3 100644 --- a/internal/provider/resource_nxos_ntp_server.go +++ b/internal/provider/resource_nxos_ntp_server.go @@ -236,7 +236,7 @@ func (r *NTPServerResource) Delete(ctx context.Context, req resource.DeleteReque errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_nve_interface.go b/internal/provider/resource_nxos_nve_interface.go index b68571d3..42e37913 100644 --- a/internal/provider/resource_nxos_nve_interface.go +++ b/internal/provider/resource_nxos_nve_interface.go @@ -267,7 +267,7 @@ func (r *NVEInterfaceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_nve_vni.go b/internal/provider/resource_nxos_nve_vni.go index e3655fbf..3710dbe6 100644 --- a/internal/provider/resource_nxos_nve_vni.go +++ b/internal/provider/resource_nxos_nve_vni.go @@ -236,7 +236,7 @@ func (r *NVEVNIResource) Delete(ctx context.Context, req resource.DeleteRequest, errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_nve_vni_container.go b/internal/provider/resource_nxos_nve_vni_container.go index 2b02b9d5..76ddc525 100644 --- a/internal/provider/resource_nxos_nve_vni_container.go +++ b/internal/provider/resource_nxos_nve_vni_container.go @@ -186,7 +186,7 @@ func (r *NVEVNIContainerResource) Delete(ctx context.Context, req resource.Delet errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_nve_vni_ingress_replication.go b/internal/provider/resource_nxos_nve_vni_ingress_replication.go index 4856c672..489c1a76 100644 --- a/internal/provider/resource_nxos_nve_vni_ingress_replication.go +++ b/internal/provider/resource_nxos_nve_vni_ingress_replication.go @@ -210,7 +210,7 @@ func (r *NVEVNIIngressReplicationResource) Delete(ctx context.Context, req resou errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ospf.go b/internal/provider/resource_nxos_ospf.go index bf5b8126..cc626e65 100644 --- a/internal/provider/resource_nxos_ospf.go +++ b/internal/provider/resource_nxos_ospf.go @@ -198,7 +198,7 @@ func (r *OSPFResource) Delete(ctx context.Context, req resource.DeleteRequest, r errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ospf_area.go b/internal/provider/resource_nxos_ospf_area.go index 5133de48..89e7c68c 100644 --- a/internal/provider/resource_nxos_ospf_area.go +++ b/internal/provider/resource_nxos_ospf_area.go @@ -239,7 +239,7 @@ func (r *OSPFAreaResource) Delete(ctx context.Context, req resource.DeleteReques errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ospf_authentication.go b/internal/provider/resource_nxos_ospf_authentication.go index 70ffc9ca..3a118e97 100644 --- a/internal/provider/resource_nxos_ospf_authentication.go +++ b/internal/provider/resource_nxos_ospf_authentication.go @@ -255,7 +255,7 @@ func (r *OSPFAuthenticationResource) Delete(ctx context.Context, req resource.De errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ospf_instance.go b/internal/provider/resource_nxos_ospf_instance.go index 47b7c435..cba53724 100644 --- a/internal/provider/resource_nxos_ospf_instance.go +++ b/internal/provider/resource_nxos_ospf_instance.go @@ -205,7 +205,7 @@ func (r *OSPFInstanceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ospf_interface.go b/internal/provider/resource_nxos_ospf_interface.go index 45b31742..81f34d90 100644 --- a/internal/provider/resource_nxos_ospf_interface.go +++ b/internal/provider/resource_nxos_ospf_interface.go @@ -288,7 +288,7 @@ func (r *OSPFInterfaceResource) Delete(ctx context.Context, req resource.DeleteR errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_ospf_vrf.go b/internal/provider/resource_nxos_ospf_vrf.go index e0d231e8..0d759e58 100644 --- a/internal/provider/resource_nxos_ospf_vrf.go +++ b/internal/provider/resource_nxos_ospf_vrf.go @@ -247,7 +247,7 @@ func (r *OSPFVRFResource) Delete(ctx context.Context, req resource.DeleteRequest errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_physical_interface.go b/internal/provider/resource_nxos_physical_interface.go index ebf25e7c..c216d724 100644 --- a/internal/provider/resource_nxos_physical_interface.go +++ b/internal/provider/resource_nxos_physical_interface.go @@ -368,7 +368,7 @@ func (r *PhysicalInterfaceResource) Delete(ctx context.Context, req resource.Del errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_physical_interface_vrf.go b/internal/provider/resource_nxos_physical_interface_vrf.go index 1572254b..7ff8f932 100644 --- a/internal/provider/resource_nxos_physical_interface_vrf.go +++ b/internal/provider/resource_nxos_physical_interface_vrf.go @@ -197,7 +197,7 @@ func (r *PhysicalInterfaceVRFResource) Delete(ctx context.Context, req resource. errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim.go b/internal/provider/resource_nxos_pim.go index fc966b75..efa64de4 100644 --- a/internal/provider/resource_nxos_pim.go +++ b/internal/provider/resource_nxos_pim.go @@ -198,7 +198,7 @@ func (r *PIMResource) Delete(ctx context.Context, req resource.DeleteRequest, re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_anycast_rp.go b/internal/provider/resource_nxos_pim_anycast_rp.go index c825a4a3..912a788c 100644 --- a/internal/provider/resource_nxos_pim_anycast_rp.go +++ b/internal/provider/resource_nxos_pim_anycast_rp.go @@ -201,7 +201,7 @@ func (r *PIMAnycastRPResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_anycast_rp_peer.go b/internal/provider/resource_nxos_pim_anycast_rp_peer.go index 6775ddad..981739b2 100644 --- a/internal/provider/resource_nxos_pim_anycast_rp_peer.go +++ b/internal/provider/resource_nxos_pim_anycast_rp_peer.go @@ -207,7 +207,7 @@ func (r *PIMAnycastRPPeerResource) Delete(ctx context.Context, req resource.Dele errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_instance.go b/internal/provider/resource_nxos_pim_instance.go index 8f26ac1c..0e7736a3 100644 --- a/internal/provider/resource_nxos_pim_instance.go +++ b/internal/provider/resource_nxos_pim_instance.go @@ -198,7 +198,7 @@ func (r *PIMInstanceResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_interface.go b/internal/provider/resource_nxos_pim_interface.go index 9f6922f7..70207c35 100644 --- a/internal/provider/resource_nxos_pim_interface.go +++ b/internal/provider/resource_nxos_pim_interface.go @@ -245,7 +245,7 @@ func (r *PIMInterfaceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_ssm_policy.go b/internal/provider/resource_nxos_pim_ssm_policy.go index 8ed25287..3b4e453a 100644 --- a/internal/provider/resource_nxos_pim_ssm_policy.go +++ b/internal/provider/resource_nxos_pim_ssm_policy.go @@ -197,7 +197,7 @@ func (r *PIMSSMPolicyResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_ssm_range.go b/internal/provider/resource_nxos_pim_ssm_range.go index 862f32ef..eadca719 100644 --- a/internal/provider/resource_nxos_pim_ssm_range.go +++ b/internal/provider/resource_nxos_pim_ssm_range.go @@ -233,7 +233,7 @@ func (r *PIMSSMRangeResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_static_rp.go b/internal/provider/resource_nxos_pim_static_rp.go index e492dbae..f7cf2cb2 100644 --- a/internal/provider/resource_nxos_pim_static_rp.go +++ b/internal/provider/resource_nxos_pim_static_rp.go @@ -200,7 +200,7 @@ func (r *PIMStaticRPResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 9a9f19d7..63acfe5a 100644 --- a/internal/provider/resource_nxos_pim_static_rp_group_list.go +++ b/internal/provider/resource_nxos_pim_static_rp_group_list.go @@ -220,7 +220,7 @@ func (r *PIMStaticRPGroupListResource) Delete(ctx context.Context, req resource. errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_static_rp_policy.go b/internal/provider/resource_nxos_pim_static_rp_policy.go index 7c218d63..1efcfce9 100644 --- a/internal/provider/resource_nxos_pim_static_rp_policy.go +++ b/internal/provider/resource_nxos_pim_static_rp_policy.go @@ -197,7 +197,7 @@ func (r *PIMStaticRPPolicyResource) Delete(ctx context.Context, req resource.Del errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_pim_vrf.go b/internal/provider/resource_nxos_pim_vrf.go index 00409145..252c902d 100644 --- a/internal/provider/resource_nxos_pim_vrf.go +++ b/internal/provider/resource_nxos_pim_vrf.go @@ -212,7 +212,7 @@ func (r *PIMVRFResource) Delete(ctx context.Context, req resource.DeleteRequest, errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_port_channel_interface.go b/internal/provider/resource_nxos_port_channel_interface.go index c1b192e7..a68851b6 100644 --- a/internal/provider/resource_nxos_port_channel_interface.go +++ b/internal/provider/resource_nxos_port_channel_interface.go @@ -359,7 +359,7 @@ func (r *PortChannelInterfaceResource) Delete(ctx context.Context, req resource. errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_port_channel_interface_member.go b/internal/provider/resource_nxos_port_channel_interface_member.go index 98517294..f237597d 100644 --- a/internal/provider/resource_nxos_port_channel_interface_member.go +++ b/internal/provider/resource_nxos_port_channel_interface_member.go @@ -204,7 +204,7 @@ func (r *PortChannelInterfaceMemberResource) Delete(ctx context.Context, req res errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_port_channel_interface_vrf.go b/internal/provider/resource_nxos_port_channel_interface_vrf.go index db5996f7..9bea9950 100644 --- a/internal/provider/resource_nxos_port_channel_interface_vrf.go +++ b/internal/provider/resource_nxos_port_channel_interface_vrf.go @@ -197,7 +197,7 @@ func (r *PortChannelInterfaceVRFResource) Delete(ctx context.Context, req resour errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_queuing_qos_policy_map.go b/internal/provider/resource_nxos_queuing_qos_policy_map.go index cf496cdc..79b9afc3 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_map.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_map.go @@ -205,7 +205,7 @@ func (r *QueuingQOSPolicyMapResource) Delete(ctx context.Context, req resource.D errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 c6db6ed4..afc5230d 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 @@ -200,7 +200,7 @@ func (r *QueuingQOSPolicyMapMatchClassMapResource) Delete(ctx context.Context, r errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 7f31a757..a454d568 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 @@ -209,7 +209,7 @@ func (r *QueuingQOSPolicyMapMatchClassMapPriorityResource) Delete(ctx context.Co errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 2832422d..cf2d8535 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 @@ -209,7 +209,7 @@ func (r *QueuingQOSPolicyMapMatchClassMapRemainingBandwidthResource) Delete(ctx errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 9c554d32..1839e408 100644 --- a/internal/provider/resource_nxos_queuing_qos_policy_system_out.go +++ b/internal/provider/resource_nxos_queuing_qos_policy_system_out.go @@ -186,7 +186,7 @@ func (r *QueuingQOSPolicySystemOutResource) Delete(ctx context.Context, req reso errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 6de8ded5..f16a4fb6 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 @@ -190,7 +190,7 @@ func (r *QueuingQOSPolicySystemOutPolicyMapResource) Delete(ctx context.Context, errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_route_map_rule.go b/internal/provider/resource_nxos_route_map_rule.go index ec1877ec..3a6100bf 100644 --- a/internal/provider/resource_nxos_route_map_rule.go +++ b/internal/provider/resource_nxos_route_map_rule.go @@ -193,7 +193,7 @@ func (r *RouteMapRuleResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_route_map_rule_entry.go b/internal/provider/resource_nxos_route_map_rule_entry.go index c1037928..fe632e60 100644 --- a/internal/provider/resource_nxos_route_map_rule_entry.go +++ b/internal/provider/resource_nxos_route_map_rule_entry.go @@ -217,7 +217,7 @@ func (r *RouteMapRuleEntryResource) Delete(ctx context.Context, req resource.Del errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 2cca2fc1..c064a99f 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 @@ -206,7 +206,7 @@ func (r *RouteMapRuleEntryMatchRouteResource) Delete(ctx context.Context, req re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 61568be5..e966952c 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 @@ -213,7 +213,7 @@ func (r *RouteMapRuleEntryMatchRoutePrefixListResource) Delete(ctx context.Conte errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 4128c24e..e4c99e79 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 @@ -235,7 +235,7 @@ func (r *RouteMapRuleEntrySetRegularCommunityResource) Delete(ctx context.Contex errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 054a1439..1c47f6ad 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 @@ -213,7 +213,7 @@ func (r *RouteMapRuleEntrySetRegularCommunityItemResource) Delete(ctx context.Co errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_spanning_tree_interface.go b/internal/provider/resource_nxos_spanning_tree_interface.go index 4d1447f4..225ca19f 100644 --- a/internal/provider/resource_nxos_spanning_tree_interface.go +++ b/internal/provider/resource_nxos_spanning_tree_interface.go @@ -270,7 +270,7 @@ func (r *SpanningTreeInterfaceResource) Delete(ctx context.Context, req resource errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_subinterface.go b/internal/provider/resource_nxos_subinterface.go index 05ba1ab5..6f80c8a1 100644 --- a/internal/provider/resource_nxos_subinterface.go +++ b/internal/provider/resource_nxos_subinterface.go @@ -262,7 +262,7 @@ func (r *SubinterfaceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_subinterface_vrf.go b/internal/provider/resource_nxos_subinterface_vrf.go index 9cc96209..89a68d38 100644 --- a/internal/provider/resource_nxos_subinterface_vrf.go +++ b/internal/provider/resource_nxos_subinterface_vrf.go @@ -197,7 +197,7 @@ func (r *SubinterfaceVRFResource) Delete(ctx context.Context, req resource.Delet errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_svi_interface.go b/internal/provider/resource_nxos_svi_interface.go index 072b840e..5277da8d 100644 --- a/internal/provider/resource_nxos_svi_interface.go +++ b/internal/provider/resource_nxos_svi_interface.go @@ -247,7 +247,7 @@ func (r *SVIInterfaceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_svi_interface_vrf.go b/internal/provider/resource_nxos_svi_interface_vrf.go index 0e94e0e6..c8ae13ca 100644 --- a/internal/provider/resource_nxos_svi_interface_vrf.go +++ b/internal/provider/resource_nxos_svi_interface_vrf.go @@ -197,7 +197,7 @@ func (r *SVIInterfaceVRFResource) Delete(ctx context.Context, req resource.Delet errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vpc_domain.go b/internal/provider/resource_nxos_vpc_domain.go index 01f635b5..d591ab38 100644 --- a/internal/provider/resource_nxos_vpc_domain.go +++ b/internal/provider/resource_nxos_vpc_domain.go @@ -363,7 +363,7 @@ func (r *VPCDomainResource) Delete(ctx context.Context, req resource.DeleteReque errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vpc_instance.go b/internal/provider/resource_nxos_vpc_instance.go index 33200f2b..bab0b723 100644 --- a/internal/provider/resource_nxos_vpc_instance.go +++ b/internal/provider/resource_nxos_vpc_instance.go @@ -198,7 +198,7 @@ func (r *VPCInstanceResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vpc_interface.go b/internal/provider/resource_nxos_vpc_interface.go index 8aeac415..85bfff24 100644 --- a/internal/provider/resource_nxos_vpc_interface.go +++ b/internal/provider/resource_nxos_vpc_interface.go @@ -204,7 +204,7 @@ func (r *VPCInterfaceResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vpc_keepalive.go b/internal/provider/resource_nxos_vpc_keepalive.go index 0f70deb2..d61343ae 100644 --- a/internal/provider/resource_nxos_vpc_keepalive.go +++ b/internal/provider/resource_nxos_vpc_keepalive.go @@ -289,7 +289,7 @@ func (r *VPCKeepaliveResource) Delete(ctx context.Context, req resource.DeleteRe errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vpc_peerlink.go b/internal/provider/resource_nxos_vpc_peerlink.go index 50e3ee7b..7aa90111 100644 --- a/internal/provider/resource_nxos_vpc_peerlink.go +++ b/internal/provider/resource_nxos_vpc_peerlink.go @@ -190,7 +190,7 @@ func (r *VPCPeerlinkResource) Delete(ctx context.Context, req resource.DeleteReq errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vrf.go b/internal/provider/resource_nxos_vrf.go index 07ed1141..eeaa908e 100644 --- a/internal/provider/resource_nxos_vrf.go +++ b/internal/provider/resource_nxos_vrf.go @@ -204,7 +204,7 @@ func (r *VRFResource) Delete(ctx context.Context, req resource.DeleteRequest, re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vrf_address_family.go b/internal/provider/resource_nxos_vrf_address_family.go index 4d8204bb..0fb272f5 100644 --- a/internal/provider/resource_nxos_vrf_address_family.go +++ b/internal/provider/resource_nxos_vrf_address_family.go @@ -205,7 +205,7 @@ func (r *VRFAddressFamilyResource) Delete(ctx context.Context, req resource.Dele errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vrf_route_target.go b/internal/provider/resource_nxos_vrf_route_target.go index 16a039e1..b79aacde 100644 --- a/internal/provider/resource_nxos_vrf_route_target.go +++ b/internal/provider/resource_nxos_vrf_route_target.go @@ -232,7 +232,7 @@ func (r *VRFRouteTargetResource) Delete(ctx context.Context, req resource.Delete errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } 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 f7a176ef..37cd3c67 100644 --- a/internal/provider/resource_nxos_vrf_route_target_address_family.go +++ b/internal/provider/resource_nxos_vrf_route_target_address_family.go @@ -215,7 +215,7 @@ func (r *VRFRouteTargetAddressFamilyResource) Delete(ctx context.Context, req re errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vrf_route_target_direction.go b/internal/provider/resource_nxos_vrf_route_target_direction.go index d1c2d840..0c074b36 100644 --- a/internal/provider/resource_nxos_vrf_route_target_direction.go +++ b/internal/provider/resource_nxos_vrf_route_target_direction.go @@ -225,7 +225,7 @@ func (r *VRFRouteTargetDirectionResource) Delete(ctx context.Context, req resour errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } } diff --git a/internal/provider/resource_nxos_vrf_routing.go b/internal/provider/resource_nxos_vrf_routing.go index 927d1415..857e2a95 100644 --- a/internal/provider/resource_nxos_vrf_routing.go +++ b/internal/provider/resource_nxos_vrf_routing.go @@ -200,7 +200,7 @@ func (r *VRFRoutingResource) Delete(ctx context.Context, req resource.DeleteRequ errCode := res.Get("imdata.0.error.attributes.code").Str // Ignore errors of type "Cannot delete object" if errCode != "1" && errCode != "107" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err)) return } }