I'm retrieving JSON data through NAPALM, it outputs quite alot of data and I want to be able to print only a few elements from it. My current code is;
from napalm import get_network_driver
import json
import paramiko
driver = get_network_driver('nxos_ssh')
LD9AGGSW01 = driver('10.249.9.44', 'username', 'password',)
LD9AGGSW01.open()
json_data = LD9AGGSW01.get_facts()
print(json.dumps(json_data, indent=4))
and the JSON data i get back is;
{
"uptime": 58404121,
"vendor": "Cisco",
"os_version": "7.0(3)I3(1)",
"serial_number": "FDO211410B8",
"model": "Nexus9000 C92160YC-X chassis",
"hostname": "Nexus-Switch-01",
"fqdn": "",
"interface_list": [
"mgmt0",
"Ethernet1/1",
"Ethernet1/2",
]
}
How would I pass through things such as the "model","hostname data" and "mgmt0" only to a print function?
print(json_data)look like?type(json_data)?