diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a6d083a..bf868ed7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## 0.5.6 (unreleased) - Fix value range of `ebgp_multihop_ttl` attribute of `nxos_bgp_peer` resource +- Add `nxos_feature_ngmvpn` resource and data source +- Fix issue when updating `nxos_ipv4_access_list_entry` resource, [link](https://github.com/CiscoDevNet/terraform-provider-nxos/issues/204) ## 0.5.5 diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index aa2c5131..1be62a19 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -10,6 +10,8 @@ description: |- ## 0.5.6 (unreleased) - Fix value range of `ebgp_multihop_ttl` attribute of `nxos_bgp_peer` resource +- Add `nxos_feature_ngmvpn` resource and data source +- Fix issue when updating `nxos_ipv4_access_list_entry` resource, [link](https://github.com/CiscoDevNet/terraform-provider-nxos/issues/204) ## 0.5.5 diff --git a/internal/provider/model_nxos_feature_ngmvpn.go b/internal/provider/model_nxos_feature_ngmvpn.go index 47feefec..c82712ee 100644 --- a/internal/provider/model_nxos_feature_ngmvpn.go +++ b/internal/provider/model_nxos_feature_ngmvpn.go @@ -40,9 +40,12 @@ func (data FeatureNgMVPN) getClassName() string { return "fmNgmvpn" } -func (data FeatureNgMVPN) toBody() nxos.Body { +func (data FeatureNgMVPN) toBody(statusReplace bool) nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) + if statusReplace { + body, _ = sjson.Set(body, data.getClassName()+".attributes."+"status", "replaced") + } if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", data.AdminState.ValueString()) } diff --git a/internal/provider/resource_nxos_feature_ngmvpn.go b/internal/provider/resource_nxos_feature_ngmvpn.go index 386691df..e29cbc55 100644 --- a/internal/provider/resource_nxos_feature_ngmvpn.go +++ b/internal/provider/resource_nxos_feature_ngmvpn.go @@ -102,7 +102,7 @@ func (r *FeatureNgMVPNResource) Create(ctx context.Context, req resource.CreateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getDn())) // Post object - body := plan.toBody() + body := plan.toBody(false) _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to post object, got error: %s", err)) @@ -164,7 +164,8 @@ func (r *FeatureNgMVPNResource) Update(ctx context.Context, req resource.UpdateR tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.getDn())) - body := plan.toBody() + body := plan.toBody(false) + _, err := r.clients[plan.Device.ValueString()].Post(plan.getDn(), body.Str) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err)) diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index aa2c5131..1be62a19 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -10,6 +10,8 @@ description: |- ## 0.5.6 (unreleased) - Fix value range of `ebgp_multihop_ttl` attribute of `nxos_bgp_peer` resource +- Add `nxos_feature_ngmvpn` resource and data source +- Fix issue when updating `nxos_ipv4_access_list_entry` resource, [link](https://github.com/CiscoDevNet/terraform-provider-nxos/issues/204) ## 0.5.5