show version

show version

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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_package_list": {
                        "ROW_package_list": {
                            "package_id": {}
                        }
                    }, 
                    "bios_cmpl_time": "10/18/2016", 
                    "bios_ver_str": "08.32", 
                    "bootflash_size": 21693714, 
                    "chassis_id": "Nexus9000 C9508 (8 Slot) Chassis", 
                    "cpu_name": "Intel(R) Xeon(R) CPU E5-2403 0 @ 1.80GHz", 
                    "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", 
                    "host_name": "macsec2", 
                    "kern_uptm_days": 0, 
                    "kern_uptm_hrs": 5, 
                    "kern_uptm_mins": 3, 
                    "kern_uptm_secs": 24, 
                    "kick_cmpl_time": " 5/22/2018 15:00:00", 
                    "kick_file_name": "bootflash:///nxos.7.0.3.I7.4.bin", 
                    "kick_tmstmp": "05/22/2018 15:26:08", 
                    "kickstart_ver_str": "7.0(3)I7(4)", 
                    "manufacturer": "Cisco Systems, Inc.", 
                    "mem_type": "kB", 
                    "memory": 16400780, 
                    "module_id": "Supervisor Module", 
                    "proc_board_id": "SAL2015NQ3H", 
                    "rr_ctime": "Wed May 23 18:26:12 2018", 
                    "rr_reason": "Reset Requested by CLI command reload", 
                    "rr_service": "", 
                    "rr_sys_ver": "7.0(3)I7(4)", 
                    "rr_usecs": 681622
                }, 
                "code": "200", 
                "input": "show version", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show version 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 7.0(3)I7(4).

CLI Output
Switch# show version
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (C) 2002-2018, Cisco and/or its affiliates.
All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under their own
licenses, such as open source.  This software is provided "as is," and unless
otherwise stated, there is no warranty, express or implied, including but not
limited to warranties of merchantability and fitness for a particular purpose.
Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or 
GNU General Public License (GPL) version 3.0  or the GNU
Lesser General Public License (LGPL) Version 2.1 or 
Lesser General Public License (LGPL) Version 2.0. 
A copy of each such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://opensource.org/licenses/gpl-3.0.html and
http://www.opensource.org/licenses/lgpl-2.1.php and
http://www.gnu.org/licenses/old-licenses/library.txt.

Software
  BIOS: version 08.32
  NXOS: version 7.0(3)I7(4)
  BIOS compile time:  10/18/2016
  NXOS image file is: bootflash:///nxos.7.0.3.I7.4.bin
  NXOS compile time:  5/22/2018 15:00:00 [05/22/2018 15:26:08]


Hardware
  cisco Nexus9000 C9508 (8 Slot) Chassis ("Supervisor Module")
  Intel(R) Xeon(R) CPU E5-2403 0 @ 1.80GHz with 16400780 kB of memory.
  Processor Board ID SAL2015NQ3H

  Device name: macsec2
  bootflash:   21693714 kB
Kernel uptime is 0 day(s), 5 hour(s), 3 minute(s), 26 second(s)

Last reset at 681622 usecs after Wed May 23 10:26:12 2018
  Reason: Reset Requested by CLI command reload
  System version: 7.0(3)I7(4)
  Service: 

plugin
  Core Plugin, Ethernet Plugin

Active Package(s):