cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
623
Views
5
Helpful
4
Replies

RESTCONF Timeout

 

Hi all!

I hope you all doing well. 

I am working with RESTCONF but i could not edit the timeout, is there any way? 

this is my code, i set the timeout to 300, but i still get error. 

Thanks in advance

 def configure_device(xml_payload,**dev_inf):
response = requests.patch(
url = dev_inf["host"] ,
auth = (dev_inf["username"],dev_inf["password"]),
headers = dev_inf["headers"],
data = xml_payload ,
verify = False , timeout = 300 )
if response.status_code == 204:
print(" configuration successful",dev_inf["name"])
else:
print("Error configuring : " + str(response.status_code) + " " + response.text)

 

4 Replies 4

yawming
Cisco Employee
Cisco Employee

Can you please provide more detail ?

What is time out for and what kind of  error you got ?

yes!

so in the xml_payload, I have configurations encoded in XML and imagine it is huge. when I send the requests.patch I got error 504 which is for the time out. However, the router would be configured after the error .

So I guess the timeout should be increased but the timeout inside the requests.patch, I feel is not working?

Am I clear enough?

 

Thanks, I understand you issue now. It's 504, I doubt that we can "ask" more time from client side.

Marcel Zehnder
Spotlight
Spotlight

Not sure if this is working, but try to increase the life value on the router:

ip http timeout-policy idle 180 life 1200 requests 1

Screenshot 2023-02-28 at 07.23.44.png