pydo.autoscalepools.update()

Generated on 8 May 2026 from pydo version v0.34.0

Usage

client.autoscalepools.update(
    autoscale_pool_id="0d3db13e-a604-4944-9827-7ec2642d32ac",
    body={
        "name": "my-autoscale-pool",
        "config": {...},
        "droplet_template": {...},
    },
)
Returns JSONRaises HttpResponseError

Description

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

autoscale_pool_id string required

A unique identifier for an autoscale pool.

name string required

Example: my-autoscale-pool

The human-readable name of the autoscale pool. This field cannot be updated

config object required

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

Show child properties
target_number_instances integer optional

Example: 3

Fixed number of instances in an autoscale pool.

Min: 1

Max: 1000

min_instances integer optional

Example: 5

The minimum number of Droplets in an autoscale pool.

Min: 1

Max: 500

max_instances integer optional

Example: 10

The maximum number of Droplets in an autoscale pool.

Min: 1

Max: 1000

target_cpu_utilization number optional

Example: 0.6

Target CPU utilization as a decimal.

Min: 0.05

Max: 1

target_memory_utilization number optional

Example: 0.6

Target memory utilization as a decimal.

Min: 0.05

Max: 1

cooldown_minutes integer optional

Example: 5

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

Min: 5

Max: 20

droplet_template object required
Show child properties
name string optional

Example: my-droplet-name

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

region string required

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

One of: nyc1, nyc2, nyc3, ams2, ams3, sfo1, sfo2, sfo3, sgp1, lon1, fra1, tor1, blr1, syd1

size string required

Example: c-2

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

image string required

Example: ubuntu-20-04-x64

The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.

ssh_keys array of strings required

Example: ['88:66:90:d2:68:d5:b5:85:e3:26:26:11:31:57:e6:f8']

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.

tags array of strings optional

Example: ['my-tag']

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

vpc_uuid string optional

Example: 760e09ef-dc84-11e8-981e-3cfdfeaae000

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 optional

Example: True

Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.

project_id string optional

Example: 746c6152-2fa2-11ed-92d3-27aaa54e4988

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

ipv6 boolean optional

Example: True

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

user_data string optional

Example: #cloud-config runcmd: - touch /test.txt

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.

public_networking boolean optional

Example: True

An optional boolean indicating whether the Droplets should be created with public networking or not. By default, all Droplets are created with public networking available. If explicitly set to false, only private networking will be enabled, and public networking will be disabled; currently this means that it will not have any public static or Reserved IPv4 or IPv6 address, nor can one be assigned later. If explicitly set to false, ipv6 must also be false.

Default: True

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "my-autoscale-pool",
  "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"
  }
}

resp = client.autoscalepools.update(autoscale_pool_id="0d3db13e-a604-4944-9827-7ec2642d32ac", body=req)

Response Example

Show Response Example
{
  "autoscale_pool": {
    "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",
      "public_networking": true,
      "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",
    "status": "active",
    "active_resources_count": 1
  }
}

More Information

See /v2/droplets/autoscale/{autoscale_pool_id} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.