I am interested in a reliable way of launching droplets over API. I want to know how to check for all possible errors and how to detect if a new droplet is finally running.
Just doing POST to /v2/droplets sometimes might not be enough. I had following problems:
It looks quite complex to me.
What would be a reliable yet simple approach to launch droplets that works around all possible cases and keeps working even if you have hundreds of droplets?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Personally on my own projects I use a system where one script sends the create command to the API using the Ruby library (there are libraries for most common languages that make this a lot easier) and store it’s data in a database with a status of “creating”. I then have a second script that checks for droplets that are listed in the db in that status and every 30seconds or so it queries the API for that droplet to get it’s status. Once the API says the droplet is active it updates the db so it stops querying.
That may be a bit more complex that what you need but the overall concept:
https://github.com/Radau/DigitalOcean-Starbound-Backup-and-Restore
Make-snapshot-and-destroy or restore in one launch (unless DO API starts bugging again).
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.