show vrrpv3
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 vrrpv3",
  "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 vrrpv3",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_grp": {
            "ROW_grp": [
              {
                "intf": "Vlan2",
                "id": 1,
                "af": "IPv4",
                "desc": "\"vrrpv3_json_test\"",
                "state": "MASTER",
                "duration": "2 mins 7.902 secs",
                "vip": "4.4.4.100",
                "vmac": "0000.5e00.0101",
                "adv": 2000,
                "preempt": "enabled",
                "priority": 101,
                "m_addr": "4.4.4.2",
                "m_priority": 101,
                "m_adv": 2000,
                "m_expire": 1380
              },
              {
                "intf": "Vlan2",
                "id": 1,
                "af": "IPv6",
                "desc": "\"vrrpv3_v6_json_test\"",
                "state": "MASTER",
                "duration": "58.071 secs",
                "vip": "fe80::101",
                "TABLE_sec": {
                  "ROW_sec": {
                    "addr": "4000::100"
                  }
                },
                "vmac": "0000.5e00.0201",
                "adv": 2000,
                "preempt": "enabled",
                "priority": 101,
                "m_addr": "fe80::1034:12ff:fe34:1234",
                "m_priority": 101,
                "m_adv": 2000,
                "m_expire": 852
              }
            ]
          }
        }
      }
    }
  }
}