Execute a scaling rule

Last Updated: May 11, 2017

Description

Executes a specified scaling rule.

  • The interface can be called only when the scaling group is active.
  • The interface can be called only when no scaling activity in the scaling group is in progress.
  • When no scaling activity in the scaling group is in progress, the interface can be directly executed without cooldown.
  • Successfully calling this interface only means that the Auto Scaling service has accepted the call request, and the scaling activity can be executed, but does not necessarily mean that the scaling activity can be successfully executed. You can use the returned ScalingActivityId to check the status of the scaling activity.
  • When the total capacity of to-be-attached ECS instances specified by this scaling rule plus the instances in the current scaling group is greater than MaxSize, the rule Total Capacity = MaxSize is applied.
  • When the total capacity of instances in the current scaling group minus the number of ECS instances to be reduced according to the scaling rule is smaller than MinSize, the rule Total Capacity = MinSize is applied.
  • You can only perform auto scaling for at most 100 ECS instances of all scaling groups in all regions. (The number only includes the number of ECS instances automatically created, but does not include the number of manually attached ECS instances.)

Request parameters

Name Type Required? Description
Action String Yes Operation interface name, required parameter. Value: ExecuteScalingRule.
ScalingRuleAri String Yes Unique identifier of the scaling rule.
ClientToken String No Used to ensure request idempotence. The value is generated by a client. It must be unique among all requests and can contain a maximum of 64 ASCII characters. For details, refer to the appendix How to ensure idempotence.

Return parameters

Name Type Description
ScalingActivityId String Scaling activity ID.

Error code

For errors common to all interfaces, refer to the Client Error Table or Server Error Table.

Error Error code Description HTTP status code
The specified scaling rule does not exist in this account. InvalidScalingRuleAri.NotFound The specified scaling rule Ari does not exist. 404
Open API is not fully authorized to the Auto Scaling service. Forbidden.Unauthorized A required authorization for the specified action is not supplied. 403
The specified scaling rule is not active. IncorrectScalingGroupStatus The current status of the specified scaling group does not support this action. 400
The scaling group to which the scaling rule belongs has a scaling activity in progress. ScalingActivityInProgress You cannot delete a scaling group or launch a new scaling activity while there is a scaling activity in progress for the specified scaling group. 400
Your account balance is not enough. InsufficientBalance Your account does not have enough balance. 400
Your ECS instance quota is exceeded. QuotaExceed.Instance Living instance quota exceeded. 400
The Server Load Balancer instance in the scaling group to which the scaling rule belongs is not active. IncorrectLoadBalancerStatus The current status of the specified load balancer does not support this action. 400
Health check is not enabled for the Server Load Balancer in the scaling group to which the specified scaling rule belongs. IncorrectLoadBalancerHealthCheck The current health check type of specified load balancer does not support this action. 400
The network type of the ECS instance contained in the specified Server Load Balancer is different from the network type of the scaling group. InvalidLoadBalancerId.IncorrectInstanceNetworkType The network type of the instance in specified load balancer does not support this action. 400
The ECS instance contained in the specified Server Load Balancer and VSwitchId are not in the same VPC. InvalidLoadBalancerId.VPCMismatch The specified virtual switch and the instance in specified load balancer are not in the same VPC. 400
The RDS instance in the scaling group to which the specified scaling rule belongs is not running. IncorrectDBInstanceStatus The current status of DB instance “XXX” does not support this action. 400
The number of IP addresses in the white list that can access the RDS instance in the scaling group to which the specified scaling rule belongs has reached the upper limit. QuotaExceeded.DBInstanceSecurityIP Security IP quota exceeded in DB instance “XXX”. 400
The number of ECS instances attached to the specified security group exceeds the upper limit. QuotaExceeded.SecurityGroupInstance Instance quota exceeded in the specified security group. 400
The number of instances in the scaling group does not change after the scaling rule is executed. IncorrectCapacity.NoChange To execute the specified scaling rule, the total capacity will not change. 400
The Auto Scaling ECS instance quota is exceeded. QuotaExceeded.ScalingInstance Scaling instance quota exceeded. 400
The Pay-As-You-Go ECS instance quota is exceeded. QuotaExceeded.AfterpayInstance Living afterpay instance quota exceeded. 400
The specified ECS instance type or disk type cannot be created in the specified region. ResourceNotAvailable.ECS The specified region or zone does not offer the specified disk or instance category.

Example

Request example
  1. http://ess.aliyuncs.com/?Action=ExecuteScalingRule
  2. &ScalingRuleAri=ari:acs:ess:cn-qingdao:1344371:scalingRule/cCBpdYdQuBe2cUxOdu6piOk
  3. &<Public Request Parameters>
Return example

XML format:

  1. <ExecuteScalingRuleResponse>
  2. <ScalingActivityId>ebta5WbUzC8gcwUWvfchyT4U</ScalingActivityId>
  3. <RequestId>262216B9-F9D4-4D16-BE9B-BD1C39A4F42B</RequestId>
  4. </ExecuteScalingRuleResponse>

JSON format:

  1. "RequestId": "6469DCD0-13AC-487E-85A0-CE4922908FDE",
  2. "ScalingActivityId": "ebta5WbUzC8gcwUWvfchyT4U"
Thank you! We've received your feedback.