300-435 exam dumps

300-435 practice question 259 of 322

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

300-435 Question 259

Single answer

You are tasked with automating the retrieval of device information from a Cisco SD-WAN vManage instance using its REST API. Which Python script snippet correctly performs an API GET request to fetch the device list and handles authentication using a generated session token?

  1. A

    import requests url = 'https://vmanage.example.com/dataservice/device' headers = {'Authorization': 'Bearer session_token'} response = requests.get(url, headers=headers) print(response.json())

  2. B

    import requests url = 'https://vmanage.example.com/dataservice/device' data = {'Authorization': 'Bearer session_token'} response = requests.post(url, json=data) print(response.json())

  3. C

    import requests url = 'https://vmanage.example.com/dataservice/device' headers = {'Authorization': 'Basic session_token'} response = requests.get(url, headers=headers) print(response.json())

  4. D

    import requests url = 'https://vmanage.example.com/dataservice/device' headers = {'Authorization': 'Bearer session_token'} response = requests.get(url) print(response.text)

Show answer and explanation

Correct answer: A

Explanation

The correct implementation to fetch the device list from Cisco SD-WAN vManage involves using the HTTP GET method, passing the session token in the 'Authorization' header as 'Bearer', and correctly parsing the JSON response. This ensures proper authentication and interaction with the vManage REST API.

  • A. Correct.

    This is the correct implementation. It uses the proper HTTP GET method, includes the session token in the 'Authorization' header, and retrieves the JSON response correctly.

  • B. Incorrect.

    This is incorrect because it uses the POST method instead of GET, which is not suitable for retrieving information in this context.

  • C. Incorrect.

    This is incorrect because it uses 'Basic' authentication instead of 'Bearer', which is not how session tokens are typically handled in Cisco SD-WAN vManage.

  • D. Incorrect.

    This is incorrect because it does not include the 'Authorization' header in the GET request, resulting in an unauthorized error.

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