350-901 · Question #85
Refer to the exhibit. An engineer needs to change the IP address via RESTCONF on interface GigabitEthernet2. An error message is received when the script is run. Which amendment to the code will…
The correct answer is A. Change POST to PATCH. To modify an existing configuration attribute like an IP address on an interface using RESTCONF, the HTTP PATCH method should be used to apply a partial update to the resource.
Question
Options
- AChange POST to PATCH.
- BIssue a DELETE before PATCH.
- CIssue a DELETE before POST.
- DChange POST to GET
How the community answered
(38 responses)- A89% (34)
- B3% (1)
- C5% (2)
- D3% (1)
Why each option
To modify an existing configuration attribute like an IP address on an interface using RESTCONF, the HTTP PATCH method should be used to apply a partial update to the resource.
The PATCH HTTP method is specifically designed for applying partial modifications to an existing resource, such as changing an IP address on an interface. Using PATCH allows for updating specific data nodes within a YANG model without requiring a full replacement of the resource.
Issuing a DELETE before PATCH would remove the configuration entirely before attempting to modify it, which is not the intended action to simply change an IP address.
Issuing a DELETE before POST would remove and then attempt to create a new resource, but POST is for creation, not modification of an existing IP address.
GET is used to retrieve resource data and does not perform any modification to the configuration.
Concept tested: RESTCONF HTTP methods for configuration updates
Source: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_support.html#C_RESTCONF_VERBS
Topics
Community Discussion
No community discussion yet for this question.