show interface Eth1/22 counters storm-control
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 interface Eth1/22 counters storm-control ",
  "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 interface Eth1/22 counters storm-control",
        "msg": "Success",
        "code": "200",
        "body": {
        "TABLE_interface": {
            "ROW_interface": {
                "interface": "Ethernet1/22", 
                "eth_ucast_supp": "100.00", 
                "eth_mcast_supp": "100.00", 
                "eth_bcast_supp": "100.00", 
                "eth_total_supp": "0", 
                "supp_action": "[--]"
}}}}}}}