show redundancy status

show redundancy status

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 redundancy status",
  "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 redundancy status",
        "msg": "Success",
        "code": "200",
        "body": {
          "rmode_admin": "HA",
          "rmode_opr": "HA",
          "this_sup": "(sup-28)",
          "this_sup_rd_st": "Active",
          "this_sup_sup_st": "Active",
          "this_sup_int_st": "Active with HA standby",
          "oth_sup": "(sup-27)",
          "oth_sup_rd_st": "Standby",
          "oth_sup_sup_st": "HA standby",
          "oth_sup_int_st": "HA standby",
          "sys_strt_time": "Thu Aug  2 04:38:38 2018\n",
          "sys_uptm_days": 6,
          "sys_uptm_hrs": 16,
          "sys_uptm_mins": 12,
          "sys_uptm_secs": 30,
          "kern_uptm_days": 6,
          "kern_uptm_hrs": 16,
          "kern_uptm_mins": 14,
          "kern_uptm_secs": 5,
          "asup_uptm_days": 6,
          "asup_uptm_hrs": 15,
          "asup_uptm_mins": 56,
          "asup_uptm_secs": 29
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show redundancy status 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 redundancy status
Redundancy mode
---------------
      administrative:   HA
         operational:   HA

This supervisor (sup-28)
-----------------------
    Redundancy state:   Active
    Supervisor state:   Active
      Internal state:   Active with HA standby

Other supervisor (sup-27)
------------------------
    Redundancy state:   Standby

    Supervisor state:   HA standby
      Internal state:   HA standby

System start time:          Thu Aug  2 04:38:38 2018

System uptime:              6 days, 16 hours, 11 minutes, 30 seconds
Kernel uptime:              6 days, 16 hours, 13 minutes, 5 seconds
Active supervisor uptime:   6 days, 15 hours, 55 minutes, 29 seconds