300-435 exam dumps

300-435 practice question 260 of 322

Automating Cisco Enterprise Solutions. Professional level, Cisco. Free question with the correct answer and a full explanation.

300-435 Question 260

Select 3

You are tasked with retrieving operational data from Cisco SD-WAN vManage using its REST API. You write a Python script to authenticate to the vManage API and fetch the list of all devices in the network. Which of the following steps are required to perform this task successfully?

  1. A

    Use the 'requests' library in Python to send an HTTP POST request for authentication to vManage's '/j_security_check' endpoint.

  2. B

    Parse the 'JSESSIONID' cookie from the authentication response and include it in the headers of subsequent requests.

  3. C

    Send an HTTP GET request to the '/dataservice/device' endpoint to retrieve the list of devices.

  4. D

    Include the API token in the body of the GET request instead of the headers.

  5. E

    Set the Content-Type header to 'application/json' for all requests to the vManage API.

Show answer and explanation

Correct answers: A, B, C

Explanation

To interact with the Cisco SD-WAN vManage API using Python, you must first authenticate by sending a POST request to the '/j_security_check' endpoint and retrieve the 'JSESSIONID' cookie. This cookie is then included in the headers of subsequent API requests, such as a GET request to the '/dataservice/device' endpoint to fetch the list of devices. Proper understanding of authentication and request formatting is crucial for successful automation with the vManage API.

  • A. Correct.

    Correct. To authenticate to vManage, you need to send an HTTP POST request to the '/j_security_check' endpoint using the 'requests' library, as this is the standard method for obtaining a session cookie.

  • B. Correct.

    Correct. The 'JSESSIONID' cookie from the authentication response must be extracted and included in the headers of subsequent API requests to maintain the session.

  • C. Correct.

    Correct. To retrieve the list of devices, you send an HTTP GET request to the '/dataservice/device' endpoint, which provides the required operational data.

  • D. Incorrect.

    Incorrect. The API token or session cookie must be included in the headers, not in the body of the GET request.

  • E. Incorrect.

    Incorrect. While 'application/json' is commonly used for POST or PUT requests, it is not a strict requirement for GET requests in the vManage API unless explicitly stated.

Timed practice exam

Take a 300-435 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam