show ssh key
Python
Copy
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 ssh key",
  "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 ssh key",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_sessions": {
            "ROW_sessions": {
              "key_type": "rsa",
              "key_time": "Fri Jul 27 13:52:00 2018\n",
              "key_data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCNzYWmJ2zvhLICH52vHdYKjqI+VUcLuRzfnqdD13KfJcG0s/u2iJR/AdUEdZl3gnNnmb20QRMW2wITkIJ1sFXOKPyluDz7NLoKH1WxWOG9YR39El0bf39Ae4JFeGTz8VYY8H6N3f4Xuuko5VHSiX+iJd+1LUTfteMm4vFl0w836Q==\n",
              "key_bitcount": "1024",
              "key_fingerprint": "SHA256:L+AcQ6uPvZzF0bxRdR1zka5kL7zsdn0tFlGIh54DALQ"
            }
          }
        }
      }
    }
  }
}