Available in VPC
Create or edit a scaling policy for Auto Scaling Group.
Syntax
The putScalingPolicy syntax is as follows:
./ncloud vautoscaling putScalingPolicy \
--autoScalingGroupNo <auto-scaling-group-no> \
--adjustmentTypeCode <CHANG|PRCNT|EXACT> \
--scalingAdjustment <scaling-adjustment> \
[--policyNo <policy-no>] \
[--policyName <policy-name>] \
[--minAdjustmentStep <min-adjustment-step>] \
[--coolDown <cooldown>] \
[--regionCode <KR|SGN|JPN>] \
[--output <json|xml>]
Options
This section describes the options available when running putScalingPolicy.
Required options
The following options are required for putScalingPolicy.
| Options | Type | Required | Description |
|---|---|---|---|
--autoScalingGroupNo |
String | Required | Auto Scaling Group number |
--adjustmentTypeCode |
String | Required | Adjustment type code
|
--scalingAdjustment |
Integer | Required | Adjustment value
|
--policyNo |
String | Conditional | Policy number
|
--policyName |
String | Conditional | Policy name
|
Optional options
These are the optional options for putScalingPolicy. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
--minAdjustmentStep |
Integer | Optional | Minimum adjustment range
|
--coolDown |
Integer | Optional | Cooldown (second)
|
Common options
For information on options commonly used in the vautoscaling command, see Auto Scaling (VPC) options.
Examples
If the request to create or edit a scaling policy is successful, the configuration information for the scaling policy is returned.
Command
The command example is as follows:
./ncloud vautoscaling putScalingPolicy \
--autoScalingGroupNo 20461037 \
--policyName policy-01 \
--adjustmentTypeCode CHANG \
--scalingAdjustment 1 \
--coolDown 300 \
--regionCode KR \
--output json
Output
The output example is as follows:
{
"putScalingPolicyResponse": {
"totalRows": 1,
"scalingPolicyList": [
{
"autoScalingGroupNo": "20461037",
"policyNo": "28470019",
"policyName": "policy-01",
"adjustmentType": {
"code": "CHANG",
"codeName": "Capacity change amount"
},
"scalingAdjustment": 1,
"coolDown": 300
}
],
"requestId": "a7b8c9d0-e1f2-3456-abcd-789012345678",
"returnCode": "0",
"returnMessage": "success"
}
}