cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
637
Views
0
Helpful
0
Replies

get device interface informaiton to use restconf

yu-inoue1
Level 1
Level 1

I tried to get device interface informaiton to use restconf.

I could do it.

But very slowly.

 

code is there 

---

def getinfo(host):
    url = "https://{h}:443/restconf/data/Cisco-IOS-XE-native:native/interface".format(h=host)

    # RESTCONF media types for REST API headers
    headers = {'Content-Type': 'application/yang-data+json','Accept': 'application/yang-data+json'}
    # this statement performs a PUT on the specified url
   response = requests.request("GET",url, auth=(USER, PASS),headers=headers, verify=False)

---

 

It takes 30 seconds to collect the information.

Is this normal?

0 Replies 0