nerdexam
CiscoCisco

200-901 · Question #617

200-901 Question #617: Real Exam Question with Answer & Explanation

The correct answer is C: restconf. The Python script uses RESTCONF to programmatically communicate with network devices via HTTP-based REST calls, saving device configurations through standard HTTP methods against YANG-modeled data.

Understanding and Using APIs

Question

Refer to the exhibit. A network engineer is creating a Python script to programmatically save network device configurations. Which code snippet must be placed onto the blank in the code?

Options

  • Aself.save
  • B{self.headers}
  • Crestconf
  • Dnetconf

Explanation

The Python script uses RESTCONF to programmatically communicate with network devices via HTTP-based REST calls, saving device configurations through standard HTTP methods against YANG-modeled data.

Common mistakes.

  • A. self.save is not a recognized protocol identifier or URL path component - it references a Python instance method name and has no meaning in the context of constructing a RESTCONF or NETCONF request URL.
  • B. {{self.headers}} is a Jinja2-style template placeholder for HTTP request headers, not a protocol path segment - headers are passed as a separate parameter to the HTTP request function, not embedded in the URL.
  • D. NETCONF uses XML-encoded RPCs transported over SSH on port 830, requiring the ncclient library and a completely different code structure than an HTTP-based REST call, so it cannot be substituted into a REST URL path.

Concept tested. RESTCONF API path construction in Python scripts

Reference. https://developer.cisco.com/docs/restconf/

Topics

#RESTCONF#Network Automation#Configuration Management#APIs

Community Discussion

No community discussion yet for this question.

Full 200-901 PracticeBrowse All 200-901 Questions