Linode API - Create instance, how do I know the "progress"?
Hello Linode fellow;
We're facing a technical bottleneck here. When creating a "Linode instance" (https://api.linode.com/v4/linode/instances), the response is the details of the instance being created with the status "provisioning". This may take a few minutes to change the status to "running". We cannot ask users to wait a few minutes on the UI. We want to show our users the "progress" (such as the progress shown in % on the Linode cloud manager).
Is that something like a callback or a return URL provided? So that we can listen to it, and Linode will call us once the instance has been "running".
Your advice or ideas will be greatly appreciated.
Thank you.
regards;
Lim
1 Reply
After doing some digging I can confirm there isn't an API call to simulate the provisioning percentage of an instance at the moment. There are a couple different ways you can go about this.
You can make your own progress bar ranging from 0% - 100% with a status being assigned to a value. For example, provisioning could be set to 0, booting could be set to 50%, and running could be set to 100%. You could also just design a simple progress bar to load from 0 - 100. Below are some resources on how to do so:
There is also the option to use an API call to filter your newly deployed instance and check its status. I'd recommend filtering by the Linode ID or the Linode label. The only thing is you'd have to keep running the API call until you receive output with a "running" status. You can use the following query:
curl -H "Authorization: Bearer $TOKEN" https://api.linode.com/v4/linode/instances -H 'X-Filter: { "id": "linode_ID" }'
Since this seems like this would be a useful feature for other customers as well, I went ahead an made a feature request on your behalf and escalated it to the appropriate team. Thanks for the suggestion!