You can call this operation to execute a scaling rule.

Description

Before you call this operation, make sure that the following requirements are met:

  • The scaling group is active.
  • The scaling group must not have any scaling activities in progress.

If there is no scaling activity in progress in the specified scaling group, the operation can be executed immediately without waiting for the cooldown time to expire.

If this operation is successful, Auto Scaling receives the request. However, it is not guaranteed that the scaling activity can be run as intended. You can use the returned ScalingActivityId parameter to query the status of the scaling activity.

If the number of ECS instances to be attached will leave the number of instances in the scaling group greater than MaxSize, the rule Total Capacity = MaxSize is applied.

If the number of ECS instances to be detached will leave the number of instances in the scaling group less than MinSize, the rule Total Capacity = MinSize is applied.

A single Alibaba Cloud account can have a maximum of 1,000 automatically created ECS instances across all scaling groups for all regions. The limit applies to the ECS instances that are automatically created, but does not apply to manually added ones.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
ScalingRuleAri String Yes ari:acs:ess:cn-qingdao:1344371:scalingRule/cCBpdYdQuBe2cUxOdu6****

The unique identifier of the scaling rule.

Action String No ExecuteScalingRule

The operation that you want to perform. Set the value to ExecuteScalingRule.

BreachThreshold Float No 1.0

The threshold specified when the step scaling rule is executed. Valid values: -9.999999E18 to 9.999999E18.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request. You can use the client to generate this value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters, and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

MetricValue Float No 1.0

The metric value specified when the step scaling rule is executed. Valid values: -9.999999E18 to 9.999999E18.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

ScalingActivityId String ebta5WbUzC8gcwUWvfch****

The ID of the scaling activity.

Examples

Sample requests


http://ess.aliyuncs.com/?Action=ExecuteScalingRule
&ScalingRuleAri=ari:acs:ess:cn-qingdao:1344371:scalingRule/cCBpdYdQuBe2cUxOdu6****
&<Common request parameters>

Sample success responses

XML format

<ExecuteScalingRuleResponse>
      <ScalingActivityId>ebta5WbUzC8gcwUWvfchyT4U</ScalingActivityId>
      <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</ExecuteScalingRuleResponse>

JSON format

{
	"RequestId":"473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
	"ScalingActivityId":"ebta5WbUzC8gcwUWvfch****"
}

Error codes

For more information about error codes, visit API Error Center.

HTTP status code

Error code

Error message

Description

404

InvalidScalingRuleAri.NotFound

The specified scaling rule Ari does not exist.

The error message returned because the specified scaling rule does not exist in the current account.

403

Forbidden.Unauthorized

A required authorization for the specified action is not supplied.

The error message returned because Auto Scaling is not authorized to call the specified operation.

400

IncorrectScalingGroupStatus

The current status of the specified scaling group does not support this action.

The error message returned because the scaling group to which the specified scaling rule belongs is not active.

400

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.

The error message returned because the scaling group to which the specified scaling rule belongs currently has a scaling activity in progress.

400

InsufficientBalance

Your account does not have enough balance.

The error message returned because your account balance is insufficient.

400

QuotaExceed.Instance

Living instance quota exceeded.

The error message returned because the maximum number of ECS instances in the current account has been reached.

400

IncorrectLoadBalancerStatus

The current status of the specified load balancer does not support this action.

The error message returned because an SLB instance for the scaling group to which the specified scaling rule belongs is not active.

400

IncorrectLoadBalancerHealthCheck

The current health check type of specified load balancer does not support this action.

The error message returned because health check is not enabled for an SLB instance of the scaling group to which the specified scaling rule belongs.

400

InvalidLoadBalancerId.IncorrectInstanceNetworkType

The network type of the instance in specified load balancer does not support this action.

The error message returned because the network type of the ECS instance attached to the specified SLB instance is different from that of the scaling group.

400

InvalidLoadBalancerId.VPCMismatch

The specified virtual switch and the instance in specified load balancer are not in the same VPC.

The error message returned because the ECS instance attached to an SLB instance for the specified scaling group is not in the same VPC as the VSwitch.

400

IncorrectDBInstanceStatus

The current status of DB instance "XXX" does not support this action.

The error message returned because the RDS instance in the scaling group to which the specified scaling rule belongs is not running.

400

QuotaExceeded.DBInstanceSecurityIP

Security IP quota exceeded in DB instance "XXX".

The error message returned because the maximum number of IP addresses in the whitelist that can access the RDS instance for the scaling group to which the specified scaling rule belongs has been reached.

400

QuotaExceeded.SecurityGroupInstance

Instance quota exceeded in the specified security group.

The error message returned because the maximum number of ECS instances in the specified security group has been reached.

400

IncorrectCapacity.NoChange

To execute the specified scaling rule, the total capacity will not change.

The error message returned because no changes to the number of instances in the scaling group are made after the scaling rule is executed.

400

QuotaExceeded.ScalingInstance

Scaling instance quota exceeded.

The error message returned because the maximum number of ECS instances to be scaled has been reached.

400

QuotaExceeded.AfterpayInstance

Living afterpay instance quota exceeded.

The error message returned because the maximum number of pay-as-you-go ECS instances to be used has been reached.

400

ResourceNotAvailable.ECS

The specified region or zone does not offer the specified disk or instance category.

The error message returned because the specified type of ECS instance or disk cannot be created in the specified region.

400

ScalingRule.InvalidScalingRuleType

Specific scaling rule type: %s can not be executed.

The error message returned because the specified type of scaling rule cannot be executed.

400

InvalidStepAdjustments.NoStepFound

No adjustment step found for a metric value of: %s.

The error message returned because no matching adjustment steps are found for the specified metric.

400

MissingParameter.MetricValue

Metric value must be specified for StepScalingRule.

The error message returned because no metric value is specified for the step scaling rule.

400

MissingParameter.BreachThreshold

Breach threshold must be specified for StepScalingRule.

The error message returned because no threshold is specified for the step scaling rule.

400

MetricValueBeyondPermitRange

Specific parameter "%s" beyond permit range.

The error message returned because the specified metric value is invalid.

400

BreachThresholdBeyondPermitRange

Specific parameter "%s" beyond permit range.

The error message returned because the specified threshold is invalid.