Creates a scaling rule

Updated at:
Copy as MD

Use the CreateScalingRule operation to create a scaling rule for a scaling group.

Description

This example creates a scaling rule in a scaling group by using the following parameters:

  • ScalingGroupId: the ID of the scaling group for which to create the scaling rule.

  • ScalingRuleType: the type of the scaling rule. Valid values: simple scaling rule, target tracking scaling rule, step scaling rule, and predictive scaling rule.

  • AdjustmentType: the adjustment method of the scaling rule. Required for simple scaling rules and step scaling rules.

  • AdjustmentValue: the adjustment value of the scaling rule. Required for simple scaling rules and step scaling rules.

For more information, see CreateScalingRule.

Sample requests

http(s)://ess.aliyuncs.com/?Action=CreateScalingRule
&ScalingGroupId=asg-bp1ffogfdauy0jw0****
&ScalingRuleName=scalingrule****
&AdjustmentType=QuantityChangeInCapacity
&AdjustmentValue=100
&ScalingRuleType=SimpleScalingRule
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateScalingRuleResponse>
    <ScalingRuleAri>ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****</ScalingRuleAri>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
    <ScalingRuleId>asr-bp1dvirgwkoowxk7****</ScalingRuleId>
</CreateScalingRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "ScalingRuleAri" : "ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****",
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "ScalingRuleId" : "asr-bp1dvirgwkoowxk7****"
}