Skip to main content

droplet_autoscale_pools

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

Overview

Namedroplet_autoscale_pools
TypeResource
Iddigitalocean.compute.droplet_autoscale_pools

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called autoscale_pool. This will be
set to a JSON object that contains the standard autoscale pool attributes.

NameDatatypeDescription
idstringA unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation. (example: 0d3db13e-a604-4944-9827-7ec2642d32ac)
namestringThe human-readable name set for the autoscale pool. (example: my-autoscale-pool)
active_resources_countintegerThe number of active Droplets in the autoscale pool.
configobjectThe scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
created_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created. (title: The creation time of the autoscale pool, example: 2020-07-28T18:00:00Z)
current_utilizationobject
droplet_templateobject
statusstringThe current status of the autoscale pool. (example: active)
updated_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated. (title: When the autoscale pool was last updated, example: 2020-07-28T18:00:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
autoscalepools_getselectautoscale_pool_idTo show information about an individual autoscale pool, send a GET request to
/v2/droplets/autoscale/$AUTOSCALE_POOL_ID.
autoscalepools_listselectper_page, page, nameTo list all autoscale pools in your team, send a GET request to /v2/droplets/autoscale.
The response body will be a JSON object with a key of autoscale_pools containing an array of autoscale pool objects.
These each contain the standard autoscale pool attributes.
autoscalepools_createinsertdata__name, data__config, data__droplet_templateTo create a new autoscale pool, send a POST request to /v2/droplets/autoscale setting the required attributes.

The response body will contain a JSON object with a key called autoscale_pool containing the standard attributes for the new autoscale pool.
autoscalepools_updatereplaceautoscale_pool_id, data__name, data__config, data__droplet_templateTo update the configuration of an existing autoscale pool, send a PUT request to
/v2/droplets/autoscale/$AUTOSCALE_POOL_ID. The request must contain a full representation
of the autoscale pool including existing attributes.
autoscalepools_deletedeleteautoscale_pool_idTo destroy an autoscale pool, send a DELETE request to the /v2/droplets/autoscale/$AUTOSCALE_POOL_ID endpoint.

A successful response will include a 202 response code and no content.
autoscalepools_delete_dangerousexecautoscale_pool_id, X-DangerousTo destroy an autoscale pool and its associated resources (Droplets),
send a DELETE request to the /v2/droplets/autoscale/$AUTOSCALE_POOL_ID/dangerous endpoint.

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
X-DangerousbooleanAcknowledge this action will destroy the autoscale pool and its associated resources and can not be reversed. (example: true)
autoscale_pool_idstringA unique identifier for an autoscale pool. (example: 0d3db13e-a604-4944-9827-7ec2642d32ac)
namestringThe name of the autoscale pool (example: my-autoscale-pool)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

To show information about an individual autoscale pool, send a GET request to
/v2/droplets/autoscale/$AUTOSCALE_POOL_ID.

SELECT
id,
name,
active_resources_count,
config,
created_at,
current_utilization,
droplet_template,
status,
updated_at
FROM digitalocean.compute.droplet_autoscale_pools
WHERE autoscale_pool_id = '{{ autoscale_pool_id }}' -- required;

INSERT examples

To create a new autoscale pool, send a POST request to /v2/droplets/autoscale setting the required attributes.

The response body will contain a JSON object with a key called autoscale_pool containing the standard attributes for the new autoscale pool.

INSERT INTO digitalocean.compute.droplet_autoscale_pools (
data__name,
data__config,
data__droplet_template
)
SELECT
'{{ name }}' --required,
'{{ config }}' --required,
'{{ droplet_template }}' --required
RETURNING
autoscale_pool
;

REPLACE examples

To update the configuration of an existing autoscale pool, send a PUT request to
/v2/droplets/autoscale/$AUTOSCALE_POOL_ID. The request must contain a full representation
of the autoscale pool including existing attributes.

REPLACE digitalocean.compute.droplet_autoscale_pools
SET
data__name = '{{ name }}',
data__config = '{{ config }}',
data__droplet_template = '{{ droplet_template }}'
WHERE
autoscale_pool_id = '{{ autoscale_pool_id }}' --required
AND data__name = '{{ name }}' --required
AND data__config = '{{ config }}' --required
AND data__droplet_template = '{{ droplet_template }}' --required
RETURNING
autoscale_pool;

DELETE examples

To destroy an autoscale pool, send a DELETE request to the /v2/droplets/autoscale/$AUTOSCALE_POOL_ID endpoint.

A successful response will include a 202 response code and no content.

DELETE FROM digitalocean.compute.droplet_autoscale_pools
WHERE autoscale_pool_id = '{{ autoscale_pool_id }}' --required;

Lifecycle Methods

To destroy an autoscale pool and its associated resources (Droplets),
send a DELETE request to the /v2/droplets/autoscale/$AUTOSCALE_POOL_ID/dangerous endpoint.

EXEC digitalocean.compute.droplet_autoscale_pools.autoscalepools_delete_dangerous 
@autoscale_pool_id='{{ autoscale_pool_id }}' --required,
@X-Dangerous='{{ X-Dangerous }}' --required;