show inventory
show inventory
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show inventory ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_inv": {
"ROW_inv": [
{
"desc": "\"Nexus3500 C3548P-10GX Chassis\"",
"name": "\"Chassis\"",
"productid": "N3K-C3548P-10GX",
"serialnum": "FOC1847R05N",
"vendorid": "V00"
},
{
"desc": "\"48x10GE Supervisor\"",
"name": "\"Slot 1\"",
"productid": "N3K-C3548P-10GX",
"serialnum": "FOC18501B5S",
"vendorid": "V00"
},
{
"desc": "\"Nexus3500 C3548P-10GX Chassis Power Supply\"",
"name": "\"Power Supply 1\"",
"productid": "N2200-PAC-400W",
"serialnum": "DTN1847P1LT",
"vendorid": "V05"
},
{
"desc": "\"Nexus3500 C3548P-10GX Chassis Power Supply\"",
"name": "\"Power Supply 2\"",
"productid": "N2200-PAC-400W",
"serialnum": "DTN1847P1MG",
"vendorid": "V05"
},
{
"desc": "\"Nexus3500 C3548P-10GX Chassis Fan Module\"",
"name": "\"Fan 1\"",
"productid": "NXA-FAN-30CFM-F",
"serialnum": "N/A",
"vendorid": "V00"
},
{
"desc": "\"Nexus3500 C3548P-10GX Chassis Fan Module\"",
"name": "\"Fan 2\"",
"productid": "NXA-FAN-30CFM-F",
"serialnum": "N/A",
"vendorid": "V00"
},
{
"desc": "\"Nexus3500 C3548P-10GX Chassis Fan Module\"",
"name": "\"Fan 3\"",
"productid": "NXA-FAN-30CFM-F",
"serialnum": "N/A",
"vendorid": "V00"
},
{
"desc": "\"Nexus3500 C3548P-10GX Chassis Fan Module\"",
"name": "\"Fan 4\"",
"productid": "NXA-FAN-30CFM-F",
"serialnum": "N/A",
"vendorid": "V00"
}
]
}
},
"code": "200",
"input": "show inventory ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show inventory command, see the CLI command reference:
| CLI Output |
|---|
|