A network automation workflow uses RESTCONF to manage interface configurations on Cisco IOS XE routers. An engineer sends an HTTP PUT request to the URI endpoint of an existing interface resource (`.../ietf-interfaces:interfaces/interface=GigabitEthernet1`). The JSON payload included in the request contains only the updated `description` attribute and omits previously configured child attributes such as `ip` and `enabled`. Which outcome will occur on the target device when this request is processed?
- The interface description is updated, but any omitted attributes, such as the IP address configuration, are cleared or reset to their default values.Cevap
- BThe interface description is updated while all omitted attributes remain untouched on the device.
- CThe API server rejects the call with an HTTP 405 status code because modifying an existing resource requires HTTP POST.
- DA new secondary interface configuration object is created under the parent container without altering the existing interface.
Cevap
The interface description is updated, but any omitted attributes, such as the IP address configuration, are cleared or reset to their default values.
In REST-based APIs, HTTP PUT is defined as a full replacement operation (Update/Replace). When sending a PUT request to an existing resource URI, the server overwrites the entire target resource with the data provided in the request body. Any attributes omitted from the JSON payload will be removed or reset to default state. If partial updates are intended without affecting existing unmentioned attributes, HTTP PATCH must be used instead.
Adım Adım Çözüm
Anahtar Kavram
HTTP PUT vs PATCH Operational Differences in REST APIs