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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show spanning-tree vlan 10

VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    4106
             Address     0023.04ee.c1e8
             Cost        2
             Port        4195 (port-channel100)
             Hello Time  2  sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)
             Address     0023.04ee.be64
             Hello Time  2  sec  Max Age 20 sec  Forward Delay 15 sec

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Po1              Desg FWD 1         128.4096 (vPC) Edge P2p 
Po2              Desg FWD 1         128.4097 (vPC) Edge P2p 
Po5              Desg FWD 1         128.4100 (vPC) Edge P2p 
Po6              Desg FWD 1         128.4101 (vPC) Edge P2p 
Po7              Desg FWD 1         128.4102 (vPC) Edge P2p 
Po21             Desg FWD 2         128.4116 Edge P2p 
Po50             Root FWD 1         128.4145 (vPC) P2p 
Po100            Root FWD 1         128.4195 (vPC peer-link) Network P2p 
Eth1/45          Desg FWD 2         128.177  Edge P2p 


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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show spanning-tree mst configuration 
Name      []
Revision  0     Instances configured 1
Instance  Vlans mapped
--------  ---------------------------------------------------------------------
0         1-4094
-------------------------------------------------------------------------------