Skip to main content

sizes

Creates, updates, deletes, gets or lists a sizes resource.

Overview

Namesizes
TypeResource
Iddigitalocean.compute.sizes

Fields

The following fields are returned by SELECT queries:

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.

NameDatatypeDescription
availablebooleanThis is a boolean value that represents whether new Droplets can be created with this size.
descriptionstringA string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized. (example: Basic)
diskintegerThe amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
disk_infoarrayAn array of objects containing information about the disks available to Droplets created with this size.
gpu_infoobjectAn object containing information about the GPU capabilities of Droplets created with this size.
memoryintegerThe amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
price_hourlynumber (float)This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
price_monthlynumber (float)This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
regionsarrayAn array containing the region slugs where this size is available for Droplet creates.
slugstringA human-readable string that is used to uniquely identify each size. (example: s-1vcpu-1gb)
transfernumber (float)The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
vcpusintegerThe number of CPUs allocated to Droplets of this size.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
sizes_listselectper_page, pageTo 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

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

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.

SELECT
available,
description,
disk,
disk_info,
gpu_info,
memory,
price_hourly,
price_monthly,
regions,
slug,
transfer,
vcpus
FROM digitalocean.compute.sizes
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}';