pydo.sizes.list()

Description

To list all of available Droplet sizes, send a GET request to /v2/sizes. The response will be a JSON object with a key called sizes. The value of this will be an array of size objects each of which contain the standard size attributes.

Parameters

Name Type Required Description Default Value
per_page integer False Number of items returned per page 20
page integer False Which ‘page’ of paginated results to return. 1

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

resp = client.sizes.list()

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

A JSON object with a key called sizes. The value of this will be an array of size objects each of which contain the standard size attributes.

Click to expand an example response.
{
  "sizes": [
    {
      "slug": "s-1vcpu-1gb",
      "memory": 1024,
      "vcpus": 1,
      "disk": 25,
      "transfer": 1,
      "price_monthly": 5,
      "price_hourly": 0.00743999984115362,
      "regions": [
        "ams2",
        "ams3",
        "blr1",
        "fra1",
        "lon1",
        "nyc1",
        "nyc2",
        "nyc3",
        "sfo1",
        "sfo2",
        "sfo3",
        "sgp1",
        "tor1"
      ],
      "available": true,
      "description": "Basic",
      "disk_info": [
        {
          "type": "local",
          "size": {
            "amount": 25,
            "unit": "gib"
          }
        }
      ]
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/sizes?page=64&per_page=1",
      "next": "https://api.digitalocean.com/v2/sizes?page=2&per_page=1"
    }
  },
  "meta": {
    "total": 64
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}