public static final class UpdateApplicationScalingRuleRequest.Builder extends Object
public UpdateApplicationScalingRuleRequest.Builder appId(String appId)
The application ID.
This parameter is required.
example:7171a6ca-d1cd-4928-8642-7d5cfe69****
public UpdateApplicationScalingRuleRequest.Builder enableIdle(Boolean enableIdle)
public UpdateApplicationScalingRuleRequest.Builder minReadyInstanceRatio(Integer minReadyInstanceRatio)
The percentage of the minimum number of available instances. Take note of the following rules:
example:When MinReadyInstance and MinReadyInstanceRatio are specified and MinReadyInstanceRatio is set to a number from 0 to 100, the value of **MinReadyInstanceRatio** takes precedence.**** For example, if MinReadyInstances is set to **5**, and MinReadyInstanceRatio is set to 50, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × 50%.
-1
public UpdateApplicationScalingRuleRequest.Builder minReadyInstances(Integer minReadyInstances)
The minimum number of available instances. Take note of the following rules:
example:Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.
3
public UpdateApplicationScalingRuleRequest.Builder scalingRuleMetric(String scalingRuleMetric)
The configurations of the metric-based auto scaling policy. This parameter is required if you set the ScalingRuleType parameter to metric.
Parameter description:
maxReplicas: the maximum number of instances in the application.
minReplicas: the minimum number of instances in the application.
metricType: the metric that is used to trigger the auto scaling policy.
metricTargetAverageUtilization: the limit on the metric specified by the metricType parameter.
SlbProject: the Log Service project.
SlbLogstore: the Log Service Logstore.
Vport: the listener port for the SLB instance. HTTP and HTTPS are supported.
scaleUpRules: the scale-out rule.
scaleDownRules: the scale-in rule.
step: the scale-out or scale-in step size. The maximum number of instances that can be added or removed per unit time.
disabled: specifies whether to disable the application scale-in. If you set this parameter to true, the application instances are never scaled in. This prevents business risks during peak hours.
stabilizationWindowSeconds: the cooldown period during which the system is stable and does not perform scale-out or scale-in operations. Valid values: 0 to 3600. Unit: seconds. Default value: 0.
example:You can specify one or more metrics as the trigger conditions of the auto scaling policy. If you specify multiple metrics, the application is scaled out when the value of a metric is greater than or equal to the limit. The number of application instances after the scale-out cannot exceed the configured maximum number of application instances. If the values of all the metrics are less than the limits, the application is scaled in. The number of instances after the scale-in cannot be less than the configured minimum number of application instances.
{"maxReplicas":3,"minReplicas":1,"metrics":[{"metricType":"CPU","metricTargetAverageUtilization":20},{"metricType":"MEMORY","metricTargetAverageUtilization":30},{"metricType":"tcpActiveConn","metricTargetAverageUtilization":20},{"metricType":"SLB_QPS","MetricTargetAverageUtilization":25,"SlbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-","SlbLogstore":"function-log","Vport":"80"},{"metricType":"SLB_RT","MetricTargetAverageUtilization":35,"SlbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-","SlbLogstore":"function-log","Vport":"80"}],"scaleUpRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":0},"scaleDownRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":300}}
public UpdateApplicationScalingRuleRequest.Builder scalingRuleName(String scalingRuleName)
The name of the auto scaling policy. The name must start with a lowercase letter and can contain only lowercase letters, digits, and hyphens (-). The name cannot exceed 32 characters in length.
You cannot change the names of created policies.
This parameter is required.
example:timer-0800-2100
public UpdateApplicationScalingRuleRequest.Builder scalingRuleTimer(String scalingRuleTimer)
The configurations of the scheduled auto scaling policy. This parameter is required when you set the ScalingRuleType parameter to timing or when you want to create a scheduled auto scaling policy by using an SDK.
Parameter description:
beginDate and endDate: specify the validity period of the scheduled auto scaling policy. beginDate specifies the start date and endDate specifies the end date. Take note of the following rules:
period: specifies the frequency at which the scheduled auto scaling policy is executed. Valid values:
* * *: The scheduled auto scaling policy is executed at a specified point in time every day.
* * Fri,Mon: The scheduled auto scaling policy is executed at a specified point in time on one or more specified days of each week. GMT+8 is used. Valid values:
1,2,3,28,31 * *: The scheduled auto scaling policy is executed at a specified point in time on one or more days of each month. Valid values: 1 to 31. If the month does not have a 31st day, the auto scaling policy is executed on the specified days other than the 31st day.
schedules: specifies the points in time at which the auto scaling policy is triggered and the number of application instances that are retained during the corresponding period of time. You can specify up to 20 points in time. Parameter description:
atTime: the point in time at which the policy is triggered. Format: Hour:Minute. Example: 08:00.
targetReplicas: specifies the number of application instances that you want to maintain by using this policy. You can also set the value to the minimum number of available instances required for each application release. Valid values: 1 to 50.
**
NoteMake sure that at least one instance is available during the application deployment and rollback to prevent your business from being interrupted. If you set the value to 0, business interruptions occur when the application is updated.
{"beginDate":null,"endDate":null,"period":"* * *","schedules":[{"atTime":"08:00","targetReplicas":10},{"atTime":"20:00","targetReplicas":3}]}
public UpdateApplicationScalingRuleRequest.Builder scalingRuleType(String scalingRuleType)
public UpdateApplicationScalingRuleRequest build()
Copyright © 2026. All rights reserved.