show key chain

show key chain

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 key chain",
  "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 key chain",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_keychain": {
            "ROW_keychain": [
              {
                "chain_name": "key1",
                "TABLE_key": {
                  "ROW_key": [
                    {
                      "key_id": "0",
                      "accept_utc_zone": "false",
                      "accept_start": "23:10:10 Aug 10 2018",
                      "accept_end": "(duration 2)",
                      "accept_valid": "false",
                      "send_valid": "true"
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show key chain 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 key chain
Key-Chain key1
  Key 0 -- text ""
    accept lifetime local (23:10:10 Aug 10 2018)-(duration 2)
    send lifetime (always valid) [active]






show key chain mode decrypt

show key chain mode decrypt

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 key chain mode decrypt",
  "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 key chain mode decrypt",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_keychain_decrypt": {
            "ROW_keychain_decrypt": [
              {
                "chain_name": "key1",
                "TABLE_key": {
                  "ROW_key": [
                    {
                      "key_id": "0",
                      "accept_utc_zone": "false",
                      "accept_start": "23:10:10 Aug 10 2018",
                      "accept_end": "(duration 2)",
                      "accept_valid": "false",
                      "send_valid": "true"
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show key chain mode decrypt 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 key chain mode decrypt
Key-Chain key1
  Key 0 -- text ""
    accept lifetime local (23:10:10 Aug 10 2018)-(duration 2)
    send lifetime (always valid) [active]