Skip to content

List All Autoscale Pools

client.GPUDroplets.Autoscale.List(ctx, query) (*GPUDropletAutoscaleListResponse, error)
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.

ParametersExpand Collapse
query GPUDropletAutoscaleListParams
Name param.Field[string]optional

The name of the autoscale pool

Page param.Field[int64]optional

Which 'page' of paginated results to return.

minimum1
PerPage param.Field[int64]optional

Number of items returned per page

minimum1
maximum200
ReturnsExpand Collapse
type GPUDropletAutoscaleListResponse struct{…}

Information about the response itself.

Total int64optional

Number of objects returned by the request.

AutoscalePools []AutoscalePooloptional
ID string

A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation.

ActiveResourcesCount int64

The number of active Droplets in the autoscale pool.

Config AutoscalePoolConfig

The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).

Accepts one of the following:
type AutoscalePoolStaticConfig struct{…}
TargetNumberInstances int64

Fixed number of instances in an autoscale pool.

minimum1
maximum1000
type AutoscalePoolDynamicConfig struct{…}
MaxInstances int64

The maximum number of Droplets in an autoscale pool.

minimum1
maximum1000
MinInstances int64

The minimum number of Droplets in an autoscale pool.

minimum1
maximum500
CooldownMinutes int64optional

The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.

minimum5
maximum20
TargetCPUUtilization float64optional

Target CPU utilization as a decimal.

formatfloat
minimum0.05
maximum1
TargetMemoryUtilization float64optional

Target memory utilization as a decimal.

formatfloat
minimum0.05
maximum1
CreatedAt Time

A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created.

formatdate-time
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 AutoscalePoolDropletTemplateRegion

The datacenter in which all of the Droplets will be created.

Accepts one of the following:
const AutoscalePoolDropletTemplateRegionNyc1 AutoscalePoolDropletTemplateRegion = "nyc1"
const AutoscalePoolDropletTemplateRegionNyc2 AutoscalePoolDropletTemplateRegion = "nyc2"
const AutoscalePoolDropletTemplateRegionNyc3 AutoscalePoolDropletTemplateRegion = "nyc3"
const AutoscalePoolDropletTemplateRegionAms2 AutoscalePoolDropletTemplateRegion = "ams2"
const AutoscalePoolDropletTemplateRegionAms3 AutoscalePoolDropletTemplateRegion = "ams3"
const AutoscalePoolDropletTemplateRegionSfo1 AutoscalePoolDropletTemplateRegion = "sfo1"
const AutoscalePoolDropletTemplateRegionSfo2 AutoscalePoolDropletTemplateRegion = "sfo2"
const AutoscalePoolDropletTemplateRegionSfo3 AutoscalePoolDropletTemplateRegion = "sfo3"
const AutoscalePoolDropletTemplateRegionSgp1 AutoscalePoolDropletTemplateRegion = "sgp1"
const AutoscalePoolDropletTemplateRegionLon1 AutoscalePoolDropletTemplateRegion = "lon1"
const AutoscalePoolDropletTemplateRegionFra1 AutoscalePoolDropletTemplateRegion = "fra1"
const AutoscalePoolDropletTemplateRegionTor1 AutoscalePoolDropletTemplateRegion = "tor1"
const AutoscalePoolDropletTemplateRegionBlr1 AutoscalePoolDropletTemplateRegion = "blr1"
const AutoscalePoolDropletTemplateRegionSyd1 AutoscalePoolDropletTemplateRegion = "syd1"
Size string

The Droplet size to be used for all Droplets in the autoscale pool.

SSHKeys []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 booloptional

Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.

Name stringoptional

The name(s) to be applied to all Droplets in the autoscale pool.

ProjectID stringoptional

The project that the Droplets in the autoscale pool will belong to. Requires project:read scope.

Tags []stringoptional

The tags to apply to each of the Droplets in the autoscale pool. Requires tag:read scope.

UserData stringoptional

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.

VpcUuid stringoptional

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.

WithDropletAgent booloptional

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 AutoscalePoolStatus

The current status of the autoscale pool.

Accepts one of the following:
const AutoscalePoolStatusActive AutoscalePoolStatus = "active"
const AutoscalePoolStatusDeleting AutoscalePoolStatus = "deleting"
const AutoscalePoolStatusError AutoscalePoolStatus = "error"
UpdatedAt Time

A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated.

formatdate-time
CurrentUtilization CurrentUtilizationoptional
CPU float64optional

The average CPU utilization of the autoscale pool.

formatfloat
minimum0
maximum1
Memory float64optional

The average memory utilization of the autoscale pool.

formatfloat
minimum0
maximum1
Accepts one of the following:
List All Autoscale Pools
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := gradient.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  autoscales, err := client.GPUDroplets.Autoscale.List(context.TODO(), gradient.GPUDropletAutoscaleListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", autoscales.Meta)
}
{
  "autoscale_pools": [
    {
      "id": "0d3db13e-a604-4944-9827-7ec2642d32ac",
      "name": "test-autoscaler-group-01",
      "config": {
        "min_instances": 1,
        "max_instances": 5,
        "target_cpu_utilization": 0.5,
        "cooldown_minutes": 10
      },
      "droplet_template": {
        "name": "droplet-name",
        "size": "c-2",
        "region": "tor1",
        "image": "ubuntu-20-04-x64",
        "tags": [
          "my-tag"
        ],
        "ssh_keys": [
          "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"
        ],
        "vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000",
        "with_droplet_agent": true,
        "project_id": "746c6152-2fa2-11ed-92d3-27aaa54e4988",
        "ipv6": true,
        "user_data": "#cloud-config\nruncmd:\n  - touch /test.txt\n"
      },
      "created_at": "2020-11-19T20:27:18Z",
      "updated_at": "2020-12-01T00:42:16Z",
      "current_utilization": {
        "memory": 0.3588531587713522,
        "cpu": 0.0007338008770232183
      },
      "status": "active",
      "active_resources_count": 1
    }
  ],
  "links": {
    "pages": null
  },
  "meta": {
    "total": 1
  }
}
Returns Examples
{
  "autoscale_pools": [
    {
      "id": "0d3db13e-a604-4944-9827-7ec2642d32ac",
      "name": "test-autoscaler-group-01",
      "config": {
        "min_instances": 1,
        "max_instances": 5,
        "target_cpu_utilization": 0.5,
        "cooldown_minutes": 10
      },
      "droplet_template": {
        "name": "droplet-name",
        "size": "c-2",
        "region": "tor1",
        "image": "ubuntu-20-04-x64",
        "tags": [
          "my-tag"
        ],
        "ssh_keys": [
          "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"
        ],
        "vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000",
        "with_droplet_agent": true,
        "project_id": "746c6152-2fa2-11ed-92d3-27aaa54e4988",
        "ipv6": true,
        "user_data": "#cloud-config\nruncmd:\n  - touch /test.txt\n"
      },
      "created_at": "2020-11-19T20:27:18Z",
      "updated_at": "2020-12-01T00:42:16Z",
      "current_utilization": {
        "memory": 0.3588531587713522,
        "cpu": 0.0007338008770232183
      },
      "status": "active",
      "active_resources_count": 1
    }
  ],
  "links": {
    "pages": null
  },
  "meta": {
    "total": 1
  }
}