HewlettPackard / python-hpOneView

DEPRECATED - no longer actively maintained. New repository: https://github.com/HewlettPackard/oneview-python
MIT License
87 stars 57 forks source link

Timeout #218

Closed herrryan closed 7 years ago

herrryan commented 7 years ago

Is there a way to set timeout for requests when using Restful API?

tiagomtotti commented 7 years ago

Hi @herrryan,

If you're using the Python SDK to connect to the REST API, you can specify the timeout as an argument to the create and update methods. The default behavior is to wait until the Task finishes in the OneView Appliance.

For instance, to create a fc network, you can use the following snippet: fc_network = oneview_client.fc_networks.create(options)

If you'd like to set a timeout, you can specify the parameter: fc_network = oneview_client.fc_networks.create(options, timeout=500)

Note that this is just a timeout for the Python client to wait for the task. It won't affect the processing of the task in OneView.

herrryan commented 7 years ago

thanks for the feedback. I will definitely try it out.