All Products
Search
Document Center

Auto Scaling:ModifyScalingRule

Last Updated:May 16, 2024

Modifies a scaling rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ess:ModifyScalingRuleWrite
  • ScalingGroup
    acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ScalingRuleIdstringYes

The ID of the scaling rule that you want to modify.

asr-bp1dvirgwkoowxk7****
ScalingRuleNamestringNo

The name of the scaling rule. The name must be 2 to 64 characters in length, and can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit. The name of a scaling rule must be unique in the scaling group to which the scaling rule belongs and within an Alibaba Cloud account.

scalingrule****
CooldownintegerNo

The cooldown time of the scaling rule. This parameter is available only if you set the ScalingRuleType parameter to SimpleScalingRule.

Valid values: 0 to 86400. Unit: seconds.

60
MinAdjustmentMagnitudeintegerNo

The minimum number of instances that must be scaled when the AdjustmentType parameter is set to PercentChangeInCapacity. This parameter takes effect only if you set the ScalingRuleType parameter to SimpleScalingRule or StepScalingRule.

1
AdjustmentTypestringNo

The adjustment method of the scaling rule. This is required when the ScalingRuleType parameter is set to SimpleScalingRule or StepScalingRule. Valid values:

  • QuantityChangeInCapacity: adds the specified number of ECS instances to or removes the specified number of ECS instances from the scaling group.
  • PercentChangeInCapacity: adds the specified percentage of ECS instances to or removes the specified percentage of ECS instances from the scaling group.
  • TotalCapacity: adjusts the number of ECS instances in the scaling group to the specified number.
QuantityChangeInCapacity
AdjustmentValueintegerNo

The target value specified in the scaling rule. This parameter is required when the ScalingRuleType parameter is set to SimpleScalingRule or StepScalingRule. The number of ECS instances that are scaled in a single scaling activity cannot exceed 1,000.

  • Valid values if you set the AdjustmentType parameter to QuantityChangeInCapacity: -1000 to 1000.
  • Valid values if you set the AdjustmentType parameter to PercentChangeInCapacity: -100 to 10000.
  • Valid values if you set the AdjustmentType parameter to TotalCapacity: 0 to 2000.
100
EstimatedInstanceWarmupintegerNo

The warmup period of an instance. This parameter is available only if you set the ScalingRuleType parameter to TargetTrackingScalingRule or PredictiveScalingRule. Auto Scaling adds ECS instances that are in the warmup state to a scaling group but does not report monitoring data to CloudMonitor during the warmup period.

Note Auto Scaling calculates the number of ECS instances that need to be scaled. ECS instances in the warmup state are not counted towards the current capacity of the scaling group.

Valid values: 0 to 86400. Unit: seconds.

60
MetricNamestringNo

The predefined metric that you want to monitor. This parameter is required only if you set the ScalingRuleType parameter to TargetTrackingScalingRule or PredictiveScalingRule.

Valid values if you set the ScalingRuleType parameter to TargetTrackingScalingRule:

  • CpuUtilization: the average CPU utilization
  • ClassicInternetRx: the average inbound Internet traffic over the classic network
  • ClassicInternetTx: the average outbound Internet traffic over the classic network
  • VpcInternetRx: the average inbound Internet traffic over the virtual private cloud (VPC)
  • VpcInternetTx: the average outbound Internet traffic over the VPC
  • IntranetRx: the average inbound traffic over the internal network
  • IntranetTx: the average outbound traffic over the internal network

Valid values if you set the ScalingRuleType parameter to PredictiveScalingRule:

  • CpuUtilization: the average CPU utilization
  • IntranetRx: the average inbound traffic over the internal network
  • IntranetTx: the average outbound traffic over the internal network
CpuUtilization
TargetValuefloatNo

The target value. This parameter is available only if you set the ScalingRuleType parameter to TargetTrackingScalingRule or PredictiveScalingRule. The value must be greater than 0 and can have up to three decimal places.

0.125
DisableScaleInbooleanNo

Specifies whether to disable scale-in. This parameter is available only if you set the ScalingRuleType parameter to TargetTrackingScalingRule.

true
ScaleInEvaluationCountintegerNo

The number of consecutive times that the event-triggered task created for scale-in activities must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and then associated with the target tracking scaling rule.

15
ScaleOutEvaluationCountintegerNo

The number of consecutive times that the event-triggered task created for scale-out activities must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and then associated with the target tracking scaling rule.

3
PredictiveScalingModestringNo

The mode of the predictive scaling rule. Valid values:

  • PredictAndScale: produces predictions and creates prediction tasks.
  • PredictOnly: produces predictions but does not create prediction tasks.
PredictAndScale
PredictiveValueBehaviorstringNo

Specifies which one of the initial maximum capacity and the predicted value can be used as the maximum value for prediction tasks. Valid values:

  • MaxOverridePredictiveValue: uses the initial maximum capacity as the maximum value for prediction tasks if the predicted value is greater than the initial maximum capacity.
  • PredictiveValueOverrideMax: uses the predicted value as the maximum value for prediction tasks when the predicted value is greater than the initial maximum capacity.
  • PredictiveValueOverrideMaxWithBuffer: increases the predicted value by a percentage that is specified by the PredictiveValueBuffer parameter. If the predicted value that is increased by the percentage is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks.
MaxOverridePredictiveValue
PredictiveValueBufferintegerNo

The percentage of the increment to the predicted value when the PredictiveValueBehavior parameter is set to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this percentage is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.

50
PredictiveTaskBufferTimeintegerNo

The amount of buffer time before the prediction task is executed. By default, all prediction tasks that are automatically created for a predictive scaling rule are executed on the hour. You can specify an amount of buffer time for resource preparation before the prediction tasks are executed. Valid values: 0 to 60.

30
InitialMaxSizeintegerNo

The maximum number of ECS instances in the scaling group. If you specify this parameter, you must also specify the PredictiveValueBehavior parameter.

100
StepAdjustmentsobject []No

Details of the step adjustments.

MetricIntervalUpperBoundfloatNo

The upper limit specified in a step adjustment. This parameter is available only if you set the ScalingRuleType parameter to StepScalingRule. Valid values: -9.999999E18 to 9.999999E18.

5.0
ScalingAdjustmentintegerNo

The number of ECS instances that you want to scale in a step adjustment. This parameter is available only if you set the ScalingRuleType parameter to StepScalingRule.

1
MetricIntervalLowerBoundfloatNo

The lower limit that is specified in a step adjustment. This parameter is available only if you set the ScalingRuleType parameter to StepScalingRule. Valid values: -9.999999E18 to 9.999999E18.

1.0

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-04-03The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: AlarmDimensions