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": {
    "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": {}
            }
          }
        }
      }
    }
  }
}

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 9.2(1).

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 07.64 NXOS: version 9.2(2) [build 9.2(1.47)] BIOS compile time: 05/16/2018 NXOS image file is: bootflash:///nxos.9.2.1.47.bin NXOS compile time: 8/4/2018 19:00:00 [08/05/2018 03:07:21] Hardware cisco Nexus9000 C9396PX Chassis Intel(R) Core(TM) i3- CPU @ 2.50GHz with 16400292 kB of memory. Processor Board ID SAL1932LNKJ Device name: 9396px bootflash: 51496280 kB Kernel uptime is 0 day(s), 20 hour(s), 36 minute(s), 18 second(s) Last reset at 897986 usecs after Wed Aug 8 00:10:51 2018 Reason: Reset Requested by CLI command reload System version: 9.2(1) Service: plugin Core Plugin, Ethernet Plugin Active Package(s):