I am pulling out a collection of devices that are downed on our network.
I am running:
rjson = r.json()
print(json.dumps(rjson, indent = 5))
And it returns:
{
"paging": {
"size": 13
},
"data": {
"devices": [
{
"hostName": "host_1",
"networkAddress": "111.111.111.111",
"bestState": "Down",
"worstState": "Down",
},
{
"hostName": "host_2",
"networkAddress": "111.111.111.111",
"bestState": "Down",
"worstState": "Down",
},
{
"hostName": "host_3",
"networkAddress": "111.111.111.111",
"bestState": "Down",
"worstState": "Down",
},
I would like to run though this json and create a list with each hostName that is returned. How would I do this?