All Products
Search
Document Center

Auto Scaling:DescribeScalingRules

Last Updated:Jun 06, 2024

Queries all scaling rules in a scaling group.

Operation description

You can specify a scaling group ID to query all scaling rules in the scaling group. You can also specify the scaling rule ID, name, unique identifier, and type in the request parameters as filter conditions.

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:DescribeScalingRulesRead
  • ScalingGroup
    acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the scaling group to which the scaling rules that you want to query belong.

cn-qingdao
PageNumberintegerNo

The number of the page to return. Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page. Maximum value: 50.

Default value: 10.

50
ScalingGroupIdstringNo

The ID of the scaling group.

asg-bp1ffogfdauy0jw0****
ScalingRuleTypestringNo

The type of the scaling rule. Valid values:

  • SimpleScalingRule: adjusts the number of ECS instances based on the values of the AdjustmentType and AdjustmentValue parameters.
  • TargetTrackingScalingRule: calculates the number of ECS instances that need to be scaled in a dynamic manner and maintains the value of a predefined metric close to the value of the TargetValue parameter.
  • StepScalingRule: scales ECS instances in steps based on the specified thresholds and metric values.
  • PredictiveScalingRule: uses machine learning to analyze historical monitoring data of the scaling group and predicts the future values of metrics. In addition, Auto Scaling automatically creates scheduled tasks to adjust the boundary values for the scaling group.
SimpleScalingRule
ShowAlarmRulesbooleanNo

Specifies whether to return CloudMonitor event-triggered tasks associated with scaling rules. Valid values:

  • true
  • false

Default value: false.

false
ScalingRuleIdsarrayNo

The IDs of the scaling rules that you want to query.

stringNo

The IDs of the scaling rules that you want to query.

asr-bp1dvirgwkoowxk7****
ScalingRuleNamesarrayNo

The names of the scaling rules that you want to query.

stringNo

The names of the scaling rules that you want to query.

scalingrule****
ScalingRuleArisarrayNo

The unique identifiers of the scaling rules that you want to query.

stringNo

The unique identifiers of the scaling rules that you want to query.

ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

50
TotalCountinteger

The total number of scaling rules.

1
ScalingRulesobject []

Details of the scaling rules.

MetricNamestring

The name of the metric of the event-triggered task that is associated with the scaling rule.

CpuUtilization
AdjustmentTypestring

The scaling mode of the scaling rule. 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
InitialMaxSizeinteger

The maximum number of ECS instances in the scaling group. You must specify the InitialMaxSize and PredictiveValueBehavior parameters.

100
EstimatedInstanceWarmupinteger

The warmup period of the ECS instance.

300
ScaleOutEvaluationCountinteger

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.

3
PredictiveScalingModestring

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
MinAdjustmentMagnitudeinteger

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
ScalingRuleAristring

The unique identifier of the scaling rule.

ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****
PredictiveTaskBufferTimeinteger

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

30
MinSizeinteger

The minimum number of ECS instances in the scaling group.

1
ScalingGroupIdstring

The ID of the scaling group.

asg-bp1ffogfdauy0jw0****
PredictiveValueBehaviorstring

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
TargetValuefloat

The target value of the metric.

0.125
Cooldowninteger

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.

20
MaxSizeinteger

The maximum number of ECS instances in the scaling group.

2
PredictiveValueBufferinteger

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
ScalingRuleTypestring

The type of the scaling rule. Valid values:

  • SimpleScalingRule: adjusts the number of ECS instances based on the values of the AdjustmentType and AdjustmentValue parameters.
  • TargetTrackingScalingRule: calculates the number of ECS instances that need to be scaled in a dynamic manner and maintains the value of a predefined metric close to the value of the TargetValue parameter.
  • StepScalingRule: scales ECS instances in steps based on specified thresholds and metric values.
  • PredictiveScalingRule: uses machine learning to analyze historical monitoring data of the scaling group and predicts the future values of metrics. In addition, Auto Scaling automatically creates scheduled tasks to adjust the boundary values for the scaling group.
SimpleScalingRule
AdjustmentValueinteger

The adjustment value that is specified in the scaling rule.

1
ScaleInEvaluationCountinteger

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.

15
DisableScaleInboolean

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

  • true
  • false
true
ScalingRuleNamestring

The name of the scaling rule.

scalingrule****
ScalingRuleIdstring

The ID of the scaling rule.

asr-bp1dvirgwkoowxk7****
Alarmsobject []

The event-triggered tasks that are associated with the scaling rule. Event-triggered tasks that are associated with the scaling rule are returned only if you set the ShowAlarmRules parameter to true. Otherwise, an empty list is returned.

