300-435 practice question 4 of 25
The automation engineer must replace device configuration using RESTCONF. How is this configured using the Python library Requests?
Full set: 125 questionsIn the RESTCONF protocol, the HTTP PUT method is used to completely replace the target data resource. If the resource exists, it is replaced; if it does not exist, it is created. The Python requests library directly maps HTTP methods to its functions. Therefore, to replace a device configuration, an automation engineer would use the requests.put() function to send a PUT request to the appropriate RESTCONF API endpoint with the new configuration in the request body.
A. delete(): This method corresponds to the HTTP DELETE verb, which is used to remove a resource, not replace it.
B. post(): This method corresponds to the HTTP POST verb, which is used to create a new data resource within a collection or to invoke an RPC.
D. patch(): This method corresponds to the HTTP PATCH verb, which is used to partially modify or merge data into an existing resource, not replace it entirely. ---
1. RFC 8040 - RESTCONF Protocol:
Section 4.5
"Replacing a Resource": "The PUT method is used to replace the target data resource... If the target resource exists
it is replaced. If the target resource does not exist
it is created." This section explicitly defines the role of the PUT method for resource replacement.
Section 4.4
"Creating a Resource": This section details the use of POST for creation.
Section 4.6
"Modifying a Resource": This section details the use of PATCH for partial modification.
Section 4.7
"Deleting a Resource": This section details the use of DELETE for removal.
2. Cisco IOS XE Programmability Configuration Guide
Cisco IOS XE 17.x:
Chapter: "RESTCONF Protocol"
Section: "RESTCONF Requests and Responses": This documentation confirms the standard HTTP method usage for RESTCONF on Cisco devices. It specifies that "To replace the contents of the resource identified by the target URI
use the PUT method."
3. Python Requests Library Official Documentation:
Section: "Quickstart"
Subsection: "Make a Request": The documentation shows the direct mapping of HTTP methods to function calls
stating: r = requests.put('https://httpbin.org/put'
data={'key':'value'}). This confirms put() is the function for an HTTP PUT request.
Keep practicing
Take the free 300-435 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 300-435 practice questions
- Question 1Which statement describe the difference between OpenConfig and native YANG data models?
- Question 3Which solution is used for automating the configuration of a device when it is first powe…
- Question 7What is a benefit of developing an application in a Python virtual environment?
- Question 10When accessing the /device-detail endpoint in cisco DNA Center, what is an acceptable sea…
- Question 11A network administrator must troubleshoot a network issue using Cisco DNA Center. Which A…
- Question 14Which function is available in NETCONF and unavailable is RESTCONF?
