putScalingPolicy

Prev Next

Available in VPC

Create or edit a scaling policy for Auto Scaling Group.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET | POST /vautoscaling/v2/putScalingPolicy
Note

This guide is based on the GET method. POST method call tests can be performed through Swagger in the API Gateway service of the NAVER Cloud Platform console.

Request headers

For information about the headers common to all Auto Scaling APIs, see Auto Scaling request headers.

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
regionCode String Optional Region code
autoScalingGroupNo String Required Auto Scaling Group number
policyNo String Conditional Policy number
  • See getAutoScalingPolicyList.
  • Not entered during policy creation
  • Either policyNo or policyName is required when editing a policy.
policyName String Conditional Policy name
  • Create a policy on new name entry.
    • Enter 1 to 255 characters using a combination of lowercase English letters, numbers, and the special character "-".
    • The string must start with a lowercase English letter and end with a lowercase English letter or a number.
  • Edit the policy when entering an existing name.
  • Required upon policy creation
  • Either policyNo or policyName is required when editing a policy.
adjustmentTypeCode String Required Adjustment type code
scalingAdjustment Integer Required Adjustment value
  • Specify according to the adjustment type.
    • CHANG: -2147483648 or more
    • PRCNT: -100 or more
    • EXACT: 0 or more
  • Up to 2147483647 can be entered.
  • CHANG/PRCNT decreases when a negative number is entered.
minAdjustmentStep Integer Optional Minimum adjustment range
  • 1-2147483647
  • Change the number of server instances by the minimum adjustment range.
  • Valid only if adjustmentTypeCode is PRCNT
coolDown Integer Optional Cooldown (second)
  • 0-2147483647 (default: 300)
  • Monitoring wait time for server readiness after scaling
responseFormatType String Optional Format of the response data
  • xml (default) | json

Request example

The request example is as follows:

curl --location --request GET 'https://ncloud.apigw.ntruss.com/vautoscaling/v2/putScalingPolicy
?regionCode=KR
&autoScalingGroupNo=1***9
&policyName=pol1
&adjustmentTypeCode=CHANG
&scalingAdjustment=1
&responseFormatType=json' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
putScalingPolicyResponse Object - Response result
putScalingPolicyResponse.requestId String - ID for the request
  • UUID format
putScalingPolicyResponse.returnCode String - Response code
putScalingPolicyResponse.returnMessage String - Response message

Response status codes

For response status codes common to all Auto Scaling APIs, see Auto Scaling response status codes.

Response example

The response example is as follows:

{
    "putScalingPolicyResponse": {
        "totalRows": 1,
        "scalingPolicyList": [
            {
                "autoScalingGroupNo": "1***9",
                "policyNo": "3426",
                "policyName": "pol1",
                "adjustmentType": {
                    "code": "CHANG",
                    "codeName": "Capacity change amount"
                },
                "scalingAdjustment": 1,
                "coolDown": 300
            }
        ],
        "requestId": "ab7a4a24-****-****-****-c8b9bdf91c40",
        "returnCode": "0",
        "returnMessage": "success"
    }
}