An automated provisioning script executes an HTTP request targeting a Cisco RESTCONF resource URI representing an interface configuration. The request payload includes only an updated description string. After execution, the interface description is updated, but all previously configured IP addressing and administrative state settings under that interface resource are completely cleared and reset to defaults. Which HTTP request method did the script use, and why did this data loss occur?
- HTTP PUT was used because it performs a complete replacement of the target resource, overwriting unreferenced fields with null or default values.Answer
- BHTTP POST was used because it creates a new child resource and flushes all existing parent attributes at the specified endpoint.
- CHTTP PATCH was used because it applies partial updates but forces unreferenced parameters to revert to default state.
- DHTTP GET was used because retrieving resource state automatically clears unspecified configuration parameters.
Answer
HTTP PUT was used because it performs a complete replacement of the target resource, overwriting unreferenced fields with null or default values.
In REST-based APIs (including Cisco RESTCONF and Cisco DNA Center APIs), HTTP PUT maps to replacing an existing resource in its entirety. When an API client sends an HTTP PUT request, the server expects a complete representation of the resource. If optional or unreferenced attributes (such as IP addressing or administrative status) are omitted from the PUT payload, the server replaces the current resource state with the new payload, causing omitted fields to be deleted or reset to default values. To selectively update only specific parameters while leaving unmentioned fields untouched, HTTP PATCH must be used.
Step-by-Step Solution
Key Concept
Operational differences between HTTP PUT (full resource replacement) and HTTP PATCH (partial resource modification) in REST-based network automation APIs.
Estimated Time:1m 30s