AlarmTaskIdstring

The ID of the event-triggered task that is associated with the scaling rule.

asg-bp18p2yfxow2dloq****_1f9458d1-70e1-4bee-8c7f-7a47695b****
ComparisonOperatorstring

The comparison operator between the metric value and the threshold for the event-triggered task that is associated with the scaling rule. The comparison operator indicates the relationship between the metric value and the threshold that is required to meet the condition.

  • Valid value if the metric value is greater than or equal to the threshold: >=.
  • Valid value if the metric value is less than or equal to the threshold: <=.
  • Valid value if the metric value is greater than the threshold: >.
  • Valid value if the metric value is less than the threshold: <.
>=
MetricNamestring

The name of the metric of the event-triggered task that is associated with the scaling rule.

CpuUtilization
EvaluationCountinteger

The number of consecutive times for which the event-triggered task that is associated with the scaling rule meets the threshold expressions before an alert is triggered.

3
AlarmTaskNamestring

The name of the event-triggered task that is associated with the scaling rule.

alarmtask****
MetricTypestring

The type of the event-triggered task that is associated with the scaling rule. Valid values:

  • system: system monitoring event-triggered tasks
  • custom: custom monitoring event-triggered tasks
system
Thresholdfloat

The alert threshold of the event-triggered task that is associated with the scaling rule.

50
Statisticsstring

The statistical method of the event-triggered task that is associated with the scaling rule. Valid values:

  • Average
  • Maximum
  • Minimum
Average
Dimensionsobject []

The dimensions of the event-triggered task that is associated with the scaling rule.

DimensionKeystring

The key of the dimension that is associated with the metric. Valid values:

  • scaling_group: the ID of the scaling group
  • userId: the ID of the Alibaba Cloud account
scaling_group
DimensionValuestring

The value of the dimension that is associated with the metric.

asg-bp18p2yfxow2dloq****
StepAdjustmentsobject []

The step adjustments of the step scaling rule.

MetricIntervalUpperBoundfloat

The upper limit that is specified in a step adjustment. Valid values: -9.999999E18 to 9.999999E18.

5.0
ScalingAdjustmentinteger

The number of ECS instances that are scaled in a step adjustment.

1
MetricIntervalLowerBoundfloat

The lower limit that is specified in a step adjustment. Valid values: -9.999999E18 to 9.999999E18.

1.0

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PageNumber": 1,
  "PageSize": 50,
  "TotalCount": 1,
  "ScalingRules": [
    {
      "MetricName": "CpuUtilization",
      "AdjustmentType": "QuantityChangeInCapacity",
      "InitialMaxSize": 100,
      "EstimatedInstanceWarmup": 300,
      "ScaleOutEvaluationCount": 3,
      "PredictiveScalingMode": "PredictAndScale",
      "MinAdjustmentMagnitude": 1,
      "ScalingRuleAri": "ari:acs:ess:cn-hangzhou:140692647406****:scalingrule/asr-bp1dvirgwkoowxk7****",
      "PredictiveTaskBufferTime": 30,
      "MinSize": 1,
      "ScalingGroupId": "asg-bp1ffogfdauy0jw0****",
      "PredictiveValueBehavior": "MaxOverridePredictiveValue",
      "TargetValue": 0.125,
      "Cooldown": 20,
      "MaxSize": 2,
      "PredictiveValueBuffer": 50,
      "ScalingRuleType": "SimpleScalingRule",
      "AdjustmentValue": 1,
      "ScaleInEvaluationCount": 15,
      "DisableScaleIn": true,
      "ScalingRuleName": "scalingrule****",
      "ScalingRuleId": "asr-bp1dvirgwkoowxk7****",
      "Alarms": [
        {
          "AlarmTaskId": "asg-bp18p2yfxow2dloq****_1f9458d1-70e1-4bee-8c7f-7a47695b****",
          "ComparisonOperator": ">=",
          "MetricName": "CpuUtilization",
          "EvaluationCount": 3,
          "AlarmTaskName": "alarmtask****",
          "MetricType": "system",
          "Threshold": 50,
          "Statistics": "Average",
          "Dimensions": [
            {
              "DimensionKey": "scaling_group",
              "DimensionValue": "asg-bp18p2yfxow2dloq****"
            }
          ]
        }
      ],
      "StepAdjustments": [
        {
          "MetricIntervalUpperBound": 5,
          "ScalingAdjustment": 1,
          "MetricIntervalLowerBound": 1
        }
      ],
      "AlarmDimensions": [
        {
          "DimensionKey": "rulePool",
          "DimensionValue": "sgp-l1cbirz451yxu2dxxx"
        }
      ]
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2023-04-03The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.