350-901 · Question #69
Refer to the exhibit above and click on the resource tabs in the top left corner to view resources to help with this question. Drag and drop the correct code snippets from the left onto the item…
This question tests your ability to construct a valid CURL command that uses the RESTCONF protocol to update (modify) an interface configuration on a Cisco IOS XE device. It covers the required HTTP method, headers, URL structure, and authentication syntax specific to RESTCONF.
Question
Explanation
This question tests your ability to construct a valid CURL command that uses the RESTCONF protocol to update (modify) an interface configuration on a Cisco IOS XE device. It covers the required HTTP method, headers, URL structure, and authentication syntax specific to RESTCONF.
Approach. To update an interface via RESTCONF with CURL, you must use the HTTP PATCH method (-X PATCH) to partially modify an existing resource, or PUT to fully replace it. The Content-Type and Accept headers must both be set to 'application/yang-data+json' (or +xml). The RESTCONF URL follows the pattern: https://{device-ip}/restconf/data/ietf-interfaces:interfaces/interface={InterfaceName}. Authentication is provided with -u admin:password, and -k is typically used to skip SSL certificate verification in lab environments. A complete example: curl -k -u admin:Cisco123 -X PATCH -H 'Content-Type: application/yang-data+json' -H 'Accept: application/yang-data+json' -d '{...payload...}' 'https://10.10.20.48/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1'.
Concept tested. RESTCONF (RFC 8040) interface configuration via CURL on Cisco IOS XE - specifically the correct HTTP method (PATCH vs PUT vs POST), required YANG-data JSON headers (Content-Type and Accept), RESTCONF URL path structure using ietf-interfaces YANG model, and basic authentication syntax within a CURL command.
Reference. Cisco DevNet: RESTCONF API on IOS XE - https://developer.cisco.com/docs/ios-xe/#!restconf; RFC 8040 (RESTCONF Protocol); IETF RFC 7950 (YANG 1.1 Data Modeling Language)
Topics
Community Discussion
No community discussion yet for this question.