350-401 Exam QuestionsBrowse all questions from this exam

350-401 Exam - Question 686


Refer to the exhibit.

How should the programmer access the list of VLANs that were received via the API call?

Show Answer
Correct Answer: AD

To access the list of VLANs received via the API call, the programmer should reference the 'response' key in the VlanNames dictionary. This is because the response from the API call is stored in a dictionary format, with 'response' being the key that holds the list of VLANs. Therefore, using VlanNames['response'] will return the list of VLANs.

Discussion

5 comments
Sign in to comment
Vlad_Is_Love_uaOption: A
Mar 1, 2023

>>> VlanNames = {'response':['vlan1','vlan2','vlan3'],'version':'1.0'} >>> VlanNames['response'] ['vlan1', 'vlan2', 'vlan3']

Steve122
Jul 10, 2024

VlanNames -> Dictionary response -> Key ['vlan1','vlan2','vlan3'] -> Value

COLONEL_MAJOR
Jan 27, 2024

programmer not the network engineer !!!!!

msstanickOption: A
Jun 23, 2023

As stated by Vlad already it is A. I got it labbed with Cisco's sandbox. url1 = "https://sandboxdnac.cisco.com/dna/intent/api/v1/topology/vlan/vlan-names" VlanNames = requests.get(url=url1, headers=headers, verify=False).json() print("\n\n",VlanNames['response']) ['Vlan1', 'Vlan101'] Process finished with exit code 0

SeMo0o0oOption: A
Jun 7, 2024

It´s A The key 'response' contains the list of VLANs. To access this list, we need to use the key 'response' on the VlanNames dictionary.

SeMo0o0o
Jun 21, 2024

...........................

MegonOption: D
Jul 19, 2024

VLAnNames is already a variable with value from the returned API calls so and print function showed it so to have access to it just list(VlanNames) will show it