300-435 Question 247
Select 3You are tasked with automating the retrieval of device information from a Cisco SD-WAN vManage instance using its REST API. The Python script needs to authenticate with the vManage API, retrieve a list of devices, and print their hostnames. Which of the following steps must be included in your Python script to achieve this functionality?
- A
Send a POST request to the /j_security_check endpoint with valid credentials to establish a session.
- B
Send a GET request to the /device endpoint to retrieve the list of devices.
- C
Include the authentication token in the headers of all subsequent API requests.
- D
Parse the JSON response from the /device endpoint to extract the hostnames.
- E
Use the /template endpoint instead of /device to retrieve device hostnames.
Show answer and explanation
Correct answers: A, C, D
Explanation
To automate the retrieval of device information from Cisco SD-WAN vManage, the script needs to authenticate via the /j_security_check endpoint, use the correct endpoint for device data retrieval (e.g., /dataservice/device), include the session token in subsequent requests, and parse the JSON response to extract the required details. Misusing endpoints or omitting critical steps like authentication and response parsing will result in script failure.
- A. Correct.
Correct: To authenticate with the vManage API, a POST request to the /j_security_check endpoint with valid credentials is required to initiate a session.
- B. Incorrect.
Incorrect: The /device endpoint does not exist in the vManage API. The correct endpoint for device list retrieval is /dataservice/device.
- C. Correct.
Correct: After authenticating, the session token (if required) must be included in the headers for subsequent requests.
- D. Correct.
Correct: The JSON response from the /dataservice/device endpoint must be parsed to extract specific information, such as device hostnames.
- E. Incorrect.
Incorrect: The /template endpoint is used for configuration templates, not for retrieving device information like hostnames.