show spanning-tree vlan 10
show spanning-tree vlan 10
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 spanning-tree vlan 10 ",
"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": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show spanning-tree vlan 10 ",
"msg": "Success",
"code": "200",
"body": {
"TABLE_tree": {
"ROW_tree": {
"tree_id": "10",
"tree_tree_type": "vlan",
"tree_protocol": "rstp",
"port_count": "9",
"bridge_mac": "0023.04ee.be64",
"bridge_priority": "32778",
"tree_designated_root": "0023.04ee.c1e8",
"tree_designated_root_priority": "4106",
"stp_active": "enabled",
"root_path_cost": "2",
"root_port_if_index": "port-channel100",
"root_port_priority": "128",
"root_port_number": "4195",
"topology_change": "false",
"topology_change_detected": "false",
"topology_change_count": "0",
"topology_change_time_since_last": "35446",
"tc_initiator_if_index": null,
"bridge_forward_delay": "15",
"bridge_max_age": "20",
"bridge_hello_time": "2",
"max_age": "20",
"hello_time": "2",
"forward_delay": "15",
"hold_time": "1",
"hello_timer": "0",
"topology_change_timer": "0",
"tcn_timer": "0",
"aging_timer": "0",
"disabled": "0",
"blocking": "0",
"listening": "0",
"learning": "0",
"forwarding": "9",
"invalid": "0",
"TABLE_port": {
"ROW_port": {
"if_index": "port-channel1"
}
}
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show spanning-tree vlan 10 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show spanning-tree mst configuration
show spanning-tree mst configuration
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 spanning-tree mst configuration ",
"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": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show spanning-tree mst configuration ",
"msg": "Success",
"code": "200",
"body": {
"stp-mode": "mst",
"name": null,
"rev-id": "0",
"Instance_to_vlan_map": {
"mst_id": "0",
"vlan_bit_map": "1-4094"
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show spanning-tree mst configuration command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|