Headline:
After creating a new cloud, the initial status is set to “ok”.
Description:
After creating a cloud via the API (or GUI), the initial status is set to “ok” and then eventually “syncing” and then back to “ok”. The issue is when doing this programmatically via the API, determining when the sync has truly been completed. The workaround has been to put a sleep timer of some seconds prior, then check if the cloud is in a “syncing” state and then keep checking for it to return to “ok”. However, it has been noticed in some cases the initial sync can take up to two minutes to start and it remains in “ok”, so the sleep timer method may be inaccurate or needs to be adjusted to be much greater.
When a cloud is created, if it could be placed into the status of either “syncing” or “queued”, just not “ok”, this would allow the checking of the status immediately and wait for an “ok” status to know it has completed.
The workaround in code is to wait for the zone.lastUpdated field to change to something other than NULL. If it is ever NULL, then it is before the first sync.
Thanks for the idea! Unfortunately, the lastUpdated is set at the same time as created. Here is a snippet for doing a GET on the API just after submitting a cloud: