asb
By:
asb

High CPU Droplet availability via the DigtialOcean API

October 12, 2017 86 views
DigitalOcean API

Are High CPU Droplet available via the DigtialOcean API? Are there any special considerations when creating them via the API?

1 Answer

High CPU Droplets can be created via the DigitalOcean API like any other Droplet. In order to use them, provide a "size slug" prefixed with c- when creating your Droplet.

Slug Memory CPUs
c-2 3 GB 2
c-4 6 GB 4
c-8 12 GB 8
c-16 24 GB 16
c-32 48 GB 32
c-48 72 GB 48

For example:

curl -X POST -H "Content-Type: application/json" \
    -H "Authorization: Bearer $DO_TOKEN" \
    -d '{"name":"example.com","region":"nyc3","size":"c-32","image":"ubuntu-14-04-x64", "monitoring": true, "tags":["web"]}' \
    "https://api.digitalocean.com/v2/droplets"

High CPU Droplets may have limited availability in certain datacenters. When a Droplet create is unsuccessful because of insufficient capacity, the API call will return an error message in the following format with 422 for the HTTP status code. The available_regions key will contain a list of regions which can currently handle the desired High-CPU Droplet of that size at that time.

{
  "id": "unprocessable_entity",
  "message": "The size you selected is temporarily unavailable because of High CPU server capacity",
  "error_attributes": {
    "available_regions": [
      "nyc3",
      "nyc1",
      "sfo2"
    ]
  }
}
Have another answer? Share your knowledge.