Skip to main content

Create Auto Scaling Group

Provisions an auto scaling group ("scale group"). The group launches between min_nodes and max_nodes identical nodes from the selected image and plan, and scales the running count automatically according to its scaling policies.

At least one of policy (elastic) or scheduled_policy is required.

  • Elastic policy reacts to a metric (CPU, MEMORY, or a custom parameter). It is sent as two objects: a scale-up rule (adjust: 1) and a scale-down rule (adjust: -1).

  • Scheduled scheduled_policy changes the target node count on a cron schedule. It is sent as two objects (scale-up and scale-down), where scheduled_policy[0].adjust <= max_nodes, scheduled_policy[1].adjust >= min_nodes, and scheduled_policy[0].adjust >= scheduled_policy[1].adjust.

A group can have at most 60 nodes (MAX_NODES_PER_GROUP). For a private cluster (is_private: true) send custom_sku and host_ids and a mandatory vpc, instead of plan_id. On success the group is returned in Deploying state - poll List or Detail until it is Running.

POST/api/v1/scaler/scalegroups

Query parameters

  • project_idQueryintegerrequired

    Identifier of the project to scope the request to. Required integer project ID.

    • required
    • must be a valid integer project ID
    example{{project_id}}
  • apikeyQuerystringrequired

    API key used to authenticate the create request.

    • required
    • non-empty string
    example{{api_key}}
  • locationQuerystringrequired

    Region in which the group will be provisioned.

    • required
    • must be a valid region name (e.g., Delhi, Chennai)
    example{{location}}

Request body

application/json

object

Create payload for an auto scaling group. Send policy for elastic (metric-based) scaling, scheduled_policy for cron-based scaling, or both - at least one is required. For a public group send plan_id; for a private cluster set is_private: true and send custom_sku, host_ids and a mandatory vpc instead.

namestringrequired

Display name of the auto scaling group.

exampleweb-autoscale-group
  • required
  • max length 40 characters
min_nodesintegerrequired

Minimum number of running nodes the group will maintain.

example2
  • required
  • integer >= 0
  • must be <= max_nodes
desiredintegerrequired

Initial target number of running nodes. On create this equals min_nodes.

example2
  • required
  • must be between min_nodes and max_nodes
max_nodesintegerrequired

Maximum number of running nodes the group may scale to.

example5
  • required
  • integer
  • must not exceed 60 (MAX_NODES_PER_GROUP)
plan_idinteger

ID of the compute plan (SKU) backing each node. Required for a public group (is_private false).

example1088
  • required when is_private is false
  • must be a valid plan ID from Plan
plan_namestring

Human-readable plan name, from Plan.

exampleC3.8GB
  • optional
slug_namestring

Plan slug identifier, from Plan.

examplee2e_public_cloud
  • optional
sku_idinteger

SKU identifier for the selected plan.

example12345
  • optional
vm_image_idinteger

ID of the image the nodes boot from.

example12345
  • required for a public group
  • must be a valid image ID
vm_image_namestring

Name of the selected image.

exampleUbuntu-22.04
  • optional
vm_template_idintegerrequired

Template ID of the selected image (its template_id).

example12345
  • required
  • must be a valid image template ID
my_account_sg_idinteger

ID of the security group to attach to the group's nodes at create time.

example12345
  • optional
  • must be a valid security group ID
vpcarray

VPC networks to attach to the group. Mandatory for a private cluster.

is_public_ip_requiredbooleanrequired

Whether each node should be launched with a public IP.

exampletrue
  • required
  • boolean
isEncryptionEnabledboolean

Whether to enable disk encryption on the nodes.

exampletrue
  • optional
  • defaults to false
encryption_passphrasestring

Passphrase used for disk encryption. Required when isEncryptionEnabled is true.

exampleSecret@123
  • required when isEncryptionEnabled is true
  • length 8 to 12 characters
  • must contain a lowercase letter, an uppercase letter and a special character
policy_typestringDefault | Custom

Whether the elastic policy uses a Default metric (CPU/MEMORY) or a Custom parameter.

exampleDefault
  • one of Default | Custom
custom_parameter_namestring

Name of the custom scaling metric, when policy_type is Custom.

exampleREQUESTS_PER_SEC
  • required when policy_type is Custom
  • matches [A-Z0-9]([_]?[A-Z0-9])+
  • cannot be CPU or MEMORY
  • max length 50 characters
custom_parameter_valueinteger

Initial value of the custom metric. Sent as 0 at create time.

example0
  • optional
  • 0 on create
is_privateboolean

Whether to launch the group on a private (dedicated) cluster.

examplefalse
  • optional
  • defaults to false
host_idsarray

IDs of the private-cluster hosts to place nodes on. Used when is_private is true.

  • used only when is_private is true
custom_skuobject

Custom node sizing for a private cluster. Used when is_private is true.

policyarray

Elastic (metric-based) scaling rules. Sent as two objects: a scale-up rule (adjust 1) and a scale-down rule (adjust -1).

scheduled_policyarray

Scheduled (cron-based) scaling rules. Sent as two objects: a scale-up and a scale-down target. scheduled_policy[0].adjust must be <= max_nodes, scheduled_policy[1].adjust must be >= min_nodes, and scheduled_policy[0].adjust must be >= scheduled_policy[1].adjust.

Responses

200Successful response
object

The newly created auto scaling group, in Deploying state.

codeinteger
example200
dataobject
errorsobject
messagestring
exampleSuccess