300-435 Question 251
Single answerYou are tasked with creating a Python script to retrieve the hostname and serial number of all devices managed by Cisco DNA Center using the Inventory API. Which API endpoint and method should you use to achieve this?
- A
GET /dna/intent/api/v1/network-device
- B
POST /dna/intent/api/v1/network-device
- C
GET /dna/intent/api/v1/topology/site-topology
- D
GET /dna/intent/api/v1/device-health
Show answer and explanation
Correct answer: A
Explanation
The Cisco DNA Center Inventory API provides device-level information using the 'GET /dna/intent/api/v1/network-device' endpoint. This endpoint is designed to retrieve detailed records of all network devices in the inventory, including information such as hostname, serial number, management IP, and more. The other options either utilize the wrong HTTP method or target endpoints that do not provide the requested inventory data.
- A. Correct.
Correct: This is the appropriate endpoint and method to use when retrieving detailed information about network devices, including hostname and serial number.
- B. Incorrect.
Incorrect: POST is used to create resources or trigger actions, not retrieve data. A GET method is required for fetching device details.
- C. Incorrect.
Incorrect: This endpoint is used for retrieving site topology information, not device-specific data such as hostname or serial number.
- D. Incorrect.
Incorrect: This endpoint provides device health metrics, not inventory details like hostname or serial number.