show ip adjacency
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.2",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show ip adjacency",
  "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.2",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show ip adjacency",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_vrf": {
            "ROW_vrf": {
              "vrf-name-out": "default",
              "TABLE_afi": {
                "ROW_afi": {
                  "afi": "ipv4",
                  "count": 1,
                  "TABLE_adj": {
                    "ROW_adj": {
                      "intf-out": "Ethernet3/2",
                      "ip-addr-out": "113.0.1.1",
                      "mac": "18ef.63e7.1dc2",
                      "pref": 50,
                      "owner": "arp"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}