350-401 · Question #512
Refer to the exhibit. Which code results in the working Python script displaying a list of network devices from the Cisco DNA Center?
The correct answer is B. login = dnac_login(dnac["host"], dnac["username"], dnac["password"]). To display a list of network devices from Cisco DNA Center using a Python script, the essential first step is to authenticate and establish a session.
Question
Refer to the exhibit. Which code results in the working Python script displaying a list of network devices from the Cisco DNA Center?
Exhibits
Options
- Anetwork_device_list(dnac["host"], dnac["username"],dnac["password"])
- Blogin = dnac_login(dnac["host"], dnac["username"], dnac["password"])
- Clogin = dnac_login(dnac["host"], dnac["username"], dnac["password"])
- Dnetwork_device_list(dnac["host"], dnac["username"], dnac["password"])
How the community answered
(41 responses)- A5% (2)
- B80% (33)
- C12% (5)
- D2% (1)
Why each option
To display a list of network devices from Cisco DNA Center using a Python script, the essential first step is to authenticate and establish a session.
The `network_device_list` function would typically retrieve the list of devices, but attempting to call it without first performing an authentication step would result in an unauthorized access error.
The `dnac_login` function is responsible for authenticating with the Cisco DNA Center API using the provided host, username, and password. Establishing a successful login session and obtaining an authentication token or session object is a mandatory prerequisite before any subsequent API calls, such as fetching a list of network devices, can be made.
This option is identical to option B, which is the correct choice, but the prompt designates B as the distinct correct answer.
Similar to option A, calling `network_device_list` directly without an established authenticated session would fail to retrieve device information.
Concept tested: Cisco DNA Center API authentication
Source: https://developer.cisco.com/dnac/
Topics
Community Discussion
No community discussion yet for this question.

