Skip to content
  • Auto
  • Light
  • Dark

List

List All Autoscale Pools
gpu_droplets.autoscale.list(AutoscaleListParams**kwargs) -> 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.

ParametersExpand Collapse
name: Optional[str]

The name of the autoscale pool

page: Optional[int]

Which 'page' of paginated results to return.

minimum1
per_page: Optional[int]

Number of items returned per page

minimum1
maximum200
ReturnsExpand Collapse
class AutoscaleListResponse:

Information about the response itself.

autoscale_pools: Optional[List[AutoscalePool]]
id: str

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

active_resources_count: int

The number of active Droplets in the autoscale pool.

config: Config

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

created_at: datetime

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

formatdate-time
name: str

The human-readable name set for the autoscale pool.

status: Literal["active", "deleting", "error"]

The current status of the autoscale pool.

Accepts one of the following:
"active"
"deleting"
"error"
updated_at: datetime

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

formatdate-time
current_utilization: Optional[CurrentUtilization]
from gradient import Gradient

client = Gradient()
autoscales = client.gpu_droplets.autoscale.list()
print(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
  }
}