show ip ospf database
show ip ospf database
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf database ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_db2_lsa": {
"ROW_db2_lsa": [
{
"advrtr": "1.1.1.1",
"age": "1652",
"area": "0.0.0.0",
"cksum": "562f",
"id": "1.1.1.1",
"name": "Router",
"rtr_num_links": "3",
"seqno": "80000167"
},
{
"advrtr": "2.2.2.2",
"age": "1656",
"area": "0.0.0.0",
"cksum": "6c53",
"id": "2.2.2.2",
"name": "Router",
"rtr_num_links": "1",
"seqno": "80000166"
},
{
"advrtr": "2.2.2.2",
"age": "1656",
"area": "0.0.0.0",
"cksum": "389b",
"id": "192.168.161.2",
"name": "Network",
"seqno": "80000165"
}
]
},
"cname": "default",
"ptag": "100",
"rid": "2.2.2.2"
},
{
"TABLE_db2_lsa": {
"ROW_db2_lsa": [
{
"advrtr": "7.57.255.1",
"age": "954",
"area": "0.0.0.0",
"cksum": "2d87",
"id": "7.57.255.1",
"name": "Router",
"rtr_num_links": "6",
"seqno": "8000016e"
},
{
"advrtr": "7.57.255.2",
"age": "1631",
"area": "0.0.0.0",
"cksum": "56a",
"id": "7.57.255.2",
"name": "Router",
"rtr_num_links": "7",
"seqno": "8000016b"
},
{
"advrtr": "7.57.255.1",
"age": "1764",
"area": "none",
"cksum": "6632",
"id": "10.0.0.0",
"name": "Type-5 AS External",
"seqno": "80000165",
"tag": "0"
},
{
"advrtr": "7.57.255.2",
"age": "1721",
"area": "none",
"cksum": "6037",
"id": "10.0.0.0",
"name": "Type-5 AS External",
"seqno": "80000165",
"tag": "0"
}
]
},
"cname": "default",
"ptag": "1",
"rid": "7.57.255.1"
}
]
}
},
"code": "200",
"input": "show ip ospf database ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf database command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf database vrf all
show ip ospf database vrf all
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf database vrf all ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_db2_lsa": {
"ROW_db2_lsa": [
{
"advrtr": "1.1.1.1",
"age": "1653",
"area": "0.0.0.0",
"cksum": "562f",
"id": "1.1.1.1",
"name": "Router",
"rtr_num_links": "3",
"seqno": "80000167"
},
{
"advrtr": "2.2.2.2",
"age": "1658",
"area": "0.0.0.0",
"cksum": "6c53",
"id": "2.2.2.2",
"name": "Router",
"rtr_num_links": "1",
"seqno": "80000166"
},
{
"advrtr": "2.2.2.2",
"age": "1658",
"area": "0.0.0.0",
"cksum": "389b",
"id": "192.168.161.2",
"name": "Network",
"seqno": "80000165"
}
]
},
"cname": "default",
"ptag": "100",
"rid": "2.2.2.2"
},
{
"TABLE_db2_lsa": {
"ROW_db2_lsa": [
{
"advrtr": "7.57.255.1",
"age": "955",
"area": "0.0.0.0",
"cksum": "2d87",
"id": "7.57.255.1",
"name": "Router",
"rtr_num_links": "6",
"seqno": "8000016e"
},
{
"advrtr": "7.57.255.2",
"age": "1632",
"area": "0.0.0.0",
"cksum": "56a",
"id": "7.57.255.2",
"name": "Router",
"rtr_num_links": "7",
"seqno": "8000016b"
},
{
"advrtr": "7.57.255.1",
"age": "1766",
"area": "none",
"cksum": "6632",
"id": "10.0.0.0",
"name": "Type-5 AS External",
"seqno": "80000165",
"tag": "0"
},
{
"advrtr": "7.57.255.2",
"age": "1722",
"area": "none",
"cksum": "6037",
"id": "10.0.0.0",
"name": "Type-5 AS External",
"seqno": "80000165",
"tag": "0"
}
]
},
"cname": "default",
"ptag": "1",
"rid": "7.57.255.1"
},
{
"TABLE_db2_lsa": {
"ROW_db2_lsa": [
{
"advrtr": "7.57.253.9",
"age": "1675",
"area": "0.0.0.0",
"cksum": "740c",
"id": "7.57.253.9",
"name": "Router",
"rtr_num_links": "4",
"seqno": "80000168"
},
{
"advrtr": "7.57.253.10",
"age": "1672",
"area": "0.0.0.0",
"cksum": "ccaf",
"id": "7.57.253.10",
"name": "Router",
"rtr_num_links": "4",
"seqno": "80000168"
}
]
},
"cname": "test",
"ptag": "1",
"rid": "7.57.253.9"
}
]
}
},
"code": "200",
"input": "show ip ospf database vrf all ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf database vrf all command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf database vrf default
show ip ospf database vrf default
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf database vrf default ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_db2_lsa": {
"ROW_db2_lsa": [
{
"advrtr": "1.1.1.1",
"age": "1655",
"area": "0.0.0.0",
"cksum": "562f",
"id": "1.1.1.1",
"name": "Router",
"rtr_num_links": "3",
"seqno": "80000167"
},
{
"advrtr": "2.2.2.2",
"age": "1659",
"area": "0.0.0.0",
"cksum": "6c53",
"id": "2.2.2.2",
"name": "Router",
"rtr_num_links": "1",
"seqno": "80000166"
},
{
"advrtr": "2.2.2.2",
"age": "1659",
"area": "0.0.0.0",
"cksum": "389b",
"id": "192.168.161.2",
"name": "Network",
"seqno": "80000165"
}
]
},
"cname": "default",
"ptag": "100",
"rid": "2.2.2.2"
},
{
"TABLE_db2_lsa": {
"ROW_db2_lsa": [
{
"advrtr": "7.57.255.1",
"age": "957",
"area": "0.0.0.0",
"cksum": "2d87",
"id": "7.57.255.1",
"name": "Router",
"rtr_num_links": "6",
"seqno": "8000016e"
},
{
"advrtr": "7.57.255.2",
"age": "1634",
"area": "0.0.0.0",
"cksum": "56a",
"id": "7.57.255.2",
"name": "Router",
"rtr_num_links": "7",
"seqno": "8000016b"
},
{
"advrtr": "7.57.255.1",
"age": "1767",
"area": "none",
"cksum": "6632",
"id": "10.0.0.0",
"name": "Type-5 AS External",
"seqno": "80000165",
"tag": "0"
},
{
"advrtr": "7.57.255.2",
"age": "1724",
"area": "none",
"cksum": "6037",
"id": "10.0.0.0",
"name": "Type-5 AS External",
"seqno": "80000165",
"tag": "0"
}
]
},
"cname": "default",
"ptag": "1",
"rid": "7.57.255.1"
}
]
}
},
"code": "200",
"input": "show ip ospf database vrf default ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf database vrf default command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf interface
show ip ospf interface
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf interface ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_intf": {
"ROW_intf": {
"addr": "192.168.161.2",
"admin_status": "up",
"area": "0.0.0.0",
"auth_type": "none",
"bdr_addr": "192.168.161.1",
"bdr_rid": "1.1.1.1",
"cost": "4",
"dead_interval": "40",
"dr_addr": "192.168.161.2",
"dr_rid": "2.2.2.2",
"hello_interval": "10",
"hello_timer": "PT8S",
"if_cfg": "true",
"if_priority": "1",
"ifname": "Ethernet1/7",
"index": "3",
"link_lsa_cnt": "0",
"link_lsa_crc": "0",
"masklen": "24",
"nbr_adjs": "1",
"nbr_flood": "1",
"nbr_total": "1",
"proto_status": "up",
"rxmt_interval": "5",
"state_str": "DR",
"transmit_delay": "1",
"type_str": "BROADCAST",
"wait_interval": "40"
}
},
"cname": "default",
"ptag": "100"
},
{
"TABLE_intf": {
"ROW_intf": [
{
"addr": "7.57.253.2",
"admin_status": "up",
"area": "0.0.0.0",
"auth_type": "none",
"cost": "2",
"dead_interval": "40",
"hello_interval": "10",
"hello_timer": "PT0S",
"if_cfg": "true",
"ifname": "Vlan253",
"index": "4",
"link_lsa_cnt": "0",
"link_lsa_crc": "0",
"masklen": "30",
"nbr_adjs": "1",
"nbr_flood": "1",
"nbr_total": "1",
"proto_status": "up",
"rxmt_interval": "5",
"state_str": "P2P",
"transmit_delay": "1",
"type_str": "P2P",
"wait_interval": "40"
},
{
"addr": "10.57.50.4",
"admin_status": "up",
"area": "0.0.0.0",
"cost": "40",
"if_cfg": "true",
"ifname": "Vlan50",
"index": "3",
"masklen": "24",
"passive": "true",
"proto_status": "up",
"state_str": "DR",
"type_str": "BROADCAST"
},
{
"addr": "10.57.8.3",
"admin_status": "up",
"area": "0.0.0.0",
"cost": "40",
"if_cfg": "true",
"ifname": "Vlan8",
"index": "2",
"masklen": "22",
"passive": "true",
"proto_status": "up",
"state_str": "DR",
"type_str": "BROADCAST"
},
{
"addr": "7.57.255.2",
"admin_status": "up",
"area": "0.0.0.0",
"cost": "1",
"if_cfg": "true",
"ifname": "loopback0",
"index": "1",
"masklen": "32",
"proto_status": "up",
"state_str": "LOOPBACK",
"type_str": "LOOPBACK"
},
{
"addr": "10.100.90.129",
"admin_status": "up",
"area": "0.0.0.0",
"cost": "4",
"if_cfg": "true",
"ifname": "Ethernet1/1",
"index": "7",
"masklen": "30",
"passive": "true",
"proto_status": "up",
"state_str": "DR",
"type_str": "BROADCAST"
}
]
},
"cname": "default",
"ptag": "1"
}
]
}
},
"code": "200",
"input": "show ip ospf interface ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf interface command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf interface brief
show ip ospf interface brief
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf interface brief ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_intf": {
"ROW_intf": {
"admin_status": "up",
"area": "0.0.0.0",
"cost": "4",
"ifname": "Eth1/7",
"index": "3",
"nbr_total": "1",
"state_str": "DR"
}
},
"cname": "default",
"intf_count": "4",
"ptag": "100"
},
{
"TABLE_intf": {
"ROW_intf": [
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "2",
"ifname": "Vlan253",
"index": "4",
"nbr_total": "1",
"state_str": "P2P"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "40",
"ifname": "Vlan50",
"index": "3",
"nbr_total": "0",
"state_str": "DR"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "40",
"ifname": "Vlan8",
"index": "2",
"nbr_total": "0",
"state_str": "DR"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "1",
"ifname": "Lo0",
"index": "1",
"nbr_total": "0",
"state_str": "LOOPBACK"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "4",
"ifname": "Eth1/1",
"index": "7",
"nbr_total": "0",
"state_str": "DR"
}
]
},
"cname": "default",
"intf_count": "5",
"ptag": "1"
}
]
}
},
"code": "200",
"input": "show ip ospf interface brief ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf interface brief command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf interface brief vrf default
show ip ospf interface brief vrf default
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf interface brief vrf default ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_intf": {
"ROW_intf": {
"admin_status": "up",
"area": "0.0.0.0",
"cost": "4",
"ifname": "Eth1/7",
"index": "3",
"nbr_total": "1",
"state_str": "DR"
}
},
"cname": "default",
"intf_count": "4",
"ptag": "100"
},
{
"TABLE_intf": {
"ROW_intf": [
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "2",
"ifname": "Vlan253",
"index": "4",
"nbr_total": "1",
"state_str": "P2P"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "40",
"ifname": "Vlan50",
"index": "3",
"nbr_total": "0",
"state_str": "DR"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "40",
"ifname": "Vlan8",
"index": "2",
"nbr_total": "0",
"state_str": "DR"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "1",
"ifname": "Lo0",
"index": "1",
"nbr_total": "0",
"state_str": "LOOPBACK"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "4",
"ifname": "Eth1/1",
"index": "7",
"nbr_total": "0",
"state_str": "DR"
}
]
},
"cname": "default",
"intf_count": "5",
"ptag": "1"
}
]
}
},
"code": "200",
"input": "show ip ospf interface brief vrf default ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf interface brief vrf default command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf interface brief vrf test
show ip ospf interface brief vrf test
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf interface brief vrf test ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": {
"TABLE_intf": {
"ROW_intf": [
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "4",
"ifname": "Eth1/45",
"index": "6",
"nbr_total": "1",
"state_str": "P2P"
},
{
"admin_status": "up",
"area": "0.0.0.0",
"cost": "5",
"ifname": "Eth1/46",
"index": "5",
"nbr_total": "1",
"state_str": "P2P"
}
]
},
"cname": "test",
"intf_count": "2",
"ptag": "1"
}
}
},
"code": "200",
"input": "show ip ospf interface brief vrf test ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf interface brief vrf test command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf interface ethernet1/1
show ip ospf interface ethernet1/1
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf interface ethernet1/1",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": {
"TABLE_intf": {
"ROW_intf": {
"addr": "10.100.90.129",
"admin_status": "up",
"area": "0.0.0.0",
"cost": "4",
"if_cfg": "true",
"ifname": "Ethernet1/1",
"index": "7",
"masklen": "30",
"passive": "true",
"proto_status": "up",
"state_str": "DR",
"type_str": "BROADCAST"
}
},
"cname": "default",
"ptag": "1"
}
}
},
"code": "200",
"input": "show ip ospf interface ethernet1/1",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf interface ethernet1/1 command, see the CLI command reference:
CLI Output |
---|
|
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:
CLI Output |
---|
|
show ip ospf interface vlan 50
show ip ospf interface vlan 50
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf interface vlan 50 ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": {
"TABLE_intf": {
"ROW_intf": {
"addr": "10.57.50.4",
"admin_status": "up",
"area": "0.0.0.0",
"cost": "40",
"if_cfg": "true",
"ifname": "Vlan50",
"index": "3",
"masklen": "24",
"passive": "true",
"proto_status": "up",
"state_str": "DR",
"type_str": "BROADCAST"
}
},
"cname": "default",
"ptag": "1"
}
}
},
"code": "200",
"input": "show ip ospf interface vlan 50 ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf interface vlan 50 command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf interface vrf test
show ip ospf interface vrf test
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf interface vrf test ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": {
"TABLE_intf": {
"ROW_intf": [
{
"addr": "7.57.253.5",
"admin_status": "up",
"area": "0.0.0.0",
"auth_type": "none",
"cost": "4",
"dead_interval": "40",
"hello_interval": "10",
"hello_timer": "PT6S",
"if_cfg": "true",
"ifname": "Ethernet1/45",
"index": "6",
"link_lsa_cnt": "0",
"link_lsa_crc": "0",
"masklen": "30",
"nbr_adjs": "1",
"nbr_flood": "1",
"nbr_total": "1",
"proto_status": "up",
"rxmt_interval": "5",
"state_str": "P2P",
"transmit_delay": "1",
"type_str": "P2P",
"wait_interval": "40"
},
{
"addr": "7.57.253.9",
"admin_status": "up",
"area": "0.0.0.0",
"auth_type": "none",
"cost": "5",
"dead_interval": "40",
"hello_interval": "10",
"hello_timer": "PT0S",
"if_cfg": "true",
"ifname": "Ethernet1/46",
"index": "5",
"link_lsa_cnt": "0",
"link_lsa_crc": "0",
"masklen": "30",
"nbr_adjs": "1",
"nbr_flood": "1",
"nbr_total": "1",
"proto_status": "up",
"rxmt_interval": "5",
"state_str": "P2P",
"transmit_delay": "1",
"type_str": "P2P",
"wait_interval": "40"
}
]
},
"cname": "test",
"ptag": "1"
}
}
},
"code": "200",
"input": "show ip ospf interface vrf test ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf interface vrf test command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf neighbors
show ip ospf neighbors
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf neighbors ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_nbr": {
"ROW_nbr": {
"addr": "192.168.161.1",
"drstate": "BDR",
"intf": "Eth1/7",
"priority": "1",
"rid": "1.1.1.1",
"state": "FULL",
"uptime": "P7DT11H59M45S"
}
},
"cname": "default",
"nbrcount": "1",
"ptag": "100"
},
{
"TABLE_nbr": {
"ROW_nbr": {
"addr": "7.57.253.1",
"drstate": " -",
"intf": "Vlan253",
"priority": "1",
"rid": "7.57.255.2",
"state": "FULL",
"uptime": "P7DT12H8S"
}
},
"cname": "default",
"nbrcount": "1",
"ptag": "1"
}
]
}
},
"code": "200",
"input": "show ip ospf neighbors ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf neighbors command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf neighbors vrf default
show ip ospf neighbors vrf default
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf neighbors vrf default ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_nbr": {
"ROW_nbr": {
"addr": "192.168.161.1",
"drstate": "BDR",
"intf": "Eth1/7",
"priority": "1",
"rid": "1.1.1.1",
"state": "FULL",
"uptime": "P7DT11H59M46S"
}
},
"cname": "default",
"nbrcount": "1",
"ptag": "100"
},
{
"TABLE_nbr": {
"ROW_nbr": {
"addr": "7.57.253.1",
"drstate": " -",
"intf": "Vlan253",
"priority": "1",
"rid": "7.57.255.2",
"state": "FULL",
"uptime": "P7DT12H9S"
}
},
"cname": "default",
"nbrcount": "1",
"ptag": "1"
}
]
}
},
"code": "200",
"input": "show ip ospf neighbors vrf default ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf neighbors vrf default command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf vrf all
show ip ospf vrf all
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf vrf all ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": [
{
"TABLE_area": {
"ROW_area": {
"act_intf": "1",
"age": "P7DT12H1M34S",
"aname": "0.0.0.0",
"auth_type": "none",
"backbone_active": "true",
"last_spf_run_time": "PT0S",
"loopback_intf": "0",
"lsa_cnt": "3",
"lsa_crc": "0xfb1d",
"no_summary": "false",
"nssa": "false",
"passive_intf": "0",
"spf_runs": "3",
"stub": "false",
"total_intf": "4"
}
},
"act_area_normal": "1",
"act_area_nssa": "0",
"act_area_stub": "0",
"act_area_total": "1",
"admin_dist": "110",
"area_normal": "1",
"area_nssa": "0",
"area_stub": "0",
"area_total": "1",
"asext_lsa_cnt": "0",
"asext_lsa_crc": "0",
"asopaque_lsa_cnt": "0",
"asopaque_lsa_crc": "0",
"cname": "default",
"gr_grace_period": "PT60S",
"gr_ha": "true",
"gr_last_status": "None",
"gr_planned_only": "true",
"gr_state": "inactive",
"instance_number": "2",
"is_abr": "false",
"is_asbr": "false",
"lsa_aging_pace": "10",
"lsa_hold_time": "PT5S",
"lsa_max_time": "PT5S",
"lsa_start_time": "PT0S",
"max_metric_adver": "false",
"min_lsa_arr_time": "PT1S",
"no_discard_rt_ext": "false",
"no_discard_rt_int": "false",
"ptag": "100",
"ref_bw": "40000",
"rid": "2.2.2.2",
"spf_hold_time": "PT1S",
"spf_max_paths": "8",
"spf_max_time": "PT5S",
"spf_start_time": "PT0S",
"stateful_ha": "true",
"support_opaque_lsa": "true",
"support_tos0_only": "true"
},
{
"TABLE_area": {
"ROW_area": {
"act_intf": "5",
"age": "P7DT12H1M45S",
"aname": "0.0.0.0",
"auth_type": "none",
"backbone_active": "true",
"last_spf_run_time": "PT0S",
"loopback_intf": "1",
"lsa_cnt": "2",
"lsa_crc": "0x32f1",
"no_summary": "false",
"nssa": "false",
"passive_intf": "3",
"spf_runs": "13",
"stub": "false",
"total_intf": "5"
}
},
"TABLE_redist": {
"ROW_redist": {
"proto": "static"
}
},
"act_area_normal": "1",
"act_area_nssa": "0",
"act_area_stub": "0",
"act_area_total": "1",
"admin_dist": "110",
"area_normal": "1",
"area_nssa": "0",
"area_stub": "0",
"area_total": "1",
"asext_lsa_cnt": "2",
"asext_lsa_crc": "0xc669",
"asopaque_lsa_cnt": "0",
"asopaque_lsa_crc": "0",
"cname": "default",
"gr_grace_period": "PT60S",
"gr_ha": "true",
"gr_last_status": "None",
"gr_planned_only": "true",
"gr_state": "inactive",
"instance_number": "1",
"is_abr": "false",
"is_asbr": "true",
"lsa_aging_pace": "10",
"lsa_hold_time": "PT5S",
"lsa_max_time": "PT5S",
"lsa_start_time": "PT0S",
"max_metric_adver": "false",
"min_lsa_arr_time": "PT1S",
"no_discard_rt_ext": "false",
"no_discard_rt_int": "false",
"passive_dflt": "true",
"ptag": "1",
"ref_bw": "40000",
"rid": "7.57.255.1",
"spf_hold_time": "PT1S",
"spf_max_paths": "8",
"spf_max_time": "PT5S",
"spf_start_time": "PT0S",
"stateful_ha": "true",
"support_opaque_lsa": "true",
"support_tos0_only": "true"
},
{
"TABLE_area": {
"ROW_area": {
"act_intf": "2",
"age": "P7DT12H1M34S",
"aname": "0.0.0.0",
"auth_type": "none",
"backbone_active": "true",
"last_spf_run_time": "PT0S",
"loopback_intf": "0",
"lsa_cnt": "2",
"lsa_crc": "0x140bb",
"no_summary": "false",
"nssa": "false",
"passive_intf": "0",
"spf_runs": "6",
"stub": "false",
"total_intf": "2"
}
},
"act_area_normal": "1",
"act_area_nssa": "0",
"act_area_stub": "0",
"act_area_total": "1",
"admin_dist": "110",
"area_normal": "1",
"area_nssa": "0",
"area_stub": "0",
"area_total": "1",
"asext_lsa_cnt": "0",
"asext_lsa_crc": "0",
"asopaque_lsa_cnt": "0",
"asopaque_lsa_crc": "0",
"cname": "test",
"gr_grace_period": "PT60S",
"gr_ha": "true",
"gr_last_status": "None",
"gr_planned_only": "true",
"gr_state": "inactive",
"instance_number": "1",
"is_abr": "false",
"is_asbr": "false",
"lsa_aging_pace": "10",
"lsa_hold_time": "PT5S",
"lsa_max_time": "PT5S",
"lsa_start_time": "PT0S",
"max_metric_adver": "false",
"min_lsa_arr_time": "PT1S",
"no_discard_rt_ext": "false",
"no_discard_rt_int": "false",
"ptag": "1",
"ref_bw": "40000",
"rid": "7.57.253.9",
"spf_hold_time": "PT1S",
"spf_max_paths": "8",
"spf_max_time": "PT5S",
"spf_start_time": "PT0S",
"stateful_ha": "true",
"support_opaque_lsa": "true",
"support_tos0_only": "true"
}
]
}
},
"code": "200",
"input": "show ip ospf vrf all ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf vrf all command, see the CLI command reference:
CLI Output |
---|
|
show ip ospf vrf test
show ip ospf vrf test
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show ip ospf vrf test ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"outputs": {
"output": {
"body": {
"TABLE_ctx": {
"ROW_ctx": {
"TABLE_area": {
"ROW_area": {
"act_intf": "2",
"age": "P7DT12H1M37S",
"aname": "0.0.0.0",
"auth_type": "none",
"backbone_active": "true",
"last_spf_run_time": "PT0S",
"loopback_intf": "0",
"lsa_cnt": "2",
"lsa_crc": "0x140bb",
"no_summary": "false",
"nssa": "false",
"passive_intf": "0",
"spf_runs": "6",
"stub": "false",
"total_intf": "2"
}
},
"act_area_normal": "1",
"act_area_nssa": "0",
"act_area_stub": "0",
"act_area_total": "1",
"admin_dist": "110",
"area_normal": "1",
"area_nssa": "0",
"area_stub": "0",
"area_total": "1",
"asext_lsa_cnt": "0",
"asext_lsa_crc": "0",
"asopaque_lsa_cnt": "0",
"asopaque_lsa_crc": "0",
"cname": "test",
"gr_grace_period": "PT60S",
"gr_ha": "true",
"gr_last_status": "None",
"gr_planned_only": "true",
"gr_state": "inactive",
"instance_number": "1",
"is_abr": "false",
"is_asbr": "false",
"lsa_aging_pace": "10",
"lsa_hold_time": "PT5S",
"lsa_max_time": "PT5S",
"lsa_start_time": "PT0S",
"max_metric_adver": "false",
"min_lsa_arr_time": "PT1S",
"no_discard_rt_ext": "false",
"no_discard_rt_int": "false",
"ptag": "1",
"ref_bw": "40000",
"rid": "7.57.253.9",
"spf_hold_time": "PT1S",
"spf_max_paths": "8",
"spf_max_time": "PT5S",
"spf_start_time": "PT0S",
"stateful_ha": "true",
"support_opaque_lsa": "true",
"support_tos0_only": "true"
}
}
},
"code": "200",
"input": "show ip ospf vrf test ",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show ip ospf vrf test command, see the CLI command reference:
CLI Output |
---|
|