DO Ideas 2

Add completion prediction to API actions based on globally monitored stats

This request is somewhat similar to: https://digitalocean.uservoice.com/forums/136585-digitalocean/suggestions/12333720-improve-api-v2-with-progress-property

However, knowing the percentage completion could be insufficient if the client software would rather know approximately when an action will probably be completed. Currently, the /v2/actions API has to be queried to get the status of an action. Since there is no way to know when an action *might* complete, the API has to be repeatedly queried, which chugs through API calls (5,000 API calls starts looking rather small when this limitation is hit). You know your own network conditions, so you can probably build something to reasonably guess when any given task will complete and can tell the client making the request to effectively "back off until" some time in the future. From there, the client could show a progress bar or responsibly wait until that time passes and then run another query at which point the action might have completed or your system returns another future completion prediction. The net result is a much more powerful solution to waiting for actions to complete than a strict percentage-based value. Both ideas have merit though since, for example, transferring a snapshot between regions has hard and fast numbers (i.e. how much data has been transferred to the other data center) while rebooting a Droplet is much more vague.

Also for consideration: WebSocket support for actions. Clients could then wait for an action to complete in near-perfect network silence and the server-side can immediately notify the client when the monitored action changes status.

  • mj62
  • Sep 11 2018
  • Attach files