show topology
show topology
import requests
import json
"""
Modify these please
"""
url='http://<ip_address>:<port_number>/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 topology",
"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)
json_output = json.loads(output)["ins_api"]["outputs"]["output"]["body"]
print(json.dumps(json_output, indent=4, sort_keys=True))
{
"TABLE_topology_vsan": {
"ROW_topology_vsan": [
{
"TABLE_topology": {
"ROW_topology": {
"interface": "port-channel5",
"peer_domain": "0xaa(170)",
"peer_interface": "port-channel5",
"peer_ip_address": "10.197.155.244",
"peer_switch_name": "cisco-mds"
}
},
"id": 1
},
{
"TABLE_topology": {
"ROW_topology": {
"interface": "port-channel5",
"peer_domain": "0xe7(231)",
"peer_interface": "port-channel5",
"peer_ip_address": "10.197.155.244",
"peer_switch_name": "cisco-mds"
}
},
"id": 3
},
{
"TABLE_topology": {
"ROW_topology": {
"interface": "port-channel5",
"peer_domain": "0xda(218)",
"peer_interface": "port-channel5",
"peer_ip_address": "10.197.155.244",
"peer_switch_name": "cisco-mds"
}
},
"id": 4
},
{
"TABLE_topology": {
"ROW_topology": {
"interface": "port-channel5",
"peer_domain": "0xab(171)",
"peer_interface": "port-channel5",
"peer_ip_address": "10.197.155.244",
"peer_switch_name": "cisco-mds"
}
},
"id": 11
}
]
}
}
<TABLE_topology_vsan>
<ROW_topology_vsan>
<id>1</id>
<TABLE_topology>
<ROW_topology>
<interface>port-channel5</interface>
<peer_domain>0xaa(170)</peer_domain>
<peer_interface>port-channel5</peer_interface>
<peer_ip_address>10.197.155.244</peer_ip_address>
<peer_switch_name>cisco-mds</peer_switch_name>
</ROW_topology>
</TABLE_topology>
</ROW_topology_vsan>
<ROW_topology_vsan>
<id>3</id>
<TABLE_topology>
<ROW_topology>
<interface>port-channel5</interface>
<peer_domain>0xe7(231)</peer_domain>
<peer_interface>port-channel5</peer_interface>
<peer_ip_address>10.197.155.244</peer_ip_address>
<peer_switch_name>cisco-mds</peer_switch_name>
</ROW_topology>
</TABLE_topology>
</ROW_topology_vsan>
<ROW_topology_vsan>
<id>4</id>
<TABLE_topology>
<ROW_topology>
<interface>port-channel5</interface>
<peer_domain>0xda(218)</peer_domain>
<peer_interface>port-channel5</peer_interface>
<peer_ip_address>10.197.155.244</peer_ip_address>
<peer_switch_name>cisco-mds</peer_switch_name>
</ROW_topology>
</TABLE_topology>
</ROW_topology_vsan>
<ROW_topology_vsan>
<id>11</id>
<TABLE_topology>
<ROW_topology>
<interface>port-channel5</interface>
<peer_domain>0xab(171)</peer_domain>
<peer_interface>port-channel5</peer_interface>
<peer_ip_address>10.197.155.244</peer_ip_address>
<peer_switch_name>cisco-mds</peer_switch_name>
</ROW_topology>
</TABLE_topology>
</ROW_topology_vsan>
</TABLE_topology_vsan>
The show topology
command displays topology information for connected switches.
For command descriptions, see the Cisco MDS 9000 Series Switches Command References.
Note: This sample output is generated for Cisco MDS 9000 Series NX-OS Release 8.4(2a) or later.
CLI Output |
---|
|
Parameter | Description | Type | Sample Values |
---|---|---|---|
id | VSAN ID | Integer | ['1-4093'] |
peer_switch_name | Peer switch name | String | |
peer_domain | Peer domain | String | |
peer_ip_address | Peer IP address | String | |
interface | Interface | String | |
peer_interface | Peer interface | String |