show ip ospf database

show ip ospf database

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 ip ospf database ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "1652", 
                                            "area": "0.0.0.0", 
                                            "cksum": "562f", 
                                            "id": "1.1.1.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "3", 
                                            "seqno": "80000167"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "1656", 
                                            "area": "0.0.0.0", 
                                            "cksum": "6c53", 
                                            "id": "2.2.2.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "1", 
                                            "seqno": "80000166"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "1656", 
                                            "area": "0.0.0.0", 
                                            "cksum": "389b", 
                                            "id": "192.168.161.2", 
                                            "name": "Network", 
                                            "seqno": "80000165"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "100", 
                                "rid": "2.2.2.2"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "954", 
                                            "area": "0.0.0.0", 
                                            "cksum": "2d87", 
                                            "id": "7.57.255.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "6", 
                                            "seqno": "8000016e"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "1631", 
                                            "area": "0.0.0.0", 
                                            "cksum": "56a", 
                                            "id": "7.57.255.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "7", 
                                            "seqno": "8000016b"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "1764", 
                                            "area": "none", 
                                            "cksum": "6632", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000165", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "1721", 
                                            "area": "none", 
                                            "cksum": "6037", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000165", 
                                            "tag": "0"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "1", 
                                "rid": "7.57.255.1"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf database ", 
                "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 ip ospf database 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 ip ospf database 
        OSPF Router with ID (2.2.2.2) (Process ID 100 VRF default)

                Router Link States (Area 0.0.0.0)

Link ID         ADV Router      Age        Seq#       Checksum Link Count
1.1.1.1         1.1.1.1         1652       0x80000167 0x562f   3
2.2.2.2 2.2.2.2 1657 0x80000166 0x6c53 1
Network Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum 192.168.161.2 2.2.2.2 1657 0x80000165 0x389b OSPF Router with ID (7.57.255.1) (Process ID 1 VRF default) Router Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum Link Count 7.57.255.1 7.57.255.1 955 0x8000016e 0x2d87 6
7.57.255.2 7.57.255.2 1631 0x8000016b 0x056a 7
Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.0.0.0 7.57.255.1 1765 0x80000165 0x6632 0 10.0.0.0 7.57.255.2 1721 0x80000165 0x6037 0

show ip ospf database vrf all

show ip ospf database vrf all

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 ip ospf database vrf all ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "1653", 
                                            "area": "0.0.0.0", 
                                            "cksum": "562f", 
                                            "id": "1.1.1.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "3", 
                                            "seqno": "80000167"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "1658", 
                                            "area": "0.0.0.0", 
                                            "cksum": "6c53", 
                                            "id": "2.2.2.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "1", 
                                            "seqno": "80000166"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "1658", 
                                            "area": "0.0.0.0", 
                                            "cksum": "389b", 
                                            "id": "192.168.161.2", 
                                            "name": "Network", 
                                            "seqno": "80000165"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "100", 
                                "rid": "2.2.2.2"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "955", 
                                            "area": "0.0.0.0", 
                                            "cksum": "2d87", 
                                            "id": "7.57.255.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "6", 
                                            "seqno": "8000016e"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "1632", 
                                            "area": "0.0.0.0", 
                                            "cksum": "56a", 
                                            "id": "7.57.255.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "7", 
                                            "seqno": "8000016b"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "1766", 
                                            "area": "none", 
                                            "cksum": "6632", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000165", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "1722", 
                                            "area": "none", 
                                            "cksum": "6037", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000165", 
                                            "tag": "0"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "1", 
                                "rid": "7.57.255.1"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "7.57.253.9", 
                                            "age": "1675", 
                                            "area": "0.0.0.0", 
                                            "cksum": "740c", 
                                            "id": "7.57.253.9", 
                                            "name": "Router", 
                                            "rtr_num_links": "4", 
                                            "seqno": "80000168"
                                        }, 
                                        {
                                            "advrtr": "7.57.253.10", 
                                            "age": "1672", 
                                            "area": "0.0.0.0", 
                                            "cksum": "ccaf", 
                                            "id": "7.57.253.10", 
                                            "name": "Router", 
                                            "rtr_num_links": "4", 
                                            "seqno": "80000168"
                                        }
                                    ]
                                }, 
                                "cname": "test", 
                                "ptag": "1", 
                                "rid": "7.57.253.9"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf database vrf all ", 
                "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 ip ospf database vrf all 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 ip ospf database vrf all 
        OSPF Router with ID (2.2.2.2) (Process ID 100 VRF default)

                Router Link States (Area 0.0.0.0)

Link ID         ADV Router      Age        Seq#       Checksum Link Count
1.1.1.1         1.1.1.1         1654       0x80000167 0x562f   3
2.2.2.2 2.2.2.2 1659 0x80000166 0x6c53 1
Network Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum 192.168.161.2 2.2.2.2 1659 0x80000165 0x389b OSPF Router with ID (7.57.255.1) (Process ID 1 VRF default) Router Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum Link Count 7.57.255.1 7.57.255.1 956 0x8000016e 0x2d87 6
7.57.255.2 7.57.255.2 1633 0x8000016b 0x056a 7
Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.0.0.0 7.57.255.1 1766 0x80000165 0x6632 0 10.0.0.0 7.57.255.2 1723 0x80000165 0x6037 0 OSPF Router with ID (7.57.253.9) (Process ID 1 VRF test) Router Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum Link Count 7.57.253.9 7.57.253.9 1676 0x80000168 0x740c 4
7.57.253.10 7.57.253.10 1673 0x80000168 0xccaf 4

