300-435 Question 246
Single answerYou are tasked with writing a Python script to retrieve the list of devices managed by a Cisco SD-WAN vManage instance using its REST API. Which API request and Python library are correctly used to fetch the device information?
- A
Use the 'GET /device' endpoint with the 'requests' library to retrieve device information.
- B
Use the 'POST /devices' endpoint with the 'requests' library to retrieve device information.
- C
Use the 'GET /dataservice/device' endpoint with the 'requests' library to retrieve device information.
- D
Use the 'GET /devices' endpoint with the 'json' library to retrieve device information.
Show answer and explanation
Correct answer: C
Explanation
To retrieve device information from Cisco SD-WAN vManage using its REST API, the correct endpoint is '/dataservice/device', which is accessed using the HTTP 'GET' method. The 'requests' library is the standard Python library for making HTTP requests. Therefore, the correct combination is using the 'GET /dataservice/device' endpoint with the 'requests' library.
- A. Incorrect.
This is incorrect because the endpoint '/device' does not exist in the Cisco SD-WAN vManage REST API. The correct endpoint is '/dataservice/device'.
- B. Incorrect.
This is incorrect because 'POST' is not used to retrieve data in REST APIs. 'GET' is the correct HTTP method to fetch information.
- C. Correct.
This is correct because the endpoint '/dataservice/device' is the appropriate REST API endpoint to retrieve device information in Cisco SD-WAN vManage, and the 'requests' library is commonly used for making HTTP requests in Python.
- D. Incorrect.
This is incorrect because the endpoint '/devices' is invalid and the 'json' library is not used for making HTTP requests. Instead, the 'json' library is used for working with JSON data.