show maintenance profile maintenance-mode

show maintenance profile maintenance-mode

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 maintenance profile maintenance-mode",
  "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 maintenance profile maintenance-mode",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_profile": {
            "ROW_profile": {
              "name": "Maintenance Mode",
              "TABLE_cfg": {
                "ROW_cfg": [
                  {
                    "cfg": "router bgp 100"
                  },
                  {
                    "cfg": "  isolate"
                  }
                ]
              }
            }
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show maintenance profile maintenance-mode 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 maintenance profile maintenance-mode
[Maintenance Mode]
router bgp 100
  isolate


show maintenance on-reload reset-reasons

show maintenance on-reload reset-reasons

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 maintenance on-reload reset-reasons",
  "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 maintenance on-reload reset-reasons",
        "msg": "Success",
        "code": "200",
        "body": {
          "rr_bitmap": "0x0"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show maintenance on-reload reset-reasons 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 maintenance on-reload reset-reasons
Reset reasons for on-reload maintenance mode:
--------------------------------------------
(not configured)

bitmap = 0x0


show maintenance timeout

show maintenance timeout

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 maintenance timeout",
  "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 maintenance timeout",
        "msg": "Success",
        "code": "200",
        "body": {
          "timeout": "0"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show maintenance timeout 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 maintenance timeout
Maintenance mode timeout value: 0 minutes