All Products
Search
Document Center

Enterprise Distributed Application Service:UpdateApplicationScalingRule

Last Updated:Dec 22, 2025

Calls the UpdateApplicationScalingRule operation to update the Auto Scaling rule for an application.

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

edas:ManageApplication

update

*Application

acs:edas:{#regionId}:{#accountId}:namespace/{#NameSpaceId}/application/{#AppId}

None None

Request syntax

PUT /pop/v1/eam/scale/application_scaling_rule HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

AppId

string

No

The ID of the application. Call the ListApplication operation to obtain this ID.

78194c76-3dca-418e-a263-cccd1ab4****

ScalingRuleName

string

No

The name of the Auto Scaling policy.

cpu-trigger

ScalingRuleType

string

No

The type of the Auto Scaling policy. Only the following type is supported:

  • trigger: a trigger-based policy.

trigger

ScalingRuleEnable

boolean

No

The status of the Auto Scaling policy.

  • true: enabled

  • false: disabled

true

ScalingRuleMetric

string

No

This parameter is deprecated.

1

ScalingRuleTimer

string

No

This parameter is deprecated.

1

ScalingRuleTrigger

string

No

The trigger policy, which is a JSON string of a ScalingRuleTriggerDTO object. For more information about the format, see the Additional information about request parameters section.

ScalingRuleTriggerDTO{......}

ScalingBehaviour

string

No

The configuration of custom scaling behaviors. For more information about the data structure, see the example.

{"scaleUp":{"stabilizationWindowSeconds":"0","selectPolicy":"Max","policies":[{"type":"Pods","value":5,"periodSeconds":15}]},"scaleDown":{"stabilizationWindowSeconds":"300","selectPolicy":"Max","policies":[{"type":"Percent","value":200,"periodSeconds":15}]}}

Additional information about request parameters

public class ScalingRuleTriggerDTO {
    /**
     * The maximum number of instances. The value cannot exceed 1,000.
     */
    Integer maxReplicas;
    /**
     * The minimum number of instances. The value cannot be less than 0.
     */
    Integer minReplicas;

    /**
     * The list of triggers. Multiple triggers are supported.
     */
    List<Trigger> triggers;

    @Data
    @ToString
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Trigger {
        /**
         * The trigger type. Valid values: cron (scheduled) and app_metric (application monitoring).
         */
        String type;

        /**
         * The name of the trigger. The name must start with a letter and can contain digits, letters, hyphens (-), and underscores (_). The name can be up to 30 characters in length.
         */
        String name;

        /**
          The trigger metadata. This is a JSON map of the string-to-string type. The supported metadata varies by trigger type.
          1. cron
           {"period":"weekly","dryRun":"false","timerInDay":[{"atTime":"08:00","targetReplicas":2},{"atTime":"20:00","targetReplicas":1}],"timerInWeek":["Sat","Thu"]}
          * period: The period. Valid values: daily, weekly, and monthly.
          * dryRun: If set to false, the system monitors and performs scaling. If set to true, the system only monitors metrics.
          * timerInDay: The daily scaling cycle. Specifies when to maintain a specific number of replicas.
         * timerInWeek: The day of the week in a cron expression. For example, Fri.

         2. app_metric
         {\"metricName\":\"arms_appstat.incall_QPS\",\"dryRun\":\"false\",\"targetValAvg\":\"true\",\"targetAverageValue\":\"100\"}
         
         * metricName:
              * arms_appstat.incall_QPS (queries per second (QPS))
              * arms_appstat.incall_rt (response time)
              * arms_appstat.system_CPU (CPU usage)
              * arms_appstat.system_MEM (memory usage)
         * dryRun: Same as the dryRun parameter for the cron trigger type.
        * targetValAvg: Specifies whether to calculate the average value. Set to true for QPS and false for other metrics.
        * targetAverageValue/targetValue: If targetValAvg is set to true, use targetAverageValue. If targetValAvg is set to false, use targetValue.
        */
        String metadata;
    }
}

Response elements

Element

Type

Description

Example

object

Code

integer

The HTTP status code.

200

Message

string

The returned message.

success

RequestId

string

The request ID.

a5281053-08e4-47a5-b2ab-5c0323de7b5a

AppScalingRule

object

The Auto Scaling policy.

UpdateTime

integer

The UNIX timestamp when the Auto Scaling policy was updated. Unit: milliseconds.

1574251601785

CreateTime

integer

The UNIX timestamp when the Auto Scaling policy was created. Unit: milliseconds.

1574251601785

AppId

string

The ID of the application to which the Auto Scaling policy belongs.

78194c76-3dca-418e-a263-cccd1ab4****

LastDisableTime

integer

The UNIX timestamp when the Auto Scaling policy was last disabled. Unit: milliseconds.

1574251601785

MaxReplicas

integer

This parameter is deprecated.

1

ScaleRuleEnabled

boolean

The status of the Auto Scaling policy.

  • true: enabled

  • false: disabled

true

ScaleRuleType

string

The type of the Auto Scaling policy. Only the trigger type is supported.

trigger

MinReplicas

integer

This parameter is deprecated.

1

ScaleRuleName

string

The name of the Auto Scaling policy.

cpu-trigger

Metric

object

This parameter is deprecated.

MinReplicas

integer

This parameter is deprecated.

1

MaxReplicas

integer

This parameter is deprecated.

1

Metrics

array<object>

This parameter is deprecated.

object

MetricTargetAverageUtilization

integer

This parameter is deprecated.

1

MetricType

string

This parameter is deprecated.

cpu

Trigger

object

The trigger configuration.

MinReplicas

integer

The minimum number of replicas. The value cannot be less than 0.

1

MaxReplicas

integer

The maximum number of replicas. The value cannot exceed 1,000.

122

Triggers

array<object>

The list of trigger configurations.

object

Type

string

The trigger type. Only cron and app_metric are supported.

cron

MetaData

string

The metadata of the trigger.

{"dryRun":true}

Name

string

The name of the trigger.

cpu

Behaviour

object

The scaling behavior configuration.

ScaleUp

object

The scale-out behavior configuration.

StabilizationWindowSeconds

integer

The cooldown time for scale-outs. Valid values: 0 to 3,600. Unit: seconds. Default value: 0.

0

SelectPolicy

string

The policy for the scale-out step size. Valid values: Max, Min, and Disable.

Max

Policies

array<object>

The policy configurations.

object

PeriodSeconds

integer

The check period. Valid values: 0 to 1,800. Unit: seconds.

15

Type

string

The policy type. Valid values: Pods and Percent.

Pods

Value

string

The value of the policy for the scaling behavior. The value must be an integer greater than 0. If the policy type is Pods, the value indicates the number of pods. If the policy type is Percent, the value indicates a percentage, which can exceed 100%.

10

ScaleDown

object

The scale-in behavior configuration.

StabilizationWindowSeconds

integer

The cooldown time for scale-ins. Valid values: 0 to 3,600. Unit: seconds. Default value: 300.

300

SelectPolicy

string

The policy for the scale-in step size. Valid values: Max, Min, and Disable.

Max

Policies

array<object>

The policy configurations.

object

PeriodSeconds

integer

The check period. Valid values: 0 to 1,800. Unit: seconds.

15

Type

string

The policy type. Valid values: Pods and Percent.

Pods

Value

string

The value of the policy for the scaling behavior. The value must be an integer greater than 0. If the policy type is Pods, the value indicates the number of pods. If the policy type is Percent, the value indicates a percentage, which can exceed 100%.

10

Examples

Success response

JSON format

{
  "Code": 200,
  "Message": "success",
  "RequestId": "a5281053-08e4-47a5-b2ab-5c0323de7b5a",
  "AppScalingRule": {
    "UpdateTime": 1574251601785,
    "CreateTime": 1574251601785,
    "AppId": "78194c76-3dca-418e-a263-cccd1ab4****",
    "LastDisableTime": 1574251601785,
    "MaxReplicas": 1,
    "ScaleRuleEnabled": true,
    "ScaleRuleType": "trigger",
    "MinReplicas": 1,
    "ScaleRuleName": "cpu-trigger",
    "Metric": {
      "MinReplicas": 1,
      "MaxReplicas": 1,
      "Metrics": [
        {
          "MetricTargetAverageUtilization": 1,
          "MetricType": "cpu"
        }
      ]
    },
    "Trigger": {
      "MinReplicas": 1,
      "MaxReplicas": 122,
      "Triggers": [
        {
          "Type": "cron",
          "MetaData": "{\"dryRun\":true}",
          "Name": "cpu"
        }
      ]
    },
    "Behaviour": {
      "ScaleUp": {
        "StabilizationWindowSeconds": 0,
        "SelectPolicy": "Max",
        "Policies": [
          {
            "PeriodSeconds": 15,
            "Type": "Pods",
            "Value": "10"
          }
        ]
      },
      "ScaleDown": {
        "StabilizationWindowSeconds": 300,
        "SelectPolicy": "Max",
        "Policies": [
          {
            "PeriodSeconds": 15,
            "Type": "Pods",
            "Value": "10"
          }
        ]
      }
    }
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.