show port-channel summary
show port-channel summary
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 port-channel summary ",
"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_channel": {
"ROW_channel": {
"TABLE_member": {
"ROW_member": [
{
"port": "Ethernet1/47",
"port-status": "P"
},
{
"port": "Ethernet1/48",
"port-status": "P"
}
]
},
"group": "47",
"layer": "S",
"port-channel": "port-channel47",
"prtcl": "LACP",
"status": "U",
"type": "Eth"
}
}
},
"code": "200",
"input": "show port-channel summary ",
"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 port-channel summary command, see the CLI command reference:
| CLI Output |
|---|
|
show port-channel traffic
show port-channel traffic
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 port-channel traffic ",
"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_channel": {
"ROW_channel": [
{
"chanId": "47",
"port": "Ethernet1/47",
"rx-bcst": "0.0",
"rx-mcst": "49.62",
"rx-ucst": "0.02",
"tx-bcst": "0.0",
"tx-mcst": "19.09",
"tx-ucst": "50.01"
},
{
"chanId": "47",
"port": "Ethernet1/48",
"rx-bcst": "100.00",
"rx-mcst": "50.37",
"rx-ucst": "99.97",
"tx-bcst": "0.0",
"tx-mcst": "80.90",
"tx-ucst": "49.98"
}
]
}
},
"code": "200",
"input": "show port-channel traffic ",
"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 port-channel traffic command, see the CLI command reference:
| CLI Output |
|---|
|