Cisco Nexus 9000 Series NX-API CLI, Release 9.3(x)
Latest
- Cisco Nexus 9000 Series NX-API CLI Reference, Release 9.3x
- About NX-API CLI
- New and Changed
- AAA Commands
- Accounting Commands
- Banner Commands
- Bash Shell Commands
- BGP Commands
- Boot Commands
- Callhome Commands
- CDP Commands
- CFS Commands
- Checkpoint Commands
- CLI Commands
- Clock Commands
- Config-Replace Commands
- Diagnostic Commands
- Dot1Q Commands
- Dot1X Commands
- Environment Commands
- Event Manager Commands
- FHRP Commands
- FIPS Commands
- Host Commands
- HSRP Commands
- Install Commands
- Interface Commands
- IP Commands
- IPv6 Commands
- ISIS Commands
- Key Commands
- L2 Protocol Commands
- LACP Commands
- Line Commands
- LLDP Commands
- Logging Commands
- MAC-Address Commands
- Maintenance Commands
- Module Commands
- NAT Commands
- NTP Commands
- NVE Commands
- NXAPI Commands
- OSPF Commands
- Password Commands
- Port-Channel Commands
- Port-Profile Commands
- Port-Security Commands
- Process Commands
- RADIUS Commands
- Redundancy Commands
- RMON Commands
- Role Commands
- Rollback Commands
- Route Map Commands
- Snapshot Commands
- SNMP Commands
- Socket Commands
- Spanning-Tree Commands
- SSH Commands
- Switchname Commands
- Switch-Profile Commands
- System Commands
- TACACS Commands
- Telnet Commands
- Terminal Commands
- Track Commands
- User Account Commands
- User Passphrase Commands
- Users Commands
- Version Commands
- VLAN Commands
- vPC Commands
- VRRPv3 Commands
- VRRS Commands
show nve peers
Python
Copy
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 nve peers ",
"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 nve peers",
"msg": "Success",
"code": "200",
"body": {
"TABLE_nve_peers": {
"ROW_nve_peers": [
{
"if-name": "nve1",
"peer-ip": "1.1.1.53",
"peer-state": "Up",
"learn-type": "CP",
"uptime": "05:21:52",
"router-mac": "f8c2.8846.e07f"
},
{
"if-name": "nve1",
"peer-ip": "1.1.1.112",
"peer-state": "Up",
"learn-type": "CP",
"uptime": "07:08:31",
"router-mac": "2cd0.2d51.9f1b"
},
{
"if-name": "nve1",
"peer-ip": "1.1.1.114",
"peer-state": "Up",
"learn-type": "CP",
"uptime": "07:04:43",
"router-mac": "00a6.cab6.bbbb"
},
{
"if-name": "nve1",
"peer-ip": "1.1.1.161",
"peer-state": "Up",
"learn-type": "CP",
"uptime": "05:14:11",
"router-mac": "00c8.8bb7.57bf"
},
{
"if-name": "nve1",
"peer-ip": "1.1.1.162",
"peer-state": "Up",
"learn-type": "CP",
"uptime": "05:14:18",
"router-mac": "00c8.8bb7.493f"
},
{
"if-name": "nve1",
"peer-ip": "2.2.2.2",
"peer-state": "Up",
"learn-type": "CP",
"uptime": "05:14:20",
"router-mac": "n/a"
},
{
"if-name": "nve1",
"peer-ip": "3.3.3.4",
"peer-state": "Up",
"learn-type": "CP",
"uptime": "07:05:17",
"router-mac": "0200.0303.0304"
}
]
}
}
}
}
}
}