setDesiredCapacity

Prev Next

Available in VPC

Change the expected capacity of Auto Scaling Group.

Syntax

The setDesiredCapacity syntax is as follows:

./ncloud vautoscaling setDesiredCapacity \
    --autoScalingGroupNo <auto-scaling-group-no> \
    --desiredCapacity <desired-capacity> \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running setDesiredCapacity.

Required options

The following options are required for setDesiredCapacity.

Options Type Required Description
--autoScalingGroupNo String Required Auto Scaling Group number
--desiredCapacity Integer Required Desired capacity
  • 0-30
  • Set to a value between the minimum capacity (minSize) and maximum capacity (maxSize).
  • Automatically adjusts the number of servers based on the input value.

Common options

For information on options commonly used in the vautoscaling command, see Auto Scaling (VPC) options.

Examples

If the request to edit the expected capacity of an Auto Scaling Group is successful, the edited configuration information for the Auto Scaling Group is returned.

Command

The command example is as follows:

./ncloud vautoscaling setDesiredCapacity \
    --autoScalingGroupNo 20461037 \
    --desiredCapacity 0 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
    "setDesiredCapacityResponse": {
        "totalRows": 1,
        "autoScalingGroupList": [
            {
                "vpcNo": "12345678",
                "subnetNo": "23456789",
                "serverNamePrefix": "test",
                "autoScalingGroupNo": "20461037",
                "autoScalingGroupName": "asg-01",
                "launchConfigurationNo": "18305791",
                "minSize": 0,
                "maxSize": 2,
                "desiredCapacity": 0,
                "defaultCoolDown": 600,
                "healthCheckGracePeriod": 300,
                "healthCheckType": {
                    "code": "SVR",
                    "codeName": "Server"
                },
                "createDate": "2026-07-07T10:22:20+0900",
                "autoScalingGroupStatus": {
                    "code": "CREAT",
                    "codeName": "Created"
                },
                "targetGroupNoList": [],
                "inAutoScalingGroupServerInstanceList": [],
                "accessControlGroupNoList": [
                    "67890123"
                ],
                "suspendedProcessList": []
            }
        ],
        "requestId": "e5f6a7b8-c9d0-1234-efab-567890123456",
        "returnCode": "0",
        "returnMessage": "success"
    }
}