200-901 · Question #477
Refer to the exhibit. A software engineer needs to collect data about devices that are registered in Cisco DNA Center using the API. Before collecting the data, the engineer must obtain a token and…
The correct answer is A. get(uri,headers = headers,data={}, verify-True). Retrieving device inventory data from the Cisco DNA Center API requires an HTTP GET request with SSL verification enabled for secure communication.
Question
Refer to the exhibit. A software engineer needs to collect data about devices that are registered in Cisco DNA Center using the API. Before collecting the data, the engineer must obtain a token and authenticate with the API. To automate the procedure, a Python script is used. Which code snippet must be placed onto the blank in the code?
Exhibit
Options
- Aget(uri,headers = headers,data={}, verify-True)
- Bpost(uri,headers=headers,data={}, verify=False)
- Cget(uri,headers= headers,data={}, verify=False)
- Dpost(uri,headers=headers,data={"Basic"}, verify=False)
How the community answered
(30 responses)- A83% (25)
- B3% (1)
- C7% (2)
- D7% (2)
Why each option
Retrieving device inventory data from the Cisco DNA Center API requires an HTTP GET request with SSL verification enabled for secure communication.
Fetching device data from the Cisco DNA Center inventory API uses an HTTP GET request because GET is the correct HTTP method for reading or retrieving resources without side effects. Using 'verify=True' enforces SSL certificate validation, which is the recommended secure practice when making API calls against a production DNA Center controller.
POST is used to create or submit data (such as requesting an auth token), not to retrieve existing device records from the DNA Center inventory API endpoint.
GET is the correct method, but 'verify=False' disables SSL certificate validation, which introduces a security risk by allowing man-in-the-middle attacks and is not recommended for production use.
Passing a literal 'Basic' string as the request body data is incorrect; Basic Auth credentials are encoded in the Authorization request header, not the body, and POST is not the appropriate method for data retrieval.
Concept tested: Cisco DNA Center REST API GET request with SSL verification
Source: https://developer.cisco.com/docs/dna-center/#!cisco-dna-2-3-7-x-api-overview
Topics
Community Discussion
No community discussion yet for this question.
