By yuwono
In DO there are four types of droplets: Standard, General Purpose, CPU Optimized, and Memory Optimized droplet.
Is it possible to create and delete “General Purpose” droplet via API? If yes, are there samples on how to do it?
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!
Hello, @yuwono
I will recommend you to check our tutorial for using the API:
https://www.digitalocean.com/docs/api/example-usage/
You can also check these two links:
https://developers.digitalocean.com/documentation/v2/#create-a-new-droplet https://developers.digitalocean.com/documentation/v2/#delete-a-droplet
Hope this helps!
Adding a bit to @alexdo’s answer, when you create a Droplet via the API, you will supply a “size slug.” Size slugs are human-readable strings used to specify the type of Droplet in certain API requests. They are comprised of the identifier for the Droplet’s class, the vCPU count, and the amount of RAM. For example, the $5 per month Standard Droplet comes with 1 vCPU and 1 GB of RAM. So its size slug is: s-1vcpu-1gb
Size slugs for General Purpose Droplets are prefixed with g- So the 8 GB RAM, 2 CPU General Purpose Droplet would be g-2vcpu-8gb
In order to get a full list of all the available Droplet sizes and their corresponding size slugs, you can:
/v2/sizes API endpoint if you need to access them programmaticallydoctl compute sizes listGet 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.