DEVASC Exam QuestionsBrowse all questions from this exam

DEVASC Exam - Question 377


Refer to the exhibit. An engineer prepares a script to automate workflow by using Cisco DNA Center APIs to display:

• total count of devices

• list of the network devices

• information of one device with a hostname filter

What is displayed in the final step after the Python script is executed?

Show Answer
Correct Answer: A

In the final step, the script retrieves information about one device by its ID that was returned from the previous step. This ID comes from the response list generated by the devices_test function, which filters devices based on the hostname and platformId. The devices_info function in the last step specifically fetches information for the device whose ID is the first item in that filtered list. Hence, the information displayed is about a particular device, not a list or filtered results.

Discussion

4 comments
Sign in to comment
outrageous7
Jul 2, 2023

isn't it A since it doesn't specify hostname in the step before?

Woonesuf
Aug 15, 2023

I agree. Answer 'A'. Hostname is specified in the other step. A list of devices is generated during the request, but "response[0]" indicates only return information about the first result.

act111
Nov 29, 2023

But the question is about "final step". And in the final step a list of devices from C9500-40x platform is displayed. So it's D.

daniii89
Feb 6, 2025

Nop... The first device ID from this response is extracted and used to call devices_info(headers, response[0]['id']).

GhneumaOption: A
Jun 23, 2024

The function devices_test() is called in line 31. The function returns the object response.json()['response'] which is a list of dictionaries. Each dictionary represents a device managed by DNAC. The function devices_info(headers, response[0]['id'])) in line 32 retrieves device info for the first device in the list of devices managed by DNAC.