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": "7.57.255.1", 
                                            "age": "282", 
                                            "area": "0.0.0.0", 
                                            "cksum": "cbc", 
                                            "id": "7.57.255.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "6", 
                                            "seqno": "80000259"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "302", 
                                            "area": "0.0.0.0", 
                                            "cksum": "1c5f", 
                                            "id": "7.57.255.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "7", 
                                            "seqno": "8000025e"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "292", 
                                            "area": "none", 
                                            "cksum": "6fc0", 
                                            "id": "0.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "353", 
                                            "area": "none", 
                                            "cksum": "69c5", 
                                            "id": "0.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "282", 
                                            "area": "none", 
                                            "cksum": "7d27", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "342", 
                                            "area": "none", 
                                            "cksum": "772c", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "1", 
                                "rid": "7.57.255.1"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "310", 
                                            "area": "0.0.0.0", 
                                            "cksum": "b2de", 
                                            "id": "1.1.1.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "3", 
                                            "seqno": "8000025b"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "304", 
                                            "area": "0.0.0.0", 
                                            "cksum": "7953", 
                                            "id": "2.2.2.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "1", 
                                            "seqno": "80000259"
                                        }, 
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "310", 
                                            "area": "0.0.0.0", 
                                            "cksum": "875d", 
                                            "id": "192.168.161.1", 
                                            "name": "Network", 
                                            "seqno": "80000258"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "100", 
                                "rid": "2.2.2.2"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf database
        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      283        0x80000259 0x0cbc   6
7.57.255.2 7.57.255.2 303 0x8000025e 0x1c5f 7
Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 7.57.255.1 293 0x80000258 0x6fc0 0 0.0.0.0 7.57.255.2 353 0x80000258 0x69c5 0 10.0.0.0 7.57.255.1 283 0x80000258 0x7d27 0 10.0.0.0 7.57.255.2 343 0x80000258 0x772c 0 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 311 0x8000025b 0xb2de 3
2.2.2.2 2.2.2.2 305 0x80000259 0x7953 1
Network Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum 192.168.161.1 1.1.1.1 311 0x80000258 0x875d

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": "7.57.255.1", 
                                            "age": "284", 
                                            "area": "0.0.0.0", 
                                            "cksum": "cbc", 
                                            "id": "7.57.255.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "6", 
                                            "seqno": "80000259"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "304", 
                                            "area": "0.0.0.0", 
                                            "cksum": "1c5f", 
                                            "id": "7.57.255.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "7", 
                                            "seqno": "8000025e"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "294", 
                                            "area": "none", 
                                            "cksum": "6fc0", 
                                            "id": "0.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "354", 
                                            "area": "none", 
                                            "cksum": "69c5", 
                                            "id": "0.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "284", 
                                            "area": "none", 
                                            "cksum": "7d27", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "344", 
                                            "area": "none", 
                                            "cksum": "772c", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "1", 
                                "rid": "7.57.255.1"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "7.57.253.5", 
                                            "age": "261", 
                                            "area": "0.0.0.0", 
                                            "cksum": "128d", 
                                            "id": "7.57.253.5", 
                                            "name": "Router", 
                                            "rtr_num_links": "4", 
                                            "seqno": "80000258"
                                        }, 
                                        {
                                            "advrtr": "7.57.253.6", 
                                            "age": "303", 
                                            "area": "0.0.0.0", 
                                            "cksum": "3464", 
                                            "id": "7.57.253.6", 
                                            "name": "Router", 
                                            "rtr_num_links": "4", 
                                            "seqno": "8000025b"
                                        }
                                    ]
                                }, 
                                "cname": "test", 
                                "ptag": "1", 
                                "rid": "7.57.253.5"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "312", 
                                            "area": "0.0.0.0", 
                                            "cksum": "b2de", 
                                            "id": "1.1.1.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "3", 
                                            "seqno": "8000025b"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "306", 
                                            "area": "0.0.0.0", 
                                            "cksum": "7953", 
                                            "id": "2.2.2.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "1", 
                                            "seqno": "80000259"
                                        }, 
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "312", 
                                            "area": "0.0.0.0", 
                                            "cksum": "875d", 
                                            "id": "192.168.161.1", 
                                            "name": "Network", 
                                            "seqno": "80000258"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "100", 
                                "rid": "2.2.2.2"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf database vrf all
        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      285        0x80000259 0x0cbc   6
