ModifyScalingRule

Updated at:

Modifies one or more attributes of a scaling rule. If an existing scaling rule no longer meets your requirements, you can call this operation to modify its attributes instead of creating a new one. This prevents unnecessary repetition and saves time and resources.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:ModifyScalingRule

update

*ScalingGroup

acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ScalingRuleId

string

Yes

The ID of the scaling rule.

asr-bp1dvirgwkoowxk7****

ScalingRuleName

string

No

The name of the scaling rule. The name must be 2 to 64 characters in length and start with a digit, a letter, or a Chinese character. It can contain digits, underscores (_), hyphens (-), and periods (.).

Note

The scaling rule name must be unique within a scaling group in a region for an Alibaba Cloud account.

scalingrule****

Cooldown

integer

No

The cooldown time of the scaling rule. This parameter applies only to simple scaling rules.

Valid values: 0 to 86400. Unit: seconds.

60

MinAdjustmentMagnitude

integer

No

The minimum number of instances to be adjusted. This parameter takes effect only when the scaling rule type is SimpleScalingRule or StepScalingRule and AdjustmentType is set to PercentChangeInCapacity.

1

AdjustmentType

string

No

The adjustment method of the scaling rule. This parameter is required when the scaling rule is a simple scaling rule or a step scaling rule. Valid values:

  • QuantityChangeInCapacity: adds or removes a specified number of ECS instances.

  • PercentChangeInCapacity: adds or removes a specified percentage of ECS instances.

  • TotalCapacity: adjusts the number of ECS instances in the scaling group to a specified number.

QuantityChangeInCapacity

AdjustmentValue

integer

No

The adjustment value of the scaling rule. This parameter is required when the scaling rule is a simple scaling rule or a step scaling rule. The number of ECS instances adjusted in a single operation cannot exceed 1,000. Valid values vary based on the adjustment method:

  • QuantityChangeInCapacity: -1000 to 1000.

  • PercentChangeInCapacity: -100 to 10000.

  • TotalCapacity: 0 to 2000.

100

EstimatedInstanceWarmup

integer

No

The warmup time of instances. This parameter applies to target tracking scaling rules and step scaling rules. ECS instances in the warmup state are added to the scaling group as usual, but they do not report monitoring data to CloudMonitor during the warmup period.

Note

When the system dynamically calculates the number of ECS instances to be scaled, instances in the warmup state are not counted as existing instances.

Valid values: 0 to 86400. Unit: seconds.

60

MetricName

string

No

The predefined metric. This parameter is required when the scaling rule is a target tracking scaling rule or a predictive scaling rule.

Valid values for target tracking scaling rules:

  • CpuUtilizationAgent: the CPU utilization collected by the CloudMonitor agent (recommended).

  • MemoryUtilization: the memory usage collected by the CloudMonitor agent (recommended).

  • CpuUtilization: the average CPU utilization of ECS instances.

  • IntranetTx: the average outbound internal traffic of ECS instances.

  • IntranetRx: the average inbound internal traffic of ECS instances.

  • VpcInternetTx: the average outbound Internet traffic of ECS instances.

  • VpcInternetRx: the average inbound Internet traffic of ECS instances.

  • LoadBalancerRealServerAverageQps: the average queries per second (QPS) per backend server in an ALB server group.

Valid values for predictive scaling rules:

  • CpuUtilization: the average CPU utilization of ECS instances.

  • IntranetRx: the average inbound internal traffic of ECS instances.

  • IntranetTx: the average outbound internal traffic of ECS instances.

For more information, see System monitoring event-triggered tasks.

CpuUtilization

TargetValue

number

No

The target value. This parameter applies to target tracking scaling rules and predictive scaling rules. The value can have up to three decimal places and must be greater than 0.

0.125

DisableScaleIn

boolean

No

Specifies whether to disable scale-in. This parameter applies only to target tracking scaling rules.

true

ScaleInEvaluationCount

integer

No

After a target tracking scaling rule is created, an event-triggered task is automatically created. This parameter specifies the number of consecutive times that the threshold condition must be met to trigger an alert for the corresponding scale-in event-triggered task.

15

ScaleOutEvaluationCount

integer

No

After a target tracking scaling rule is created, an event-triggered task is automatically created. This parameter specifies the number of consecutive times that the threshold condition must be met to trigger an alert for the corresponding scale-out event-triggered task.

3

PredictiveScalingMode

string

No

The mode of the predictive scaling rule. Valid values:

  • PredictAndScale: generates predictions and creates predictive tasks.

  • PredictOnly: generates predictions but does not create predictive tasks.

PredictAndScale

