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 version
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 version ",
"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 version",
"msg": "Success",
"code": "200",
"body": {
"header_str": "Cisco Nexus Operating System (NX-OS) Software\nTAC support: http://www.cisco.com/tac\nCopyright (C) 2002-2018, Cisco and/or its affiliates.\nAll rights reserved.\nThe copyrights to certain works contained in this software are\nowned by other third parties and used and distributed under their own\nlicenses, such as open source. This software is provided \"as is,\" and unless\notherwise stated, there is no warranty, express or implied, including but not\nlimited to warranties of merchantability and fitness for a particular purpose.\nCertain components of this software are licensed under\nthe GNU General Public License (GPL) version 2.0 or \nGNU General Public License (GPL) version 3.0 or the GNU\nLesser General Public License (LGPL) Version 2.1 or \nLesser General Public License (LGPL) Version 2.0. \nA copy of each such license is available at\nhttp://www.opensource.org/licenses/gpl-2.0.php and\nhttp://opensource.org/licenses/gpl-3.0.html and\nhttp://www.opensource.org/licenses/lgpl-2.1.php and\nhttp://www.gnu.org/licenses/old-licenses/library.txt.\n",
"bios_ver_str": "07.64",
"kickstart_ver_str": "9.2(2) [build 9.2(1.47)]",
"bios_cmpl_time": "05/16/2018",
"kick_file_name": "bootflash:///nxos.9.2.1.47.bin",
"kick_cmpl_time": "8/4/2018 19:00:00",
"kick_tmstmp": "08/05/2018 03:07:21",
"chassis_id": "Nexus9000 C9396PX Chassis",
"cpu_name": "Intel(R) Core(TM) i3- CPU @ 2.50GHz",
"memory": 16400292,
"mem_type": "kB",
"proc_board_id": "SAL1932LNKJ",
"host_name": "9396px",
"bootflash_size": 51496280,
"kern_uptm_days": 0,
"kern_uptm_hrs": 20,
"kern_uptm_mins": 36,
"kern_uptm_secs": 2,
"rr_usecs": 897986,
"rr_ctime": "Wed Aug 8 00:10:51 2018",
"rr_reason": "Reset Requested by CLI command reload",
"rr_sys_ver": "9.2(1)",
"rr_service": "",
"manufacturer": "Cisco Systems, Inc.",
"TABLE_package_list": {
"ROW_package_list": {
"package_id": {}
}
}
}
}
}
}
}