show mac address-table aging-time

show mac address-table aging-time

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 mac address-table aging-time ",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "age": "14400", 
                    "age_str": "Aging Time\n----------\n"
                }, 
                "code": "200", 
                "input": "show mac address-table aging-time ", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show mac address-table aging-time command, see the CLI command reference:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

CLI Output
Switch# show mac address-table aging-time 
Aging Time
----------
    14400

show mac address-table count

show mac address-table count

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 mac address-table count ",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE-macaddtblcount": {
                        "count_str": "MAC Entries for all vlans :", 
                        "dyn_cnt": "3", 
                        "id-out": "0", 
                        "otv_cnt": "0", 
                        "secure_cnt": "0", 
                        "static_cnt": "1", 
                        "total_cnt": "4"
                    }
                }, 
                "code": "200", 
                "input": "show mac address-table count ", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show mac address-table count command, see the CLI command reference:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

CLI Output
Switch# show mac address-table count 
MAC Entries for all vlans :
Total MAC Addresses in Use:                4
Dynamic Address Count:                    3
Overlay Address Count:                    0
Static Address (User-defined) Count:       1
Secure Address Count:                      0

show mac address-table dynamic

show mac address-table dynamic

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 mac address-table dynamic ",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_mac_address": {
                        "ROW_mac_address": [
                            {
                                "disp_age": "0", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.7ffc", 
                                "disp_port": "Eth1/39", 
                                "disp_type": "dynamic", 
                                "disp_vlan": "8"
                            }, 
                            {
                                "disp_age": "0", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.7ffc", 
                                "disp_port": "Po47", 
                                "disp_type": "dynamic", 
                                "disp_vlan": "50"
                            }, 
                            {
                                "disp_age": "0", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.7ffc", 
                                "disp_port": "Po47", 
                                "disp_type": "dynamic", 
                                "disp_vlan": "253"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show mac address-table dynamic ", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show mac address-table dynamic command, see the CLI command reference:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

CLI Output
Switch# show mac address-table dynamic 
Legend: 
  - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC
 age - seconds since last seen,+ - primary entry using vPC Peer-Link,
 (T) - True, (F) - False, C - ControlPlane MAC, ~ - vsan
   VLAN     MAC Address      Type      age     Secure NTFY Ports
---------+-----------------+--------+---------+------+----+------------------
    8     f44e.0584.7ffc   dynamic  0         F      F    Eth1/39
   50     f44e.0584.7ffc   dynamic  0         F      F    Po47
  253     f44e.0584.7ffc   dynamic  0         F      F    Po47

show mac address-table static

show mac address-table static

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 mac address-table static ",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_mac_address": {
                        "ROW_mac_address": [
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "aacd.2222.3333", 
                                "disp_port": "Po47", 
                                "disp_type": "static", 
                                "disp_vlan": "100"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "-"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "8"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "50"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "51"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "52"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "53"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "54"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "100"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "245"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "253"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show mac address-table static ", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show mac address-table static command, see the CLI command reference:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

CLI Output
Switch# show mac address-table static 
Legend: 
  - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC
 age - seconds since last seen,+ - primary entry using vPC Peer-Link,
 (T) - True, (F) - False, C - ControlPlane MAC, ~ - vsan
   VLAN     MAC Address      Type      age     Secure NTFY Ports
---------+-----------------+--------+---------+------+----+------------------
  100     aacd.2222.3333   static   -         F      F    Po47
G    -     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G    8     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G   50     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G   51     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G   52     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G   53     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G   54     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G  100     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G  245     f44e.0584.b37c   static   -         F      F    sup-eth1(R)
G  253     f44e.0584.b37c   static   -         F      F    sup-eth1(R)

show mac address-table vlan 253

show mac address-table vlan 253

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 mac address-table vlan 253 ",
  "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": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_mac_address": {
                        "ROW_mac_address": [
                            {
                                "disp_age": "0", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.7ffc", 
                                "disp_port": "Po47", 
                                "disp_type": "dynamic", 
                                "disp_vlan": "253"
                            }, 
                            {
                                "disp_age": "-", 
                                "disp_is_ntfy": "F", 
                                "disp_is_secure": "F", 
                                "disp_mac_addr": "f44e.0584.b37c", 
                                "disp_port": "sup-eth1(R)", 
                                "disp_type": "static", 
                                "disp_vlan": "253"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show mac address-table vlan 253 ", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show mac address-table vlan 253 command, see the CLI command reference:

http//www.cisco.com/c/en/us/support/switches/nexus-3000-series-switches/products-command-reference-list.html

CLI Output
Switch# show mac address-table vlan 253 
Legend: 
  - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC
 age - seconds since last seen,+ - primary entry using vPC Peer-Link,
 (T) - True, (F) - False, C - ControlPlane MAC, ~ - vsan
   VLAN     MAC Address      Type      age     Secure NTFY Ports
---------+-----------------+--------+---------+------+----+------------------
  253     f44e.0584.7ffc   dynamic  0         F      F    Po47
G  253     f44e.0584.b37c   static   -         F      F    sup-eth1(R)