Exam 350-401 | Question id=5709 | Automation |
Based on the output below, which Python code shows the value of the “upTime” key?
{
"response" [{
"family": "Routers",
"type": "Cisco ASR 1001-X Router",
"errorCode": null,
"location" null,
"macAddress": "00:c8:8b:80:bb:00",
"hostname": "asr1001-x.abc.inc",
"role": "BORDER ROUTER",
"lastUpdateTime": 1577391368518,
"serialNumber": "FXS1932Q1SE",
"softwareeVersion": "16.3.2",
"locationName": nul,
"upTime": "49 days, 13:43:44:13",
"lastUpdated": "2019-12-22 14:55:23"
}]
}
A. |
json_data = response.json() print(json_data['response'][0]['upTime']) | |
B. |
json_data = response.json() print(json_data[response][0][upTime]) | |
C. |
json_data = json.loads(response.text) print(json_data['response']['family']['upTime']) | |
D. |
json_data = response.json() print(json_data['response'][family]['upTime']) |