A team is adding a new lab subnet to Catalyst Center and wants one script that starts discovery and then reads the inventory back. It must wait for the job to finish and report each device's hostname, platformId and softwareVersion. Which API sequence starts discovery, waits for the task, and returns those three fields?
Select an answer to reveal the explanation.
Short Explanation
Start discovery with POST /dna/intent/api/v1/discovery, then poll its task ID until it finishes—like waiting for a package to arrive before opening it. Next, call GET /dna/intent/api/v1/network-device to retrieve each device’s hostname, platformId, and softwareVersion.
Full Explanation
The correct sequence uses Catalyst Center’s asynchronous discovery workflow: POST the subnet, addresses, and credentials to /dna/intent/api/v1/discovery, then use the returned task ID to poll until the task completes. Discovery does not return the device inventory directly; after completion, GET /dna/intent/api/v1/network-device to retrieve device records, including hostname, platformId, and softwareVersion. This separates the operation that finds devices from the endpoint that reports inventory, and waiting for completion ensures the inventory read occurs after discovery has finished. The immediate-read approach fails because it queries inventory without waiting, so discovery may still be running and the new devices may not yet appear. The per-device creation approach fails conceptually because POST /dna/intent/api/v1/network-device adds devices individually; it does not perform subnet discovery. The reduced-field reporting approach does wait and read inventory, but printing only hostname and management address omits the required platformId and softwareVersion. Exam caveat: poll at a paced interval rather than sending requests continuously. Practical check: confirm the task reports completion, then verify each returned device record contains all three requested fields before reporting results.