7.57.255.2 7.57.255.2 305 0x8000025e 0x1c5f 7
Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 7.57.255.1 295 0x80000258 0x6fc0 0 0.0.0.0 7.57.255.2 355 0x80000258 0x69c5 0 10.0.0.0 7.57.255.1 285 0x80000258 0x7d27 0 10.0.0.0 7.57.255.2 345 0x80000258 0x772c 0 OSPF Router with ID (7.57.253.5) (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.5 7.57.253.5 262 0x80000258 0x128d 4
7.57.253.6 7.57.253.6 304 0x8000025b 0x3464 4
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 313 0x8000025b 0xb2de 3
2.2.2.2 2.2.2.2 307 0x80000259 0x7953 1
Network Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum 192.168.161.1 1.1.1.1 313 0x80000258 0x875d

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": "7.57.255.1", 
                                            "age": "286", 
                                            "area": "0.0.0.0", 
                                            "cksum": "cbc", 
                                            "id": "7.57.255.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "6", 
                                            "seqno": "80000259"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "306", 
                                            "area": "0.0.0.0", 
                                            "cksum": "1c5f", 
                                            "id": "7.57.255.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "7", 
                                            "seqno": "8000025e"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "296", 
                                            "area": "none", 
                                            "cksum": "6fc0", 
                                            "id": "0.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "356", 
                                            "area": "none", 
                                            "cksum": "69c5", 
                                            "id": "0.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.1", 
                                            "age": "286", 
                                            "area": "none", 
                                            "cksum": "7d27", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }, 
                                        {
                                            "advrtr": "7.57.255.2", 
                                            "age": "346", 
                                            "area": "none", 
                                            "cksum": "772c", 
                                            "id": "10.0.0.0", 
                                            "name": "Type-5 AS External", 
                                            "seqno": "80000258", 
                                            "tag": "0"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "1", 
                                "rid": "7.57.255.1"
                            }, 
                            {
                                "TABLE_db2_lsa": {
                                    "ROW_db2_lsa": [
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "314", 
                                            "area": "0.0.0.0", 
                                            "cksum": "b2de", 
                                            "id": "1.1.1.1", 
                                            "name": "Router", 
                                            "rtr_num_links": "3", 
                                            "seqno": "8000025b"
                                        }, 
                                        {
                                            "advrtr": "2.2.2.2", 
                                            "age": "308", 
                                            "area": "0.0.0.0", 
                                            "cksum": "7953", 
                                            "id": "2.2.2.2", 
                                            "name": "Router", 
                                            "rtr_num_links": "1", 
                                            "seqno": "80000259"
                                        }, 
                                        {
                                            "advrtr": "1.1.1.1", 
                                            "age": "314", 
                                            "area": "0.0.0.0", 
                                            "cksum": "875d", 
                                            "id": "192.168.161.1", 
                                            "name": "Network", 
                                            "seqno": "80000258"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "ptag": "100", 
                                "rid": "2.2.2.2"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf database vrf default
        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      287        0x80000259 0x0cbc   6
7.57.255.2 7.57.255.2 307 0x8000025e 0x1c5f 7
Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 7.57.255.1 297 0x80000258 0x6fc0 0 0.0.0.0 7.57.255.2 357 0x80000258 0x69c5 0 10.0.0.0 7.57.255.1 287 0x80000258 0x7d27 0 10.0.0.0 7.57.255.2 347 0x80000258 0x772c 0 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 315 0x8000025b 0xb2de 3
2.2.2.2 2.2.2.2 309 0x80000259 0x7953 1
Network Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# Checksum 192.168.161.1 1.1.1.1 315 0x80000258 0x875d

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": "10.100.90.129", 
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "if_cfg": "TRUE", 
                                            "ifname": "Ethernet1/1", 
                                            "index": "2", 
                                            "masklen": "30", 
                                            "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": "5", 
                                            "masklen": "22", 
                                            "passive": "TRUE", 
                                            "proto_status": "up", 
                                            "state_str": "DR", 
                                            "type_str": "BROADCAST"
                                        }, 
                                        {
                                            "addr": "10.57.50.4", 
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "if_cfg": "TRUE", 
                                            "ifname": "Vlan50", 
                                            "index": "6", 
                                            "masklen": "24", 
                                            "passive": "TRUE", 
                                            "proto_status": "up", 
                                            "state_str": "DR", 
                                            "type_str": "BROADCAST"
                                        }, 
                                        {
                                            "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": "PT5S", 
                                            "if_cfg": "TRUE", 
                                            "ifname": "Vlan253", 
                                            "index": "7", 
                                            "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.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"
                            }, 
                            {
                                "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.2", 
                                        "bdr_rid": "2.2.2.2", 
                                        "cost": "4", 
                                        "dead_interval": "40", 
                                        "dr_addr": "192.168.161.1", 
                                        "dr_rid": "1.1.1.1", 
                                        "hello_interval": "10", 
                                        "hello_timer": "PT2S", 
                                        "if_cfg": "TRUE", 
                                        "if_priority": "1", 
                                        "ifname": "Ethernet1/7", 
                                        "index": "2", 
                                        "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": "BDR", 
                                        "transmit_delay": "1", 
                                        "type_str": "BROADCAST", 
                                        "wait_interval": "40"
                                    }
                                }, 
                                "cname": "default", 
                                "ptag": "100"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf interface
 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 2, 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 5, Passive interface
 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 6, Passive interface
 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 7, 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:04
    No authentication
    Number of opaque link LSAs: 0, checksum sum 0
 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/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 BDR, Network type BROADCAST, cost 4
    Index 2, Transmit delay 1 sec, Router Priority 1
    Designated Router ID: 1.1.1.1, address: 192.168.161.1
    Backup Designated Router ID: 2.2.2.2, address: 192.168.161.2
    1 Neighbors, flooding to 1, adjacent with 1
    Timer intervals: Hello 10, Dead 40, Wait 40, Retransmit 5
      Hello timer due in 00:00:01
    No authentication
    Number of opaque link LSAs: 0, checksum sum 0


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/1", 
                                            "index": "2", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan8", 
                                            "index": "5", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan50", 
                                            "index": "6", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "2", 
                                            "ifname": "Vlan253", 
                                            "index": "7", 
                                            "nbr_total": "1", 
                                            "state_str": "P2P"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo0", 
                                            "index": "1", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "intf_count": "5", 
                                "ptag": "1"
                            }, 
                            {
                                "TABLE_intf": {
                                    "ROW_intf": {
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "cost": "4", 
                                        "ifname": "Eth1/7", 
                                        "index": "2", 
                                        "nbr_total": "1", 
                                        "state_str": "BDR"
                                    }
                                }, 
                                "cname": "default", 
                                "intf_count": "4", 
                                "ptag": "100"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf interface brief 
 OSPF Process ID 1 VRF default
 Total number of interface: 5
 Interface               ID     Area            Cost   State    Neighbors Status
 Eth1/1                  2      0.0.0.0         4      DR       0         up
Vlan8 5 0.0.0.0 40 DR 0 up
Vlan50 6 0.0.0.0 40 DR 0 up
Vlan253 7 0.0.0.0 2 P2P 1 up
Lo0 1 0.0.0.0 1 LOOPBACK 0 up
OSPF Process ID 100 VRF default Total number of interface: 4 Interface ID Area Cost State Neighbors Status Eth1/7 2 0.0.0.0 4 BDR 1 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": "40", 
                                            "ifname": "Vlan2890", 
                                            "index": "2", 
                                            "nbr_total": "1", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan701", 
                                            "index": "3", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan503", 
                                            "index": "6", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan501", 
                                            "index": "5", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan500", 
                                            "index": "4", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "2", 
                                            "ifname": "Po21", 
                                            "index": "1", 
                                            "nbr_total": "1", 
                                            "state_str": "BDR"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "400", 
                                            "ifname": "Po10.1", 
                                            "index": "7", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/10", 
                                            "index": "10", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/37", 
                                            "index": "9", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/47", 
                                            "index": "8", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/9.3600", 
                                            "index": "11", 
                                            "nbr_total": "0", 
                                            "state_str": "DR"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "intf_count": "11", 
                                "ptag": "l3-vpc"
                            }, 
                            {
                                "TABLE_intf": {
                                    "ROW_intf": [
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "40", 
                                            "ifname": "Vlan6", 
                                            "index": "1", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "400", 
                                            "ifname": "Po10", 
                                            "index": "2", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo17", 
                                            "index": "14", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo18", 
                                            "index": "13", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo31", 
                                            "index": "12", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo32", 
                                            "index": "11", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo33", 
                                            "index": "10", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo34", 
                                            "index": "9", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo35", 
                                            "index": "8", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo36", 
                                            "index": "7", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo37", 
                                            "index": "6", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo38", 
                                            "index": "5", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo39", 
                                            "index": "4", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo40", 
                                            "index": "3", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/20", 
                                            "index": "15", 
                                            "nbr_total": "1", 
                                            "state_str": "BDR"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "intf_count": "15", 
                                "ptag": "mcast-nat"
                            }, 
                            {
                                "TABLE_intf": {
                                    "ROW_intf": [
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "1", 
                                            "ifname": "Lo10", 
                                            "index": "1", 
                                            "nbr_total": "0", 
                                            "state_str": "LOOPBACK"
                                        }, 
                                        {
                                            "admin_status": "down", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/15", 
                                            "index": "3", 
                                            "nbr_total": "0", 
                                            "state_str": "DOWN"
                                        }, 
                                        {
                                            "admin_status": "up", 
                                            "area": "0.0.0.0", 
                                            "cost": "4", 
                                            "ifname": "Eth1/34", 
                                            "index": "2", 
                                            "nbr_total": "1", 
                                            "state_str": "DR"
                                        }
                                    ]
                                }, 
                                "cname": "default", 
                                "intf_count": "3", 
                                "ptag": "damp"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf interface brief vrf default
 OSPF Process ID l3-vpc VRF default
 Total number of interface: 11
 Interface               ID     Area            Cost   State    Neighbors Status
 Vlan2890                2      0.0.0.0         40     DR       1         up
Vlan701 3 0.0.0.0 40 DOWN 0 down Vlan503 6 0.0.0.0 40 DOWN 0 down Vlan501 5 0.0.0.0 40 DOWN 0 down Vlan500 4 0.0.0.0 40 DOWN 0 down Po21 1 0.0.0.0 2 BDR 1 up
Po10.1 7 0.0.0.0 400 DOWN 0 down Eth1/10 10 0.0.0.0 4 DR 0 up
Eth1/37 9 0.0.0.0 4 DOWN 0 down Eth1/47 8 0.0.0.0 4 DOWN 0 down Eth1/9.3600 11 0.0.0.0 4 DR 0 up
OSPF Process ID mcast-nat VRF default Total number of interface: 15 Interface ID Area Cost State Neighbors Status Vlan6 1 0.0.0.0 40 DOWN 0 down Po10 2 0.0.0.0 400 DOWN 0 down Lo17 14 0.0.0.0 1 LOOPBACK 0 up
Lo18 13 0.0.0.0 1 LOOPBACK 0 up
Lo31 12 0.0.0.0 1 LOOPBACK 0 up
Lo32 11 0.0.0.0 1 LOOPBACK 0 up
Lo33 10 0.0.0.0 1 LOOPBACK 0 up
Lo34 9 0.0.0.0 1 LOOPBACK 0 up
Lo35 8 0.0.0.0 1 LOOPBACK 0 up
Lo36 7 0.0.0.0 1 LOOPBACK 0 up
Lo37 6 0.0.0.0 1 LOOPBACK 0 up
Lo38 5 0.0.0.0 1 LOOPBACK 0 up
Lo39 4 0.0.0.0 1 LOOPBACK 0 up
Lo40 3 0.0.0.0 1 LOOPBACK 0 up
Eth1/20 15 0.0.0.0 4 BDR 1 up
OSPF Process ID damp VRF default Total number of interface: 3 Interface ID Area Cost State Neighbors Status Lo10 1 0.0.0.0 1 LOOPBACK 0 up
Eth1/15 3 0.0.0.0 4 DOWN 0 down Eth1/34 2 0.0.0.0 4 DR 1 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": "3", 
                                        "nbr_total": "1", 
                                        "state_str": "P2P"
                                    }, 
                                    {
                                        "admin_status": "up", 
                                        "area": "0.0.0.0", 
                                        "cost": "5", 
                                        "ifname": "Eth1/46", 
                                        "index": "4", 
                                        "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

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                 3      0.0.0.0         4      P2P      1         up
Eth1/46 4 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": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show ip ospf interface ethernet1/1",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_ctx": {
            "ROW_ctx": {
              "ptag": "1",
              "cname": "default",
              "TABLE_intf": {
                "ROW_intf": {
                  "ifname": "Ethernet1/1",
                  "admin_status": "up",
                  "proto_status": "up",
                  "addr": "10.100.90.129",
                  "masklen": "30",
                  "area": "0.0.0.0",
                  "if_cfg": "TRUE",
                  "state_str": "DR",
                  "type_str": "BROADCAST",
                  "cost": "4",
                  "index": "2",
                  "passive": "TRUE"
                }
              }
            }
          }
        }
      }
    }
  }
}

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

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 2, 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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

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": "6", 
                                    "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

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 6, 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": "3", 
                                        "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": "PT7S", 
                                        "if_cfg": "TRUE", 
                                        "ifname": "Ethernet1/46", 
                                        "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"
                                    }
                                ]
                            }, 
                            "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

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 3, 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 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:06
    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": "7.57.253.1", 
                                        "drstate": " -", 
                                        "intf": "Vlan253", 
                                        "priority": "1", 
                                        "rid": "7.57.255.2", 
                                        "state": "FULL", 
                                        "uptime": "P12DT14H44M52S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "1"
                            }, 
                            {
                                "TABLE_nbr": {
                                    "ROW_nbr": {
                                        "addr": "192.168.161.1", 
                                        "drstate": "DR", 
                                        "intf": "Eth1/7", 
                                        "priority": "1", 
                                        "rid": "1.1.1.1", 
                                        "state": "FULL", 
                                        "uptime": "P12DT14H44M49S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "100"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf neighbors
 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/ -          1w5d     7.57.253.1      Vlan253 
 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/DR          1w5d     192.168.161.1   Eth1/7 

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": "7.57.253.1", 
                                        "drstate": " -", 
                                        "intf": "Vlan253", 
                                        "priority": "1", 
                                        "rid": "7.57.255.2", 
                                        "state": "FULL", 
                                        "uptime": "P12DT14H44M54S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "1"
                            }, 
                            {
                                "TABLE_nbr": {
                                    "ROW_nbr": {
                                        "addr": "192.168.161.1", 
                                        "drstate": "DR", 
                                        "intf": "Eth1/7", 
                                        "priority": "1", 
                                        "rid": "1.1.1.1", 
                                        "state": "FULL", 
                                        "uptime": "P12DT14H44M50S"
                                    }
                                }, 
                                "cname": "default", 
                                "nbrcount": "1", 
                                "ptag": "100"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf neighbors vrf default
 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/ -          1w5d     7.57.253.1      Vlan253 
 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/DR          1w5d     192.168.161.1   Eth1/7 

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": "5", 
                                        "age": "P12DT14H45M6S", 
                                        "aname": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "backbone_active": "TRUE", 
                                        "last_spf_run_time": "PT0S", 
                                        "loopback_intf": "1", 
                                        "lsa_cnt": "2", 
                                        "lsa_crc": "0x291b", 
                                        "no_summary": "FALSE", 
                                        "nssa": "FALSE", 
                                        "passive_intf": "3", 
                                        "spf_runs": "3", 
                                        "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": "4", 
                                "asext_lsa_crc": "0x1cdd8", 
                                "asopaque_lsa_cnt": "0", 
                                "asopaque_lsa_crc": "0", 
                                "cname": "default", 
                                "gr_grace_period": "PT1M30S", 
                                "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": "P12DT14H45M6S", 
                                        "aname": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "backbone_active": "TRUE", 
                                        "last_spf_run_time": "PT0S", 
                                        "loopback_intf": "0", 
                                        "lsa_cnt": "2", 
                                        "lsa_crc": "0x46f1", 
                                        "no_summary": "FALSE", 
                                        "nssa": "FALSE", 
                                        "passive_intf": "0", 
                                        "spf_runs": "4", 
                                        "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": "PT1M30S", 
                                "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.5", 
                                "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": "1", 
                                        "age": "P12DT14H45M1S", 
                                        "aname": "0.0.0.0", 
                                        "auth_type": "none", 
                                        "backbone_active": "TRUE", 
                                        "last_spf_run_time": "PT0S", 
                                        "loopback_intf": "0", 
                                        "lsa_cnt": "3", 
                                        "lsa_crc": "0x1b38e", 
                                        "no_summary": "FALSE", 
                                        "nssa": "FALSE", 
                                        "passive_intf": "0", 
                                        "spf_runs": "4", 
                                        "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": "PT1M30S", 
                                "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"
                            }
                        ]
                    }
                }, 
                "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf vrf all

 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: 90 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 4, checksum sum 0x1cdd8
 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 1w5d
        Interfaces in this area: 5 Active interfaces: 5
        Passive interfaces: 3  Loopback interfaces: 1
        No authentication available
        SPF calculation has run 3 times
         Last SPF ran for 0.000498s
        Area ranges are
        Number of LSAs: 2, checksum sum 0x291b

 Routing Process 1 with ID 7.57.253.5 VRF test
 Routing Process Instance Number 1
 Stateful High Availability enabled
 Graceful-restart is configured
   Grace period: 90 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 1w5d
        Interfaces in this area: 2 Active interfaces: 2
        Passive interfaces: 0  Loopback interfaces: 0
        No authentication available
        SPF calculation has run 4 times
         Last SPF ran for 0.000260s
        Area ranges are
        Number of LSAs: 2, checksum sum 0x46f1

 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: 90 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 1w5d
        Interfaces in this area: 4 Active interfaces: 1
        Passive interfaces: 0  Loopback interfaces: 0
        No authentication available
        SPF calculation has run 4 times
         Last SPF ran for 0.000232s
        Area ranges are
        Number of LSAs: 3, checksum sum 0x1b38e

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": "P12DT14H45M8S", 
                                    "aname": "0.0.0.0", 
                                    "auth_type": "none", 
                                    "backbone_active": "TRUE", 
                                    "last_spf_run_time": "PT0S", 
                                    "loopback_intf": "0", 
                                    "lsa_cnt": "2", 
                                    "lsa_crc": "0x46f1", 
                                    "no_summary": "FALSE", 
                                    "nssa": "FALSE", 
                                    "passive_intf": "0", 
                                    "spf_runs": "4", 
                                    "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": "PT1M30S", 
                            "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.5", 
                            "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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show ip ospf vrf test

 Routing Process 1 with ID 7.57.253.5 VRF test
 Routing Process Instance Number 1
 Stateful High Availability enabled
 Graceful-restart is configured
   Grace period: 90 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 1w5d
        Interfaces in this area: 2 Active interfaces: 2
        Passive interfaces: 0  Loopback interfaces: 0
        No authentication available
        SPF calculation has run 4 times
         Last SPF ran for 0.000260s
        Area ranges are
        Number of LSAs: 2, checksum sum 0x46f1