300-435 Question 4
Single answerAs a network engineer, you want to automate the configuration of multiple Cisco devices in your enterprise network. You decide to use Python and the Cisco REST API to achieve this. During your implementation, you realize that you need to retrieve operational data such as interface statuses and device health metrics. Which of the following methods would be the most appropriate for this task?
- A
Use a GET request to the Cisco RESTCONF API with the appropriate YANG model
- B
Use a POST request to the Cisco RESTCONF API to retrieve the required data
- C
Leverage SNMP to poll the devices for operational data
- D
Use a Python script with direct SSH to the devices to retrieve the data
Show answer and explanation
Correct answer: A
Explanation
The Cisco RESTCONF API, combined with the YANG model, provides a standardized and efficient way to retrieve operational and configuration data from Cisco devices. A GET request is specifically designed to fetch data, making it the most appropriate method for this task in a network programmability context.
- A. Correct.
Using a GET request to the Cisco RESTCONF API is the correct approach for retrieving operational data as it aligns with the REST API's design principles for data retrieval. The YANG model provides the schema for accessing operational and configuration data.
- B. Incorrect.
POST requests are used to create or modify resources, not to retrieve data. Using POST for retrieving data would be incorrect in this context.
- C. Incorrect.
While SNMP can retrieve operational data, it is not aligned with the modern programmability approach emphasized in this exam. Cisco RESTCONF API is the preferred method.
- D. Incorrect.
Using a Python script with direct SSH could retrieve the data, but it is not as efficient or scalable as using the REST API. It also lacks the standardization provided by RESTCONF and YANG models.