Exam 350-401 All QuestionsBrowse all questions from this exam
Question 686

Refer to the exhibit.

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

    Correct Answer: A

    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
Vlad_Is_Love_uaOption: A

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

Steve122

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

COLONEL_MAJOR

programmer not the network engineer !!!!!

MegonOption: D

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

SeMo0o0oOption: A

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

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

msstanickOption: A

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