show version

show version
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 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)

json_output = json.loads(output)["ins_api"]["outputs"]["output"]["body"]
print(json.dumps(json_output, indent=4, sort_keys=True))
{
    "bios_cmpl_time": "09/25/2019",
    "bios_ver_str": "0.16.0",
    "bootflash_size": 3833856,
    "chassis_id": "MDS 9148T 48X32G FC (1 RU) Chassis",
    "cpu_name": "Intel(R) Xeon(R) CPU D-1530 @ 2.40GHz",
    "header_str": "Cisco Nexus Operating System (NX-OS) Software\nTAC support: http://www.cisco.com/tac\nDocuments: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html\nCopyright (c) 2002-2020, Cisco Systems, Inc. All rights reserved.\nThe copyrights to certain works contained herein are owned by\nother third parties and are used and distributed under license.\nSome parts of this software are covered under the GNU Public\nLicense. A copy of the license is available at\nhttp://www.gnu.org/licenses/gpl.html.\n",
    "host_name": "test-switch",
    "isan_cmpl_time": " 7/11/2020 12:00:00",
    "isan_file_name": "bootflash:///m9148-s6ek9-mz.8.4(2a).bin",
    "isan_tmstmp": "06/17/2020 17:16:13",
    "kern_uptm_days": 0,
    "kern_uptm_hrs": 3,
    "kern_uptm_mins": 26,
    "kern_uptm_secs": 41,
    "kick_cmpl_time": " 7/11/2020 12:00:00",
    "kick_file_name": "bootflash:///m9148-s6ek9-kickstart-mz.8.4(2a).bin",
    "kick_tmstmp": "06/17/2020 15:45:45",
    "kickstart_ver_str": "8.4(2a)",
    "loader_ver_str": "N/A",
    "manufacturer": "Cisco Systems, Inc.",
    "mem_type": "kB",
    "memory": 5752572,
    "module_id": "4/8/16/32 Gbps FC/Sup-4",
    "proc_board_id": "JAE2151022Y",
    "rr_ctime": "Wed Jun 26 17:49:03 2019",
    "rr_reason": "Reset Requested by CLI command reload",
    "rr_service": "",
    "rr_sys_ver": "8.4(2a)",
    "rr_usecs": 234389,
    "sys_ver_str": "8.4(2a)"
}
      <header_str>Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html
Copyright (c) 2002-2020, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://www.gnu.org/licenses/gpl.html.
</header_str>
      <bios_ver_str>0.16.0</bios_ver_str>
      <loader_ver_str>N/A</loader_ver_str>
      <kickstart_ver_str>8.4(2a)</kickstart_ver_str>
      <sys_ver_str>8.4(2a)</sys_ver_str>
      <bios_cmpl_time>09/25/2019</bios_cmpl_time>
      <kick_file_name>bootflash:///m9148-s6ek9-kickstart-mz.8.4(2a).bin</kick_file_name>
      <kick_cmpl_time> 7/11/2020 12:00:00</kick_cmpl_time>
      <kick_tmstmp>06/17/2020 15:45:45</kick_tmstmp>
      <isan_file_name>bootflash:///m9148-s6ek9-mz.8.4(2a).bin</isan_file_name>
      <isan_cmpl_time> 7/11/2020 12:00:00</isan_cmpl_time>
      <isan_tmstmp>06/17/2020 17:16:13</isan_tmstmp>
      <chassis_id>MDS 9148T 48X32G FC (1 RU) Chassis</chassis_id>
      <module_id>4/8/16/32 Gbps FC/Sup-4</module_id>
      <cpu_name>Intel(R) Xeon(R) CPU D-1530 @ 2.40GHz</cpu_name>
      <memory>5752572</memory>
      <mem_type>kB</mem_type>
      <proc_board_id>JAE2151022Y</proc_board_id>
      <host_name>test-switch</host_name>
      <bootflash_size>3833856</bootflash_size>
      <kern_uptm_days>0</kern_uptm_days>
      <kern_uptm_hrs>3</kern_uptm_hrs>
      <kern_uptm_mins>26</kern_uptm_mins>
      <kern_uptm_secs>41</kern_uptm_secs>
      <rr_usecs>234389</rr_usecs>
      <rr_ctime>Wed Jun 26 17:49:03 2019</rr_ctime>
      <rr_reason>Reset Requested by CLI command reload</rr_reason>
      <rr_sys_ver>8.4(2a)</rr_sys_ver>
      <rr_service/>
      <manufacturer>Cisco Systems, Inc.</manufacturer>

The show version command displays the version of system software that is currently running on the switch. 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
switch# show version

Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html
Copyright (c) 2002-2020, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://www.gnu.org/licenses/gpl.html.

Software
BIOS: version 0.16.0
loader: version N/A
kickstart: version 8.4(2a)
system: version 8.4(2a)
BIOS compile time: 09/25/2019
kickstart image file is: bootflash:///m9148-s6ek9-kickstart-mz.8.4(2a).bin
kickstart compile time: 7/11/2020 12:00:00 [06/17/2020 15:45:45]
system image file is: bootflash:///m9148-s6ek9-mz.8.4(2a).bin
system compile time: 7/11/2020 12:00:00 [06/17/2020 17:16:13]


Hardware
cisco MDS 9148T 48X32G FC (1 RU) Chassis ("4/8/16/32 Gbps FC/Sup-4")
Intel(R) Xeon(R) CPU D-1530 @ 2.40GHz with 5752572 kB of memory.
Processor Board ID JAE2151022Y

Device name: test-switch
bootflash: 3833856 kB

Kernel uptime is 0 day(s), 3 hour(s), 26 minute(s), 41 second(s)

Last reset at 234389 usecs after Wed Jun 26 17:49:03 2019
Reason: Reset Requested by CLI command reload
System version: 8.4(2a)
Service:

plugin
Core Plugin
ParameterDescriptionType
kern_uptm_hrsKernel up time, in hoursInteger
kern_uptm_secsKernel up time, in secondsInteger
bootflash_sizeBootflash size, in kilobyteInteger
cpu_nameCPU nameString
slot0_sizeSlot0 size, in kilobyteInteger
kick_file_nameKickstart image file nameString
rr_usecsLast reset time, in microsecondsInteger
header_strVersion headerString
sys_ver_strSystem image versionString
kern_uptm_daysKernel up time, in daysInteger
rr_sys_verSystem version on last resetString
kickstart_ver_strKickstart image versionString
module_idModule IDString
isan_file_nameSystem image file nameString
kern_uptm_minsKernel up time, in minutesInteger
bios_ver_strBIOS versionString
memoryMemory sizeInteger
rr_reasonLast reset reasonString
rr_serviceService name that is causing the resetString
proc_board_idProcessor board IDString
mem_typeMemory typeString
host_nameDevice nameString
chassis_idSystem chassis IDString
kick_cmpl_timeKickstart image compile time (in MM/dd/yyyy HH:mm:ss)String
isan_cmpl_timeSystem image compile time in the format MM/dd/yyyy HH:mm:ssString
kick_tmstmpKickstart image file timestamp in the format MM/dd/yyyy HH:mm:ssString
isan_tmstmpSystem image file timestamp in the format MM/dd/yyyy HH:mm:ssString
bios_cmpl_timeBIOS compile time in the format MM/dd/yyyyString
rr_ctimeLast reset time and date in the format ddd MM dd HH:mm:ss yyyyString
loader_ver_strLoader versionString
manufacturerManufacturer nameString