Create and Delete "General Purpose" droplet via API

October 22, 2019 117 views
DigitalOcean API and CLI (doctl)

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?

2 Answers

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:

Have another answer? Share your knowledge.