putScalingPolicy

Prev Next

Overview

Create or edit a scaling policy

Description

Create or edit a scaling policy. Once a policy has been called to be enforced, the scale-in or scale-out action is operated based on the set scaling policy.

Request Parameters

Parameter Required Type Restrictions Description
policyName Yes String Min : 1, Max : 255 Policy name. The identifier of a scaling policy.
The policy name belongs to a specific Auto Scaling Group, and the name cannot be duplicated within the same group.
If there is no existing policy name within the selected Auto Scaling Group range when calling the api, create a new one. If there is the policy name created, change the details.
Each Auto Scaling Group can have up to 10 policies.
autoScalingGroupName Yes String Min : 1, Max : 255 Name(Identifier) of Auto Scaling Group that a policy will be operated
adjustmentTypeCode Yes String Min : 1, Max : 5 Type code to control capacity of a group
There are 3 valid codes as follows. (Applicable codes are written in the brackets.)

* ChangeInCapacity(CHANG) : The value of capacity is changed into the assigned value.
Equation) (new desired capacity) = (current actual capacity) + (scalingAdjustment of ChangeInCapacity type)
* ExactCapacity(EXACT): The capacity is changed as much as the assigned percentage value.
Equation) (new desired capacity) = (scalingAdjustment of ExactCapacity type)
* PercentChangeInCapacity(PRCNT) : Capacity changes by the specified perecent value
Equation) (new desired capacity) = (current actual capacity) + (current actual capacity) X (scalingAdjustment of PercentChangeInCapacity type) / 100
scalingAdjustment Yes Integer Min: -2147483647, Max : 2147483647 Adjustment value of group capacity for a scaling
If the adjustmentTypeCode value is ChangeInCapacity(CHANG) or PercentChangeInCapacity(PRCNT) type,

i ) If scalingAdjustment is positive, then the capacity is increased and scale-out
ii) If scalingAdjustment is negative, the capacity is reduced to scale-in

The minimum value of scalingAdjustment of type PercentChangeInCapacity (PRCNT) is -100.
cooldown No Integer Min : 0, Max : 2147483647 Once a scaling action is over, ignore any alarm occurred during the cooldown period.
minAdjustmentStep No Integer Min : 1, Max : 2147483647 Minimum adjustment step
It can only be assigned when the adjustmentTypeCode is PercentChangeInCapacity(PRCNT).(Therefore, the assignment is not necessary.)
It cannot be specified under any other code types.
When the changed value due to the scalingAdjustment is lower than the minAdjustmentStep under PercentChangeInCapacity(PRCNT) type, set the change value as the minAdjustmetStep.

Response Data type

  • CommonResponse Type
CommonResponse extends BaseObject
private String requestId;
private String returnCode;
private String returnMessage;

Examples

Request

ncloud autoscaling putScalingPolicy --policyName test-autoscaling-policy --autoScalingGroupName soso02 --adjustmentTypeCode EXACT --scalingAdjustment 22

Response

{
  "putScalingPolicyResponse": {
    "requestId": "e824e13a-c339-45cf-8192-e28b34a6765f",
    "returnCode": "0",
    "returnMessage": "success"
  }
}
<?xml version="1.0" encoding="UTF-8" ?>
<putScalingPolicyResponse>
  <requestId>e824e13a-c339-45cf-8192-e28b34a6765f</requestId>
  <returnCode>0</returnCode>
  <returnMessage>success</returnMessage>
</putScalingPolicyResponse>