COSC Learning Lab: Quick Start: Curl


In [1]:
!curl -i http://localhost:8181/restconf/config/opendaylight-inventory:nodes






{"nodes":{"node":[{"id":"xrvr-1"},{"id":"xrvr-2"},{"id":"controller-config"},{"id":"xrvr-999"}]}}

In [2]:
device_name='xrvr-2'
!curl -i http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/node/{device_name}/yang-ext:mount/Cisco-IOS-XR-ifmgr-oper:interface-properties






{"interface-properties":{"data-nodes":{"data-node":[{"data-node-name":"0/0/CPU0","system-view":{"interfaces":{"interface":[{"interface-name":"MgmtEth0/0/CPU0/0","encapsulation":"ether","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"MgmtEth0/0/CPU0/0","actual-line-state":"im-state-up","type":"IFT_ETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"Null0","encapsulation":"null","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"Null0","actual-line-state":"im-state-up","type":"IFT_NULL","actual-state":"im-state-up","encapsulation-type-string":"Null","mtu":1500,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"GigabitEthernet0/0/0/2","encapsulation":"ether","bandwidth":1000000,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"GigabitEthernet0/0/0/2","actual-line-state":"im-state-up","type":"IFT_GETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"FINT0/0/CPU0","encapsulation":"fint_base","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"FINT0/0/CPU0","actual-line-state":"im-state-up","type":"IFT_FINT_INTF","actual-state":"im-state-up","encapsulation-type-string":"FINT_BASE_CAPS","mtu":8000,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"Loopback0","encapsulation":"loopback","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"Loopback0","actual-line-state":"im-state-up","type":"IFT_LOOPBACK","actual-state":"im-state-up","encapsulation-type-string":"Loopback","mtu":1500,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"GigabitEthernet0/0/0/1","encapsulation":"ether","bandwidth":1000000,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"GigabitEthernet0/0/0/1","actual-line-state":"im-state-up","type":"IFT_GETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"GigabitEthernet0/0/0/0","encapsulation":"ether","bandwidth":1000000,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"GigabitEthernet0/0/0/0","actual-line-state":"im-state-up","type":"IFT_GETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"nV-Loopback0","encapsulation":"nv_loopback","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"nV-Loopback0","actual-line-state":"im-state-up","type":"IFT_NV_LOOPBACK","actual-state":"im-state-up","encapsulation-type-string":"nV-Loopback","mtu":1500,"state":"im-state-up","line-state":"im-state-up"}]}},"locationviews":{"locationview":[{"locationview-name":"0/0/CPU0","interfaces":{"interface":[{"interface-name":"MgmtEth0/0/CPU0/0","encapsulation":"ether","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"MgmtEth0/0/CPU0/0","actual-line-state":"im-state-up","type":"IFT_ETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"Null0","encapsulation":"null","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"Null0","actual-line-state":"im-state-up","type":"IFT_NULL","actual-state":"im-state-up","encapsulation-type-string":"Null","mtu":1500,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"GigabitEthernet0/0/0/2","encapsulation":"ether","bandwidth":1000000,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"GigabitEthernet0/0/0/2","actual-line-state":"im-state-up","type":"IFT_GETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"FINT0/0/CPU0","encapsulation":"fint_base","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"FINT0/0/CPU0","actual-line-state":"im-state-up","type":"IFT_FINT_INTF","actual-state":"im-state-up","encapsulation-type-string":"FINT_BASE_CAPS","mtu":8000,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"Loopback0","encapsulation":"loopback","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"Loopback0","actual-line-state":"im-state-up","type":"IFT_LOOPBACK","actual-state":"im-state-up","encapsulation-type-string":"Loopback","mtu":1500,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"GigabitEthernet0/0/0/1","encapsulation":"ether","bandwidth":1000000,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"GigabitEthernet0/0/0/1","actual-line-state":"im-state-up","type":"IFT_GETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"GigabitEthernet0/0/0/0","encapsulation":"ether","bandwidth":1000000,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"GigabitEthernet0/0/0/0","actual-line-state":"im-state-up","type":"IFT_GETHERNET","actual-state":"im-state-up","encapsulation-type-string":"ARPA","mtu":1514,"state":"im-state-up","line-state":"im-state-up"},{"interface-name":"nV-Loopback0","encapsulation":"nv_loopback","bandwidth":0,"sub-interface-mtu-overhead":0,"l2-transport":false,"interface":"nV-Loopback0","actual-line-state":"im-state-up","type":"IFT_NV_LOOPBACK","actual-state":"im-state-up","encapsulation-type-string":"nV-Loopback","mtu":1500,"state":"im-state-up","line-state":"im-state-up"}]}}]}}]}}}