show ip ospf database vrf default

show ip ospf database vrf default

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 ip ospf database vrf default ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "1655", 
                                            "area": "0.0.0.0", 
                                            "cksum": "562f", 
                                            "id": "1.1.1.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "3", 
                                            "seqno": "80000167"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "1659", 
                                            "area": "0.0.0.0", 
                                            "cksum": "6c53", 
                                            "id": "2.2.2.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "1", 
                                            "seqno": "80000166"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "1659", 
                                            "area": "0.0.0.0", 
                                            "cksum": "389b", 
                                            "id": "192.168.161.2", 
                                            "name": "Network", 
                                            "seqno": "80000165"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "100", 
                                "rid": "2.2.2.2"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "957", 
                                            "area": "0.0.0.0", 
                                            "cksum": "2d87", 
                                            "id": "7.57.255.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "6", 
                                            "seqno": "8000016e"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "1634", 
                                            "area": "0.0.0.0", 
                                            "cksum": "56a", 
                                            "id": "7.57.255.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "7", 
                                            "seqno": "8000016b"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "1767", 
                                            "area": "none", 
                                            "cksum": "6632", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000165", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "1724", 
                                            "area": "none", 
                                            "cksum": "6037", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000165", 
                                            "tag": "0"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "1", 
                                "rid": "7.57.255.1"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf database vrf default ", 
                "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 ip ospf database vrf default 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 ip ospf database vrf default 
        OSPF Router with ID (2.2.2.2) (Process ID 100 VRF default)

                Router Link States (Area 0.0.0.0)

Link ID         ADV Router      Age        Seq#       Checksum Link Count
1.1.1.1         1.1.1.1         1655       0x80000167 0x562f   3
2.2.2.2 2.2.2.2 1660 0x80000166 0x6c53 1
Network Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum 192.168.161.2 2.2.2.2 1660 0x80000165 0x389b OSPF Router with ID (7.57.255.1) (Process ID 1 VRF default) Router Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum Link Count 7.57.255.1 7.57.255.1 958 0x8000016e 0x2d87 6
7.57.255.2 7.57.255.2 1634 0x8000016b 0x056a 7
Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.0.0.0 7.57.255.1 1768 0x80000165 0x6632 0 10.0.0.0 7.57.255.2 1724 0x80000165 0x6037 0

show ip ospf interface

