# Autoscale ## Create **post** `/v2/droplets/autoscale` 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. ### Returns - **autoscale\_pool:** `AutoscalePool` ## Retrieve **get** `/v2/droplets/autoscale/{autoscale_pool_id}` To show information about an individual autoscale pool, send a GET request to `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`. ### Returns - **autoscale\_pool:** `AutoscalePool` ## Update **put** `/v2/droplets/autoscale/{autoscale_pool_id}` 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. ### Returns - **autoscale\_pool:** `AutoscalePool` ## List **get** `/v2/droplets/autoscale` To 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. ### Returns - **meta:** `MetaProperties` Information about the response itself. - **autoscale\_pools:** `array of AutoscalePool` - **links:** `PageLinks` ## Delete **delete** `/v2/droplets/autoscale/{autoscale_pool_id}` 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 Dangerous **delete** `/v2/droplets/autoscale/{autoscale_pool_id}/dangerous` To destroy an autoscale pool and its associated resources (Droplets), send a DELETE request to the `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/dangerous` endpoint. ## List History **get** `/v2/droplets/autoscale/{autoscale_pool_id}/history` To list all of the scaling history events of an autoscale pool, send a GET request to `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/history`. The response body will be a JSON object with a key of `history`. This will be set to an array containing objects each representing a history event. ### Returns - **meta:** `MetaProperties` Information about the response itself. - **history:** `array of object { created_at, current_instance_count, desired_instance_count, 4 more }` - **created\_at:** `string` The creation time of the history event in ISO8601 combined date and time format. - **current\_instance\_count:** `number` The current number of Droplets in the autoscale pool. - **desired\_instance\_count:** `number` The target number of Droplets for the autoscale pool after the scaling event. - **history\_event\_id:** `string` The unique identifier of the history event. - **reason:** `"CONFIGURATION_CHANGE" or "SCALE_UP" or "SCALE_DOWN"` The reason for the scaling event. - `"CONFIGURATION_CHANGE"` - `"SCALE_UP"` - `"SCALE_DOWN"` - **status:** `"in_progress" or "success" or "error"` The status of the scaling event. - `"in_progress"` - `"success"` - `"error"` - **updated\_at:** `string` The last updated time of the history event in ISO8601 combined date and time format. - **links:** `PageLinks` ## List Members **get** `/v2/droplets/autoscale/{autoscale_pool_id}/members` To list the Droplets in an autoscale pool, send a GET request to `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/members`. The response body will be a JSON object with a key of `droplets`. This will be set to an array containing information about each of the Droplets in the autoscale pool. ### Returns - **meta:** `MetaProperties` Information about the response itself. - **droplets:** `array of object { created_at, current_utilization, droplet_id, 3 more }` - **created\_at:** `string` The creation time of the Droplet in ISO8601 combined date and time format. - **current\_utilization:** `object { cpu, memory }` - **cpu:** `number` The CPU utilization average of the individual Droplet. - **memory:** `number` The memory utilization average of the individual Droplet. - **droplet\_id:** `number` The unique identifier of the Droplet. - **health\_status:** `string` The health status of the Droplet. - **status:** `"provisioning" or "active" or "deleting" or "off"` The power status of the Droplet. - `"provisioning"` - `"active"` - `"deleting"` - `"off"` - **updated\_at:** `string` The last updated time of the Droplet in ISO8601 combined date and time format. - **links:** `PageLinks` ## Domain Types ### Autoscale Pool - **AutoscalePool:** `object { id, active_resources_count, config, 6 more }` - **id:** `string` A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation. - **active\_resources\_count:** `number` The number of active Droplets in the autoscale pool. - **config:** `AutoscalePoolStaticConfig or AutoscalePoolDynamicConfig` The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration). - `AutoscalePoolStaticConfig` - `AutoscalePoolDynamicConfig` - **created\_at:** `string` A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created. - **droplet\_template:** `AutoscalePoolDropletTemplate` - **name:** `string` The human-readable name set for the autoscale pool. - **status:** `"active" or "deleting" or "error"` The current status of the autoscale pool. - `"active"` - `"deleting"` - `"error"` - **updated\_at:** `string` A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated. - **current\_utilization:** `CurrentUtilization` ### Autoscale Pool Droplet Template - **AutoscalePoolDropletTemplate:** `object { image, region, size, 8 more }` - **image:** `string` The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID. - **region:** `"nyc1" or "nyc2" or "nyc3" or 11 more` The datacenter in which all of the Droplets will be created. - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"ams2"` - `"ams3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"lon1"` - `"fra1"` - `"tor1"` - `"blr1"` - `"syd1"` - **size:** `string` The Droplet size to be used for all Droplets in the autoscale pool. - **ssh\_keys:** `array of string` The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint. Requires `ssh_key:read` scope. - **ipv6:** `boolean` Assigns a unique IPv6 address to each of the Droplets in the autoscale pool. - **name:** `string` The name(s) to be applied to all Droplets in the autoscale pool. - **project\_id:** `string` The project that the Droplets in the autoscale pool will belong to. Requires `project:read` scope. - **tags:** `array of string` The tags to apply to each of the Droplets in the autoscale pool. Requires `tag:read` scope. - **user\_data:** `string` A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size. - **vpc\_uuid:** `string` The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets. Requires `vpc:read` scope. - **with\_droplet\_agent:** `boolean` Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling. ### Autoscale Pool Dynamic Config - **AutoscalePoolDynamicConfig:** `object { max_instances, min_instances, cooldown_minutes, 2 more }` - **max\_instances:** `number` The maximum number of Droplets in an autoscale pool. - **min\_instances:** `number` The minimum number of Droplets in an autoscale pool. - **cooldown\_minutes:** `number` The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes. - **target\_cpu\_utilization:** `number` Target CPU utilization as a decimal. - **target\_memory\_utilization:** `number` Target memory utilization as a decimal. ### Autoscale Pool Static Config - **AutoscalePoolStaticConfig:** `object { target_number_instances }` - **target\_number\_instances:** `number` Fixed number of instances in an autoscale pool. ### Current Utilization - **CurrentUtilization:** `object { cpu, memory }` - **cpu:** `number` The average CPU utilization of the autoscale pool. - **memory:** `number` The average memory utilization of the autoscale pool.