nerdexam
Cisco

300-435 · Question #61

Refer to the exhibit. Cisco SD-WAN deployment must be troubleshooted using vManage APIs. A call to vEdge Hardware Health API returns the data in the exhibit (only a portion is shown). If this JSON…

The correct answer is D. d['data'][0]['statusList'][0]['status']. To access a specific "status" field in a nested JSON structure from a vManage API response, Python dictionary indexing is used to navigate through lists and keys to the desired element.

Controller-Based Network Automation

Question

Refer to the exhibit. Cisco SD-WAN deployment must be troubleshooted using vManage APIs. A call to vEdge Hardware Health API returns the data in the exhibit (only a portion is shown). If this JSON is converted to a Python dictionary and assigned to the variable "d", how is the status is accessed that is indicated on line 16?

Options

  • Ad['data'][0]['statusList'][0]['status']
  • Bd['data'][1]['statusList'][0]['status']
  • Cd['data'][0]['statusList'][0]['status']
  • Dd['data'][0]['statusList'][0]['status']

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    6% (3)
  • C
    12% (6)
  • D
    78% (39)

Why each option

To access a specific "status" field in a nested JSON structure from a vManage API response, Python dictionary indexing is used to navigate through lists and keys to the desired element.

Ad['data'][0]['statusList'][0]['status']

This choice is identical to the correct answer D and is technically correct based on the structure implied, suggesting a potential issue with the question's options.

Bd['data'][1]['statusList'][0]['status']

d['data'][1]['statusList'][0]['status'] would attempt to access the second element of the 'data' list, which would be incorrect if the target status is in the first element.

Cd['data'][0]['statusList'][0]['status']

This choice is identical to the correct answer D and is technically correct based on the structure implied, suggesting a potential issue with the question's options.

Dd['data'][0]['statusList'][0]['status']Correct

Assuming the exhibit shows the "status" value on line 16 is located within the first element of the 'data' array and then within the first element of the 'statusList' array, d['data'][0]['statusList'][0]['status'] correctly accesses this specific value. Python's dictionary and list indexing allows precise navigation through complex JSON data structures.

Concept tested: Python dictionary and JSON parsing

Topics

#JSON parsing#Python dictionary access#API data handling#vManage API

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice