02-27-2023 10:35 AM - last edited on 02-27-2023 12:00 PM by Paul Zimmerman
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)
02-27-2023 01:17 PM - edited 02-27-2023 01:21 PM
Can you please provide more detail ?
What is time out for and what kind of error you got ?
02-27-2023 02:36 PM
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?
02-27-2023 03:53 PM
Thanks, I understand you issue now. It's 504, I doubt that we can "ask" more time from client side.
02-27-2023 10:24 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide