#NetApp REST API best practice for creating resources

1 messages · Page 1 of 1 (latest)

plush bay
#

Hello team,

I'm a GTS covering Bloomberg and my customer has the following question regarding Best Practice for creating resources.

Please review and offer some guidance, asap.

Thanks,
-Mike

humble moss
#

I'd recommend reading more in this section of the REST API documentation
https://docs.netapp.com/us-en/ontap-restapi/ontap/getting_started_with_the_ontap_rest_api.html#Synchronous_and_asynchronous_operations

the Python library implements this strategey by automatically polling jobs. By default it's once every 5 seconds for 30 seconds and then it times out if the job is not complete. Some jobs take much more than 30 seconds to complete (an upgrade job can take hours). And depending on how much load the cluster is under, the same job can take different amount of time. It's up to the user to specify how often and how many times to poll before timing out and failing the automation. The Python library allows you to modify the defaults.

There is also an option to turn some asynchronous operations that typically return jobs to become more synchronous by setting return_records query parameter to true and by setting return_timeout query parameter to the number of seconds to wait until the job is complete. By doing so, ONTAP will not return a response until either the job is complete (where it would respond with the records created/modified/deleted) OR until timeout is reached.

#

Please let me know if this helps answer the questions about best practices

plush bay
plush bay
#

@humble moss Customer said that was exactly what they needed! Thanks agian!