# Autoscale ## Create `client.gpuDroplets.autoscale.create(AutoscaleCreateParamsbody, RequestOptionsoptions?): AutoscaleCreateResponse` **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. ### Parameters - `body: AutoscaleCreateParams` - `config: AutoscalePoolStaticConfig | 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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. - `AutoscalePoolDynamicConfig` - `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. - `droplet_template: AutoscalePoolDropletTemplate` - `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" | "nyc2" | "nyc3" | 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` 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` 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. - `name: string` The human-readable name of the autoscale pool. This field cannot be updated ### Returns - `AutoscaleCreateResponse` - `autoscale_pool?: AutoscalePool` - `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 | 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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. - `AutoscalePoolDynamicConfig` - `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. - `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` - `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" | "nyc2" | "nyc3" | 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` 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` 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. - `name: string` The human-readable name set for the autoscale pool. - `status: "active" | "deleting" | "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` - `cpu?: number` The average CPU utilization of the autoscale pool. - `memory?: number` The average memory utilization of the autoscale pool. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const autoscale = await client.gpuDroplets.autoscale.create({ config: { min_instances: 1, max_instances: 5, target_cpu_utilization: 0.5, cooldown_minutes: 10 }, droplet_template: { name: 'example.com', region: 'nyc3', size: 'c-2', image: 'ubuntu-20-04-x64', ssh_keys: ['3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45'], backups: true, ipv6: true, monitoring: true, tags: ['env:prod', 'web'], user_data: '#cloud-config\nruncmd:\n - touch /test.txt\n', vpc_uuid: '760e09ef-dc84-11e8-981e-3cfdfeaae000', }, name: 'my-autoscale-pool', }); console.log(autoscale.autoscale_pool); ``` ## Retrieve `client.gpuDroplets.autoscale.retrieve(stringautoscalePoolID, RequestOptionsoptions?): AutoscaleRetrieveResponse` **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`. ### Parameters - `autoscalePoolID: string` ### Returns - `AutoscaleRetrieveResponse` - `autoscale_pool?: AutoscalePool` - `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 | 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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. - `AutoscalePoolDynamicConfig` - `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. - `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` - `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" | "nyc2" | "nyc3" | 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` 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` 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. - `name: string` The human-readable name set for the autoscale pool. - `status: "active" | "deleting" | "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` - `cpu?: number` The average CPU utilization of the autoscale pool. - `memory?: number` The average memory utilization of the autoscale pool. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const autoscale = await client.gpuDroplets.autoscale.retrieve('0d3db13e-a604-4944-9827-7ec2642d32ac'); console.log(autoscale.autoscale_pool); ``` ## Update `client.gpuDroplets.autoscale.update(stringautoscalePoolID, AutoscaleUpdateParamsbody, RequestOptionsoptions?): AutoscaleUpdateResponse` **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. ### Parameters - `autoscalePoolID: string` - `body: AutoscaleUpdateParams` - `config: AutoscalePoolStaticConfig | 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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. - `AutoscalePoolDynamicConfig` - `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. - `droplet_template: AutoscalePoolDropletTemplate` - `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" | "nyc2" | "nyc3" | 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` 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` 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. - `name: string` The human-readable name of the autoscale pool. This field cannot be updated ### Returns - `AutoscaleUpdateResponse` - `autoscale_pool?: AutoscalePool` - `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 | 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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. - `AutoscalePoolDynamicConfig` - `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. - `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` - `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" | "nyc2" | "nyc3" | 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` 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` 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. - `name: string` The human-readable name set for the autoscale pool. - `status: "active" | "deleting" | "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` - `cpu?: number` The average CPU utilization of the autoscale pool. - `memory?: number` The average memory utilization of the autoscale pool. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const autoscale = await client.gpuDroplets.autoscale.update('0d3db13e-a604-4944-9827-7ec2642d32ac', { config: { target_number_instances: 2 }, droplet_template: { name: 'example.com', region: 'nyc3', size: 'c-2', image: 'ubuntu-20-04-x64', ssh_keys: ['3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45'], backups: true, ipv6: true, monitoring: true, tags: ['env:prod', 'web'], user_data: '#cloud-config\nruncmd:\n - touch /test.txt\n', vpc_uuid: '760e09ef-dc84-11e8-981e-3cfdfeaae000', }, name: 'my-autoscale-pool', }); console.log(autoscale.autoscale_pool); ``` ## List `client.gpuDroplets.autoscale.list(AutoscaleListParamsquery?, RequestOptionsoptions?): AutoscaleListResponse` **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. ### Parameters - `query: AutoscaleListParams` - `name?: string` The name of the autoscale pool - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `AutoscaleListResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `autoscale_pools?: Array` - `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 | 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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. - `AutoscalePoolDynamicConfig` - `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. - `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` - `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" | "nyc2" | "nyc3" | 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` 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` 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. - `name: string` The human-readable name set for the autoscale pool. - `status: "active" | "deleting" | "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` - `cpu?: number` The average CPU utilization of the autoscale pool. - `memory?: number` The average memory utilization of the autoscale pool. - `links?: PageLinks` - `pages?: ForwardLinks | BackwardLinks | unknown` - `ForwardLinks` - `last?: string` URI of the last page of the results. - `next?: string` URI of the next page of the results. - `BackwardLinks` - `first?: string` URI of the first page of the results. - `prev?: string` URI of the previous page of the results. - `unknown` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const autoscales = await client.gpuDroplets.autoscale.list(); console.log(autoscales.meta); ``` ## Delete `client.gpuDroplets.autoscale.delete(stringautoscalePoolID, RequestOptionsoptions?): void` **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. ### Parameters - `autoscalePoolID: string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.autoscale.delete('0d3db13e-a604-4944-9827-7ec2642d32ac'); ``` ## Delete Dangerous `client.gpuDroplets.autoscale.deleteDangerous(stringautoscalePoolID, AutoscaleDeleteDangerousParamsparams, RequestOptionsoptions?): void` **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. ### Parameters - `autoscalePoolID: string` - `params: AutoscaleDeleteDangerousParams` - `xDangerous: boolean` Acknowledge this action will destroy the autoscale pool and its associated resources and _can not_ be reversed. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.autoscale.deleteDangerous('0d3db13e-a604-4944-9827-7ec2642d32ac', { 'X-Dangerous': true, }); ``` ## List History `client.gpuDroplets.autoscale.listHistory(stringautoscalePoolID, AutoscaleListHistoryParamsquery?, RequestOptionsoptions?): AutoscaleListHistoryResponse` **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. ### Parameters - `autoscalePoolID: string` - `query: AutoscaleListHistoryParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `AutoscaleListHistoryResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `history?: Array` - `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" | "SCALE_UP" | "SCALE_DOWN"` The reason for the scaling event. - `"CONFIGURATION_CHANGE"` - `"SCALE_UP"` - `"SCALE_DOWN"` - `status: "in_progress" | "success" | "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` - `pages?: ForwardLinks | BackwardLinks | unknown` - `ForwardLinks` - `last?: string` URI of the last page of the results. - `next?: string` URI of the next page of the results. - `BackwardLinks` - `first?: string` URI of the first page of the results. - `prev?: string` URI of the previous page of the results. - `unknown` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const response = await client.gpuDroplets.autoscale.listHistory('0d3db13e-a604-4944-9827-7ec2642d32ac'); console.log(response.meta); ``` ## List Members `client.gpuDroplets.autoscale.listMembers(stringautoscalePoolID, AutoscaleListMembersParamsquery?, RequestOptionsoptions?): AutoscaleListMembersResponse` **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. ### Parameters - `autoscalePoolID: string` - `query: AutoscaleListMembersParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `AutoscaleListMembersResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `droplets?: Array` - `created_at: string` The creation time of the Droplet in ISO8601 combined date and time format. - `current_utilization: CurrentUtilization` - `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" | "active" | "deleting" | "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` - `pages?: ForwardLinks | BackwardLinks | unknown` - `ForwardLinks` - `last?: string` URI of the last page of the results. - `next?: string` URI of the next page of the results. - `BackwardLinks` - `first?: string` URI of the first page of the results. - `prev?: string` URI of the previous page of the results. - `unknown` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const response = await client.gpuDroplets.autoscale.listMembers('0d3db13e-a604-4944-9827-7ec2642d32ac'); console.log(response.meta); ``` ## Domain Types ### Autoscale Pool - `AutoscalePool` - `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 | 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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. - `AutoscalePoolDynamicConfig` - `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. - `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` - `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" | "nyc2" | "nyc3" | 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` 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` 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. - `name: string` The human-readable name set for the autoscale pool. - `status: "active" | "deleting" | "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` - `cpu?: number` The average CPU utilization of the autoscale pool. - `memory?: number` The average memory utilization of the autoscale pool. ### Autoscale Pool Droplet Template - `AutoscalePoolDropletTemplate` - `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" | "nyc2" | "nyc3" | 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` 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` 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` - `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` - `target_number_instances: number` Fixed number of instances in an autoscale pool. ### Current Utilization - `CurrentUtilization` - `cpu?: number` The average CPU utilization of the autoscale pool. - `memory?: number` The average memory utilization of the autoscale pool.