dots.v2.droplets.autoscale.post()

Generated on 27 Oct 2026 from DoTs version v1.21.0

Usage

client.v2.droplets.autoscale.post(body: Autoscale_pool_create, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | AutoscalePostResponse>

Description

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

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
targetNumberInstances integer optional

Example: 3

Fixed number of instances in an autoscale pool.

Min: 1

Max: 1000

minInstances integer optional

Example: 5

The minimum number of Droplets in an autoscale pool.

Min: 1

Max: 500

maxInstances integer optional

Example: 10

The maximum number of Droplets in an autoscale pool.

Min: 1

Max: 1000

targetCpuUtilization number optional

Example: 0.6

Target CPU utilization as a decimal.

Min: 0.05

Max: 1

targetMemoryUtilization number optional

Example: 0.6

Target memory utilization as a decimal.

Min: 0.05

Max: 1

cooldownMinutes 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

dropletTemplate 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.

sshKeys 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.

vpcUuid 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.

withDropletAgent boolean optional

Example: true

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

projectId 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.

userData 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.

publicNetworking 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 { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.droplets.autoscale.post({
    name: "my-autoscale-pool",
    config: {
        minInstances: 1,
        maxInstances: 5,
        targetCpuUtilization: 0.5,
        cooldownMinutes: 10,
    },
    dropletTemplate: {
        name: "example.com",
        region: "nyc3",
        size: "c-2",
        image: "ubuntu-20-04-x64",
        sshKeys: [
            "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45",
        ],
        ipv6: true,
        tags: [
            "env:prod",
            "web",
        ],
        userData: "#cloud-config\nruncmd:\n  - touch /test.txt\n",
        vpcUuid: "760e09ef-dc84-11e8-981e-3cfdfeaae000",
    },
});

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 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.