PredictiveValueBehavior

string

No

The method to handle the maximum value for the predictive scaling rule. Valid values:

  • MaxOverridePredictiveValue: the initial maximum value overrides the predicted value. If the predicted value is greater than the initial maximum value, the initial maximum value is used as the maximum value for the predictive task.

  • PredictiveValueOverrideMax: the predicted value overrides the initial maximum value. If the predicted value is greater than the initial maximum value, the predicted value is used as the maximum value for the predictive task.

  • PredictiveValueOverrideMaxWithBuffer: a buffer ratio is added to the predicted value. The predicted value is increased by the ratio specified by PredictiveValueBuffer. If the increased value is greater than the initial maximum value, the increased value is used.

MaxOverridePredictiveValue

PredictiveValueBuffer

integer

No

The buffer ratio added to the predicted value. This parameter takes effect only when PredictiveValueBehavior is set to PredictiveValueOverrideMaxWithBuffer. The predicted value is increased by this ratio. If the increased value is greater than the initial maximum value, the increased value is used. Valid values: 0 to 100.

50

PredictiveTaskBufferTime

integer

No

The buffer time before the predictive task is executed. Predictive tasks automatically created by predictive scaling rules are executed on the hour by default. You can set a buffer time to execute the predictive task in advance and prepare resources. Unit: minutes. Valid values: 0 to 60.

30

InitialMaxSize

integer

No

The maximum number of instances in the scaling group. This parameter is used together with PredictiveValueBehavior.

100

StepAdjustment

array<object>

No

The set of step adjustments.

object

No

The set of step adjustments.

MetricIntervalUpperBound

number

No

The upper limit of the step adjustment. This parameter applies only to step scaling rules. Valid values: -9.999999E18 to 9.999999E18.

5.0

ScalingAdjustment

integer

No

The number of instances to be adjusted for the step adjustment. This parameter applies only to step scaling rules.

1

MetricIntervalLowerBound

number

No

The lower limit of the step adjustment. This parameter applies only to step scaling rules. Valid values: -9.999999E18 to 9.999999E18.

1.0

AlarmDimension

array<object>

No

The dimension information associated with the metric. This parameter applies to target tracking scaling rules and is configured when the metric requires additional dimension information. For example, the LoadBalancerRealServerAverageQps metric requires the rulePool dimension information.

object

No

The dimension information associated with the metric. This parameter applies to target tracking scaling rules and is configured when the metric requires additional dimension information. For example, the LoadBalancerRealServerAverageQps metric requires the rulePool dimension information.

DimensionKey

string

No

The key of the dimension information associated with the metric.

rulePool

DimensionValue

string

No

The value of the dimension information associated with the metric.

sgp-l1cbirz451yxu2****

MetricType

string

No

The metric type. Valid values:

  • system: uses system metrics from CloudMonitor.

  • custom: uses custom metrics reported to CloudMonitor.

  • hybrid: uses metrics from Hybrid Cloud Monitoring.

system

HybridMonitorNamespace

string

No

The ID of the Hybrid Cloud Monitoring monitoring metrics repository.

For more information about how to manage monitoring metrics repositories, see Manage monitoring metrics repositories.

aliyun-test

HybridMetrics

array<object>

No

The Hybrid Cloud Monitoring monitoring metrics settings. For more information about how to configure the settings, see Customize target tracking scaling rules by using formula operations.

array<object>

No

Id

string

No

The reference ID of the metric in the metric operation expression.

a

Expression

string

No

The metric operation expression for multiple Hybrid Cloud Monitoring metrics. The calculation result of the expression is used to trigger scaling activities.

The operation expression must comply with the Reverse Polish Notation (RPN) specification, and only the +, -, *, and / operators are supported.

(a+b)/2

MetricName

string

No

The name of the metric in the Hybrid Cloud Monitoring monitoring metrics repository.

AliyunSmq_NumberOfMessagesVisible

Statistic

string

No

The statistical method of the metric. Valid values:

  • Average: the average value of all data points in the specified period.

  • Minimum: the minimum value of all data points in the specified period.

  • Maximum: the maximum value of all data points in the specified period.

Average

Dimensions

array<object>

No

The dimensions of the metric. This parameter is used to specify the resources monitored by the metric.

object

No

DimensionKey

string

No

The key of the metric dimension.

queue

DimensionValue

string

No

The value of the metric dimension.

testQueue

AlarmOptions

object

No

The alert attributes.

Period

integer

No

The period for collecting metric data in the target tracking scaling rule. Unit: seconds. Valid values:

  • 15

  • 60

  • 120

  • 300

  • 900

Note

Default value: 60.

60

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.