show ip ospf interface

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 ip ospf interface ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_intf": {
                                    "ROW_intf": {
                                        "addr": "192.168.161.2", 
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "bdr_addr": "192.168.161.1", 
                                        "bdr_rid": "1.1.1.1", 
                                        "cost": "4", 
                                        "dead_interval": "40", 
                                        "dr_addr": "192.168.161.2", 
                                        "dr_rid": "2.2.2.2", 
                                        "hello_interval": "10", 
                                        "hello_timer": "PT8S", 
                                        "if_cfg": "true", 
                                        "if_priority": "1", 
                                        "ifname": "Ethernet1/7", 
                                        "index": "3", 
                                        "link_lsa_cnt": "0", 
                                        "link_lsa_crc": "0", 
                                        "masklen": "24", 
                                        "nbr_adjs": "1", 
                                        "nbr_flood": "1", 
                                        "nbr_total": "1", 
                                        "proto_status": "up", 
                                        "rxmt_interval": "5", 
                                        "state_str": "DR", 
                                        "transmit_delay": "1", 
                                        "type_str": "BROADCAST", 
                                        "wait_interval": "40"
                                    }
                                }, 
                                "cname": "default", 
                                "ptag": "100"
                            }, 
                            {
                                "TABLE_intf": {
                                    "ROW_intf": [
                                        {
                                            "addr": "7.57.253.2", 
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "auth_type": "none", 
                                            "cost": "2", 
                                            "dead_interval": "40", 
                                            "hello_interval": "10", 
                                            "hello_timer": "PT0S", 
                                            "if_cfg": "true", 
                                            "ifname": "Vlan253", 
                                            "index": "4", 
                                            "link_lsa_cnt": "0", 
                                            "link_lsa_crc": "0", 
                                            "masklen": "30", 
                                            "nbr_adjs": "1", 
                                            "nbr_flood": "1", 
                                            "nbr_total": "1", 
                                            "proto_status": "up", 
                                            "rxmt_interval": "5", 
                                            "state_str": "P2P", 
                                            "transmit_delay": "1", 
                                            "type_str": "P2P", 
                                            "wait_interval": "40"
                                        }, 
                                        {
                                            "addr": "10.57.50.4", 
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "if_cfg": "true", 
                                            "ifname": "Vlan50", 
                                            "index": "3", 
                                            "masklen": "24", 
                                            "passive": "true", 
                                            "proto_status": "up", 
                                            "state_str": "DR", 
                                            "type_str": "BROADCAST"
                                        }, 
                                        {
                                            "addr": "10.57.8.3", 
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "if_cfg": "true", 
                                            "ifname": "Vlan8", 
                                            "index": "2", 
                                            "masklen": "22", 
                                            "passive": "true", 
                                            "proto_status": "up", 
                                            "state_str": "DR", 
                                            "type_str": "BROADCAST"
                                        }, 
                                        {
                                            "addr": "7.57.255.2", 
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "if_cfg": "true", 
                                            "ifname": "loopback0", 
                                            "index": "1", 
                                            "masklen": "32", 
                                            "proto_status": "up", 
                                            "state_str": "LOOPBACK", 
                                            "type_str": "LOOPBACK"
                                        }, 
                                        {
                                            "addr": "10.100.90.129", 
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "if_cfg": "true", 
                                            "ifname": "Ethernet1/1", 
                                            "index": "7", 
                                            "masklen": "30", 
                                            "passive": "true", 
                                            "proto_status": "up", 
                                            "state_str": "DR", 
                                            "type_str": "BROADCAST"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "1"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf interface ", 
                "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 ip ospf interface 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 ip ospf interface 
 Ethernet1/7 is up, line protocol is up
    IP address 192.168.161.2/24
    Process ID 100 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State DR, Network type BROADCAST, cost 4
    Index 3, Transmit delay 1 sec, Router Priority 1
    Designated Router ID: 2.2.2.2, address: 192.168.161.2
    Backup Designated Router ID: 1.1.1.1, address: 192.168.161.1
    1 Neighbors, flooding to 1, adjacent with 1
    Timer intervals: Hello 10, Dead 40, Wait 40, Retransmit 5
      Hello timer due in 00:00:07
    No authentication
    Number of opaque link LSAs: 0, checksum sum 0

 Vlan253 is up, line protocol is up
    IP address 7.57.253.2/30
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State P2P, Network type P2P, cost 2
    Index 4, Transmit delay 1 sec
    1 Neighbors, flooding to 1, adjacent with 1
    Timer intervals: Hello 10, Dead 40, Wait 40, Retransmit 5
      Hello timer due in 00:00:08
    No authentication
    Number of opaque link LSAs: 0, checksum sum 0
 Vlan50 is up, line protocol is up
    IP address 10.57.50.4/24
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State DR, Network type BROADCAST, cost 40
    Index 3, Passive interface
 Vlan8 is up, line protocol is up
    IP address 10.57.8.3/22
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State DR, Network type BROADCAST, cost 40
    Index 2, Passive interface
 loopback0 is up, line protocol is up
    IP address 7.57.255.2/32
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State LOOPBACK, Network type LOOPBACK, cost 1
    Index 1
 Ethernet1/1 is up, line protocol is up
    IP address 10.100.90.129/30
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State DR, Network type BROADCAST, cost 4
    Index 7, Passive interface


show ip ospf interface brief

show ip ospf interface brief

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 ip ospf interface brief  ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_intf": {
                                    "ROW_intf": {
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "cost": "4", 
                                        "ifname": "Eth1/7", 
                                        "index": "3", 
                                        "nbr_total": "1", 
                                        "state_str": "DR"
                                    }
                                }, 
                                "cname": "default", 
                                "intf_count": "4", 
                                "ptag": "100"
                            }, 
                            {
                                "TABLE_intf": {
                                    "ROW_intf": [
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "2", 
                                            "ifname": "Vlan253", 
                                            "index": "4", 
                                            "nbr_total": "1", 
                                            "state_str": "P2P"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan50", 
                                            "index": "3", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan8", 
                                            "index": "2", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo0", 
                                            "index": "1", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/1", 
                                            "index": "7", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "intf_count": "5", 
                                "ptag": "1"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf interface brief  ", 
                "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 ip ospf interface brief 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 ip ospf interface brief
OSPF Process ID 100 VRF default Total number of interface: 4 Interface ID Area Cost State Neighbors Status Eth1/7 3 0.0.0.0 4 DR 1 up
OSPF Process ID 1 VRF default Total number of interface: 5 Interface ID Area Cost State Neighbors Status Vlan253 4 0.0.0.0 2 P2P 1 up
Vlan50 3 0.0.0.0 40 DR 0 up
Vlan8 2 0.0.0.0 40 DR 0 up
Lo0 1 0.0.0.0 1 LOOPBACK 0 up
Eth1/1 7 0.0.0.0 4 DR 0 up

show ip ospf interface brief vrf default

show ip ospf interface brief vrf default

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 ip ospf interface brief vrf default ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_intf": {
                                    "ROW_intf": {
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "cost": "4", 
                                        "ifname": "Eth1/7", 
                                        "index": "3", 
                                        "nbr_total": "1", 
                                        "state_str": "DR"
                                    }
                                }, 
                                "cname": "default", 
                                "intf_count": "4", 
                                "ptag": "100"
                            }, 
                            {
                                "TABLE_intf": {
                                    "ROW_intf": [
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "2", 
                                            "ifname": "Vlan253", 
                                            "index": "4", 
                                            "nbr_total": "1", 
                                            "state_str": "P2P"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan50", 
                                            "index": "3", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan8", 
                                            "index": "2", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo0", 
                                            "index": "1", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/1", 
                                            "index": "7", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "intf_count": "5", 
                                "ptag": "1"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf interface brief vrf default ", 
                "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 ip ospf interface brief vrf default 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 ip ospf interface brief vrf default 
 OSPF Process ID 100 VRF default
 Total number of interface: 4
 Interface               ID     Area            Cost   State    Neighbors Status
 Eth1/7                  3      0.0.0.0         4      DR       1         up
OSPF Process ID 1 VRF default Total number of interface: 5 Interface ID Area Cost State Neighbors Status Vlan253 4 0.0.0.0 2 P2P 1 up
Vlan50 3 0.0.0.0 40 DR 0 up
Vlan8 2 0.0.0.0 40 DR 0 up
Lo0 1 0.0.0.0 1 LOOPBACK 0 up
Eth1/1 7 0.0.0.0 4 DR 0 up

show ip ospf interface brief vrf test

show ip ospf interface brief vrf test

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 ip ospf interface brief vrf test ",
  "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_ctx": {
                        "ROW_ctx": {
                            "TABLE_intf": {
                                "ROW_intf": [
                                    {
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "cost": "4", 
                                        "ifname": "Eth1/45", 
                                        "index": "6", 
                                        "nbr_total": "1", 
                                        "state_str": "P2P"
                                    }, 
                                    {
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "cost": "5", 
                                        "ifname": "Eth1/46", 
                                        "index": "5", 
                                        "nbr_total": "1", 
                                        "state_str": "P2P"
                                    }
                                ]
                            }, 
                            "cname": "test", 
                            "intf_count": "2", 
                            "ptag": "1"
                        }
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf interface brief vrf test ", 
                "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 ip ospf interface brief vrf test 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 ip ospf interface brief vrf test 
 OSPF Process ID 1 VRF test
 Total number of interface: 2
 Interface               ID     Area            Cost   State    Neighbors Status
 Eth1/45                 6      0.0.0.0         4      P2P      1         up
Eth1/46 5 0.0.0.0 5 P2P 1 up

show ip ospf interface ethernet1/1

show ip ospf interface ethernet1/1

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 ip ospf interface ethernet1/1",
  "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_ctx": {
                        "ROW_ctx": {
                            "TABLE_intf": {
                                "ROW_intf": {
                                    "addr": "10.100.90.129",
                                    "admin_status": "up",
                                    "area": "0.0.0.0",
                                    "cost": "4",
                                    "if_cfg": "true",
                                    "ifname": "Ethernet1/1",
                                    "index": "7",
                                    "masklen": "30",
                                    "passive": "true",
                                    "proto_status": "up",
                                    "state_str": "DR",
                                    "type_str": "BROADCAST"
                                }
                            },
                            "cname": "default",
                            "ptag": "1"
                        }
                    }
                },
                "code": "200",
                "input": "show ip ospf interface ethernet1/1",
                "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 ip ospf interface ethernet1/1 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 ip ospf interface ethernet1/1
 Ethernet1/1 is up, line protocol is up
    IP address 10.100.90.129/30
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State DR, Network type BROADCAST, cost 4
    Index 7, Passive interface

show ip ospf interface loopback0

show ip ospf interface loopback0

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 ip ospf interface loopback0 ",
  "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_ctx": {
                        "ROW_ctx": {
                            "TABLE_intf": {
                                "ROW_intf": {
                                    "addr": "7.57.255.2", 
                                    "admin_status": "up", 
                                    "area": "0.0.0.0", 
                                    "cost": "1", 
                                    "if_cfg": "true", 
                                    "ifname": "loopback0", 
                                    "index": "1", 
                                    "masklen": "32", 
                                    "proto_status": "up", 
                                    "state_str": "LOOPBACK", 
                                    "type_str": "LOOPBACK"
                                }
                            }, 
                            "cname": "default", 
                            "ptag": "1"
                        }
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf interface loopback0 ", 
                "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 ip ospf interface loopback0 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 ip ospf interface loopback0 
 loopback0 is up, line protocol is up
    IP address 7.57.255.2/32
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State LOOPBACK, Network type LOOPBACK, cost 1
    Index 1

show ip ospf interface vlan 50

show ip ospf interface vlan 50

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 ip ospf interface vlan 50 ",
  "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_ctx": {
                        "ROW_ctx": {
                            "TABLE_intf": {
                                "ROW_intf": {
                                    "addr": "10.57.50.4", 
                                    "admin_status": "up", 
                                    "area": "0.0.0.0", 
                                    "cost": "40", 
                                    "if_cfg": "true", 
                                    "ifname": "Vlan50", 
                                    "index": "3", 
                                    "masklen": "24", 
                                    "passive": "true", 
                                    "proto_status": "up", 
                                    "state_str": "DR", 
                                    "type_str": "BROADCAST"
                                }
                            }, 
                            "cname": "default", 
                            "ptag": "1"
                        }
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf interface vlan 50 ", 
                "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 ip ospf interface vlan 50 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 ip ospf interface vlan 50 
 Vlan50 is up, line protocol is up
    IP address 10.57.50.4/24
    Process ID 1 VRF default, area 0.0.0.0
    Enabled by interface configuration
    State DR, Network type BROADCAST, cost 40
    Index 3, Passive interface

show ip ospf interface vrf test

show ip ospf interface vrf test

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 ip ospf interface vrf test ",
  "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_ctx": {
                        "ROW_ctx": {
                            "TABLE_intf": {
                                "ROW_intf": [
                                    {
                                        "addr": "7.57.253.5", 
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "cost": "4", 
                                        "dead_interval": "40", 
                                        "hello_interval": "10", 
                                        "hello_timer": "PT6S", 
                                        "if_cfg": "true", 
                                        "ifname": "Ethernet1/45", 
                                        "index": "6", 
                                        "link_lsa_cnt": "0", 
                                        "link_lsa_crc": "0", 
                                        "masklen": "30", 
                                        "nbr_adjs": "1", 
                                        "nbr_flood": "1", 
                                        "nbr_total": "1", 
                                        "proto_status": "up", 
                                        "rxmt_interval": "5", 
                                        "state_str": "P2P", 
                                        "transmit_delay": "1", 
                                        "type_str": "P2P", 
                                        "wait_interval": "40"
                                    }, 
                                    {
                                        "addr": "7.57.253.9", 
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "cost": "5", 
                                        "dead_interval": "40", 
                                        "hello_interval": "10", 
                                        "hello_timer": "PT0S", 
                                        "if_cfg": "true", 
                                        "ifname": "Ethernet1/46", 
                                        "index": "5", 
                                        "link_lsa_cnt": "0", 
                                        "link_lsa_crc": "0", 
                                        "masklen": "30", 
                                        "nbr_adjs": "1", 
                                        "nbr_flood": "1", 
                                        "nbr_total": "1", 
                                        "proto_status": "up", 
                                        "rxmt_interval": "5", 
                                        "state_str": "P2P", 
                                        "transmit_delay": "1", 
                                        "type_str": "P2P", 
                                        "wait_interval": "40"
                                    }
                                ]
                            }, 
                            "cname": "test", 
                            "ptag": "1"
                        }
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf interface vrf test ", 
                "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 ip ospf interface vrf test 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 ip ospf interface vrf test 
 Ethernet1/45 is up, line protocol is up
    IP address 7.57.253.5/30
    Process ID 1 VRF test, area 0.0.0.0
    Enabled by interface configuration
    State P2P, Network type P2P, cost 4
    Index 6, Transmit delay 1 sec
    1 Neighbors, flooding to 1, adjacent with 1
    Timer intervals: Hello 10, Dead 40, Wait 40, Retransmit 5
      Hello timer due in 00:00:05
    No authentication
    Number of opaque link LSAs: 0, checksum sum 0
 Ethernet1/46 is up, line protocol is up
    IP address 7.57.253.9/30
    Process ID 1 VRF test, area 0.0.0.0
    Enabled by interface configuration
    State P2P, Network type P2P, cost 5
    Index 5, Transmit delay 1 sec
    1 Neighbors, flooding to 1, adjacent with 1
    Timer intervals: Hello 10, Dead 40, Wait 40, Retransmit 5
      Hello timer due in 00:00:08
    No authentication
    Number of opaque link LSAs: 0, checksum sum 0


show ip ospf neighbors

show ip ospf neighbors

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 ip ospf neighbors ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_nbr": {
                                    "ROW_nbr": {
                                        "addr": "192.168.161.1", 
                                        "drstate": "BDR", 
                                        "intf": "Eth1/7", 
                                        "priority": "1", 
                                        "rid": "1.1.1.1", 
                                        "state": "FULL", 
                                        "uptime": "P7DT11H59M45S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "100"
                            }, 
                            {
                                "TABLE_nbr": {
                                    "ROW_nbr": {
                                        "addr": "7.57.253.1", 
                                        "drstate": " -", 
                                        "intf": "Vlan253", 
                                        "priority": "1", 
                                        "rid": "7.57.255.2", 
                                        "state": "FULL", 
                                        "uptime": "P7DT12H8S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "1"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf neighbors ", 
                "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 ip ospf neighbors 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 ip ospf neighbors 
 OSPF Process ID 100 VRF default
 Total number of neighbors: 1
 Neighbor ID     Pri State            Up Time  Address         Interface
 1.1.1.1           1 FULL/BDR         1w0d     192.168.161.1   Eth1/7 
 OSPF Process ID 1 VRF default
 Total number of neighbors: 1
 Neighbor ID     Pri State            Up Time  Address         Interface
 7.57.255.2        1 FULL/ -          1w0d     7.57.253.1      Vlan253 

show ip ospf neighbors vrf default

show ip ospf neighbors vrf default

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 ip ospf neighbors vrf default ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_nbr": {
                                    "ROW_nbr": {
                                        "addr": "192.168.161.1", 
                                        "drstate": "BDR", 
                                        "intf": "Eth1/7", 
                                        "priority": "1", 
                                        "rid": "1.1.1.1", 
                                        "state": "FULL", 
                                        "uptime": "P7DT11H59M46S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "100"
                            }, 
                            {
                                "TABLE_nbr": {
                                    "ROW_nbr": {
                                        "addr": "7.57.253.1", 
                                        "drstate": " -", 
                                        "intf": "Vlan253", 
                                        "priority": "1", 
                                        "rid": "7.57.255.2", 
                                        "state": "FULL", 
                                        "uptime": "P7DT12H9S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "1"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf neighbors vrf default ", 
                "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 ip ospf neighbors vrf default 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 ip ospf neighbors vrf default 
 OSPF Process ID 100 VRF default
 Total number of neighbors: 1
 Neighbor ID     Pri State            Up Time  Address         Interface
 1.1.1.1           1 FULL/BDR         1w0d     192.168.161.1   Eth1/7 
 OSPF Process ID 1 VRF default
 Total number of neighbors: 1
 Neighbor ID     Pri State            Up Time  Address         Interface
 7.57.255.2        1 FULL/ -          1w0d     7.57.253.1      Vlan253 

show ip ospf vrf all

show ip ospf vrf all

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 ip ospf vrf all ",
  "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_ctx": {
                        "ROW_ctx": [
                            {
                                "TABLE_area": {
                                    "ROW_area": {
                                        "act_intf": "1", 
                                        "age": "P7DT12H1M34S", 
                                        "aname": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "backbone_active": "true", 
                                        "last_spf_run_time": "PT0S", 
                                        "loopback_intf": "0", 
                                        "lsa_cnt": "3", 
                                        "lsa_crc": "0xfb1d", 
                                        "no_summary": "false", 
                                        "nssa": "false", 
                                        "passive_intf": "0", 
                                        "spf_runs": "3", 
                                        "stub": "false", 
                                        "total_intf": "4"
                                    }
                                }, 
                                "act_area_normal": "1", 
                                "act_area_nssa": "0", 
                                "act_area_stub": "0", 
                                "act_area_total": "1", 
                                "admin_dist": "110", 
                                "area_normal": "1", 
                                "area_nssa": "0", 
                                "area_stub": "0", 
                                "area_total": "1", 
                                "asext_lsa_cnt": "0", 
                                "asext_lsa_crc": "0", 
                                "asopaque_lsa_cnt": "0", 
                                "asopaque_lsa_crc": "0", 
                                "cname": "default", 
                                "gr_grace_period": "PT60S", 
                                "gr_ha": "true", 
                                "gr_last_status": "None", 
                                "gr_planned_only": "true", 
                                "gr_state": "inactive", 
                                "instance_number": "2", 
                                "is_abr": "false", 
                                "is_asbr": "false", 
                                "lsa_aging_pace": "10", 
                                "lsa_hold_time": "PT5S", 
                                "lsa_max_time": "PT5S", 
                                "lsa_start_time": "PT0S", 
                                "max_metric_adver": "false", 
                                "min_lsa_arr_time": "PT1S", 
                                "no_discard_rt_ext": "false", 
                                "no_discard_rt_int": "false", 
                                "ptag": "100", 
                                "ref_bw": "40000", 
                                "rid": "2.2.2.2", 
                                "spf_hold_time": "PT1S", 
                                "spf_max_paths": "8", 
                                "spf_max_time": "PT5S", 
                                "spf_start_time": "PT0S", 
                                "stateful_ha": "true", 
                                "support_opaque_lsa": "true", 
                                "support_tos0_only": "true"
                            }, 
                            {
                                "TABLE_area": {
                                    "ROW_area": {
                                        "act_intf": "5", 
                                        "age": "P7DT12H1M45S", 
                                        "aname": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "backbone_active": "true", 
                                        "last_spf_run_time": "PT0S", 
                                        "loopback_intf": "1", 
                                        "lsa_cnt": "2", 
                                        "lsa_crc": "0x32f1", 
                                        "no_summary": "false", 
                                        "nssa": "false", 
                                        "passive_intf": "3", 
                                        "spf_runs": "13", 
                                        "stub": "false", 
                                        "total_intf": "5"
                                    }
                                }, 
                                "TABLE_redist": {
                                    "ROW_redist": {
                                        "proto": "static"
                                    }
                                }, 
                                "act_area_normal": "1", 
                                "act_area_nssa": "0", 
                                "act_area_stub": "0", 
                                "act_area_total": "1", 
                                "admin_dist": "110", 
                                "area_normal": "1", 
                                "area_nssa": "0", 
                                "area_stub": "0", 
                                "area_total": "1", 
                                "asext_lsa_cnt": "2", 
                                "asext_lsa_crc": "0xc669", 
                                "asopaque_lsa_cnt": "0", 
                                "asopaque_lsa_crc": "0", 
                                "cname": "default", 
                                "gr_grace_period": "PT60S", 
                                "gr_ha": "true", 
                                "gr_last_status": "None", 
                                "gr_planned_only": "true", 
                                "gr_state": "inactive", 
                                "instance_number": "1", 
                                "is_abr": "false", 
                                "is_asbr": "true", 
                                "lsa_aging_pace": "10", 
                                "lsa_hold_time": "PT5S", 
                                "lsa_max_time": "PT5S", 
                                "lsa_start_time": "PT0S", 
                                "max_metric_adver": "false", 
                                "min_lsa_arr_time": "PT1S", 
                                "no_discard_rt_ext": "false", 
                                "no_discard_rt_int": "false", 
                                "passive_dflt": "true", 
                                "ptag": "1", 
                                "ref_bw": "40000", 
                                "rid": "7.57.255.1", 
                                "spf_hold_time": "PT1S", 
                                "spf_max_paths": "8", 
                                "spf_max_time": "PT5S", 
                                "spf_start_time": "PT0S", 
                                "stateful_ha": "true", 
                                "support_opaque_lsa": "true", 
                                "support_tos0_only": "true"
                            }, 
                            {
                                "TABLE_area": {
                                    "ROW_area": {
                                        "act_intf": "2", 
                                        "age": "P7DT12H1M34S", 
                                        "aname": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "backbone_active": "true", 
                                        "last_spf_run_time": "PT0S", 
                                        "loopback_intf": "0", 
                                        "lsa_cnt": "2", 
                                        "lsa_crc": "0x140bb", 
                                        "no_summary": "false", 
                                        "nssa": "false", 
                                        "passive_intf": "0", 
                                        "spf_runs": "6", 
                                        "stub": "false", 
                                        "total_intf": "2"
                                    }
                                }, 
                                "act_area_normal": "1", 
                                "act_area_nssa": "0", 
                                "act_area_stub": "0", 
                                "act_area_total": "1", 
                                "admin_dist": "110", 
                                "area_normal": "1", 
                                "area_nssa": "0", 
                                "area_stub": "0", 
                                "area_total": "1", 
                                "asext_lsa_cnt": "0", 
                                "asext_lsa_crc": "0", 
                                "asopaque_lsa_cnt": "0", 
                                "asopaque_lsa_crc": "0", 
                                "cname": "test", 
                                "gr_grace_period": "PT60S", 
                                "gr_ha": "true", 
                                "gr_last_status": "None", 
                                "gr_planned_only": "true", 
                                "gr_state": "inactive", 
                                "instance_number": "1", 
                                "is_abr": "false", 
                                "is_asbr": "false", 
                                "lsa_aging_pace": "10", 
                                "lsa_hold_time": "PT5S", 
                                "lsa_max_time": "PT5S", 
                                "lsa_start_time": "PT0S", 
                                "max_metric_adver": "false", 
                                "min_lsa_arr_time": "PT1S", 
                                "no_discard_rt_ext": "false", 
                                "no_discard_rt_int": "false", 
                                "ptag": "1", 
                                "ref_bw": "40000", 
                                "rid": "7.57.253.9", 
                                "spf_hold_time": "PT1S", 
                                "spf_max_paths": "8", 
                                "spf_max_time": "PT5S", 
                                "spf_start_time": "PT0S", 
                                "stateful_ha": "true", 
                                "support_opaque_lsa": "true", 
                                "support_tos0_only": "true"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf vrf all ", 
                "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 ip ospf vrf all 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 ip ospf vrf all 

 Routing Process 100 with ID 2.2.2.2 VRF default
 Routing Process Instance Number 2
 Stateful High Availability enabled
 Graceful-restart is configured
   Grace period: 60 state: Inactive 
   Last graceful restart exit status: None
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Administrative distance 110
 Reference Bandwidth is 40000 Mbps
 SPF throttling delay time of 200.000 msecs,
   SPF throttling hold time of 1000.000 msecs, 
   SPF throttling maximum wait time of 5000.000 msecs
 LSA throttling start time of 0.000 msecs,
   LSA throttling hold interval of 5000.000 msecs, 
   LSA throttling maximum wait time of 5000.000 msecs
 Minimum LSA arrival 1000.000 msec
 LSA group pacing timer 10 secs
 Maximum paths to destination 8
 Number of external LSAs 0, checksum sum 0
 Number of opaque AS LSAs 0, checksum sum 0
 Number of areas is 1, 1 normal, 0 stub, 0 nssa
 Number of active areas is 1, 1 normal, 0 stub, 0 nssa
 Install discard route for summarized external routes.
 Install discard route for summarized internal routes.
   Area BACKBONE(0.0.0.0) 
        Area has existed for 1w0d
        Interfaces in this area: 4 Active interfaces: 1
        Passive interfaces: 0  Loopback interfaces: 0
        No authentication available
        SPF calculation has run 3 times
         Last SPF ran for 0.000343s
        Area ranges are
        Number of LSAs: 3, checksum sum 0xfb1d

 Routing Process 1 with ID 7.57.255.1 VRF default
 Routing Process Instance Number 1
 Stateful High Availability enabled
 Graceful-restart is configured
   Grace period: 60 state: Inactive 
   Last graceful restart exit status: None
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 This router is an autonomous system boundary
 Redistributing External Routes from
   static
 Administrative distance 110
 Reference Bandwidth is 40000 Mbps
 SPF throttling delay time of 200.000 msecs,
   SPF throttling hold time of 1000.000 msecs, 
   SPF throttling maximum wait time of 5000.000 msecs
 LSA throttling start time of 0.000 msecs,
   LSA throttling hold interval of 5000.000 msecs, 
   LSA throttling maximum wait time of 5000.000 msecs
 Minimum LSA arrival 1000.000 msec
 LSA group pacing timer 10 secs
 Maximum paths to destination 8
 Number of external LSAs 2, checksum sum 0xc669
 Number of opaque AS LSAs 0, checksum sum 0
 Number of areas is 1, 1 normal, 0 stub, 0 nssa
 Number of active areas is 1, 1 normal, 0 stub, 0 nssa
 Install discard route for summarized external routes.
 Install discard route for summarized internal routes.
 Default Passive Interface is enabled
   Area BACKBONE(0.0.0.0) 
        Area has existed for 1w0d
        Interfaces in this area: 5 Active interfaces: 5
        Passive interfaces: 3  Loopback interfaces: 1
        No authentication available
        SPF calculation has run 13 times
         Last SPF ran for 0.000971s
        Area ranges are
        Number of LSAs: 2, checksum sum 0x32f1

 Routing Process 1 with ID 7.57.253.9 VRF test
 Routing Process Instance Number 1
 Stateful High Availability enabled
 Graceful-restart is configured
   Grace period: 60 state: Inactive 
   Last graceful restart exit status: None
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Administrative distance 110
 Reference Bandwidth is 40000 Mbps
 SPF throttling delay time of 200.000 msecs,
   SPF throttling hold time of 1000.000 msecs, 
   SPF throttling maximum wait time of 5000.000 msecs
 LSA throttling start time of 0.000 msecs,
   LSA throttling hold interval of 5000.000 msecs, 
   LSA throttling maximum wait time of 5000.000 msecs
 Minimum LSA arrival 1000.000 msec
 LSA group pacing timer 10 secs
 Maximum paths to destination 8
 Number of external LSAs 0, checksum sum 0
 Number of opaque AS LSAs 0, checksum sum 0
 Number of areas is 1, 1 normal, 0 stub, 0 nssa
 Number of active areas is 1, 1 normal, 0 stub, 0 nssa
 Install discard route for summarized external routes.
 Install discard route for summarized internal routes.
   Area BACKBONE(0.0.0.0) 
        Area has existed for 1w0d
        Interfaces in this area: 2 Active interfaces: 2
        Passive interfaces: 0  Loopback interfaces: 0
        No authentication available
        SPF calculation has run 6 times
         Last SPF ran for 0.000348s
        Area ranges are
        Number of LSAs: 2, checksum sum 0x140bb

show ip ospf vrf test

show ip ospf vrf test

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 ip ospf vrf test ",
  "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_ctx": {
                        "ROW_ctx": {
                            "TABLE_area": {
                                "ROW_area": {
                                    "act_intf": "2", 
                                    "age": "P7DT12H1M37S", 
                                    "aname": "0.0.0.0", 
                                    "auth_type": "none", 
                                    "backbone_active": "true", 
                                    "last_spf_run_time": "PT0S", 
                                    "loopback_intf": "0", 
                                    "lsa_cnt": "2", 
                                    "lsa_crc": "0x140bb", 
                                    "no_summary": "false", 
                                    "nssa": "false", 
                                    "passive_intf": "0", 
                                    "spf_runs": "6", 
                                    "stub": "false", 
                                    "total_intf": "2"
                                }
                            }, 
                            "act_area_normal": "1", 
                            "act_area_nssa": "0", 
                            "act_area_stub": "0", 
                            "act_area_total": "1", 
                            "admin_dist": "110", 
                            "area_normal": "1", 
                            "area_nssa": "0", 
                            "area_stub": "0", 
                            "area_total": "1", 
                            "asext_lsa_cnt": "0", 
                            "asext_lsa_crc": "0", 
                            "asopaque_lsa_cnt": "0", 
                            "asopaque_lsa_crc": "0", 
                            "cname": "test", 
                            "gr_grace_period": "PT60S", 
                            "gr_ha": "true", 
                            "gr_last_status": "None", 
                            "gr_planned_only": "true", 
                            "gr_state": "inactive", 
                            "instance_number": "1", 
                            "is_abr": "false", 
                            "is_asbr": "false", 
                            "lsa_aging_pace": "10", 
                            "lsa_hold_time": "PT5S", 
                            "lsa_max_time": "PT5S", 
                            "lsa_start_time": "PT0S", 
                            "max_metric_adver": "false", 
                            "min_lsa_arr_time": "PT1S", 
                            "no_discard_rt_ext": "false", 
                            "no_discard_rt_int": "false", 
                            "ptag": "1", 
                            "ref_bw": "40000", 
                            "rid": "7.57.253.9", 
                            "spf_hold_time": "PT1S", 
                            "spf_max_paths": "8", 
                            "spf_max_time": "PT5S", 
                            "spf_start_time": "PT0S", 
                            "stateful_ha": "true", 
                            "support_opaque_lsa": "true", 
                            "support_tos0_only": "true"
                        }
                    }
                }, 
                "code": "200", 
                "input": "show ip ospf vrf test ", 
                "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 ip ospf vrf test 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 ip ospf vrf test 

 Routing Process 1 with ID 7.57.253.9 VRF test
 Routing Process Instance Number 1
 Stateful High Availability enabled
 Graceful-restart is configured
   Grace period: 60 state: Inactive 
   Last graceful restart exit status: None
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Administrative distance 110
 Reference Bandwidth is 40000 Mbps
 SPF throttling delay time of 200.000 msecs,
   SPF throttling hold time of 1000.000 msecs, 
   SPF throttling maximum wait time of 5000.000 msecs
 LSA throttling start time of 0.000 msecs,
   LSA throttling hold interval of 5000.000 msecs, 
   LSA throttling maximum wait time of 5000.000 msecs
 Minimum LSA arrival 1000.000 msec
 LSA group pacing timer 10 secs
 Maximum paths to destination 8
 Number of external LSAs 0, checksum sum 0
 Number of opaque AS LSAs 0, checksum sum 0
 Number of areas is 1, 1 normal, 0 stub, 0 nssa
 Number of active areas is 1, 1 normal, 0 stub, 0 nssa
 Install discard route for summarized external routes.
 Install discard route for summarized internal routes.
   Area BACKBONE(0.0.0.0) 
        Area has existed for 1w0d
        Interfaces in this area: 2 Active interfaces: 2
        Passive interfaces: 0  Loopback interfaces: 0
        No authentication available
        SPF calculation has run 6 times
         Last SPF ran for 0.000348s
        Area ranges are
        Number of LSAs: 2, checksum sum 0x140bb