All Products
Search
Document Center

:DescribeApplicationScalingRules

Last Updated:Nov 01, 2024

Queries the auto scaling policies of an application.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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
sae:DescribeApplicationScalingRulesget
  • All Resources
    *
    none
none

Request syntax

GET /pop/v1/sam/scale/applicationScalingRules HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

7171a6ca-d1cd-4928-8642-7d5cfe69****

7171a6ca-d1cd-4928-8642-7d5cfe69****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****
TraceIdstring

The ID of the trace. The ID is used to query the details of a request.

0a98a02315955564772843261e****
Dataobject

The returned data.

CurrentPageinteger

The number of the returned page.

1
TotalSizeinteger

The total number of auto scaling policies.

3
PageSizeinteger

The number of entries returned on each page.

10
ApplicationScalingRulesarray<object>

The auto scaling policies of the application.

ApplicationScalingRuleobject
Timerobject

The details of the scheduled auto scaling policy.

EndDatestring

The end date of the validity period of the scheduled auto scaling policy. Valid values:

  • If both the BeginDate and EndDate parameters are set to null, the auto scaling policy can always be triggered. The default value for these parameters is null.
  • If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if BeginDate is 2021-03-25 and EndDate is 2021-04-25, the auto scaling policy is valid for one month.
2021-04-25
BeginDatestring

The start date of the validity period of the scheduled auto scaling policy. Valid values:

  • If both the BeginDate and EndDate parameters are set to null, the auto scaling policy can always be triggered. The default value for these parameters is null.
  • If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if BeginDate is 2021-03-25 and EndDate is 2021-04-25, the auto scaling policy is valid for one month.
2021-03-25
Schedulesarray<object>

The points in time when the auto scaling policy is triggered within one day.

Scheduleobject
AtTimestring

The point in time. Format: Hour:Minute.

08:00
TargetReplicasinteger

The expected number of instances.

3
MaxReplicaslong

The maximum number of instances.

50
MinReplicaslong

The minimum number of instances.

1
Periodstring

The days on which the scheduled auto scaling policy takes effect. Valid values:

  • * * *: The scheduled auto scaling policy takes effect at a specified time every day.

  • * * Fri,Mon: The scheduled auto scaling policy takes effect at a specified time on one or multiple days of a week. The specified time is in the GMT+8 time zone. Valid values:

    • Sun: Sunday
    • Mon: Monday
    • Tue: Tuesday
    • Wed: Wednesday
    • Thu: Thursday
    • Fri: Friday
    • Sat: Saturday
  • 1,2,3,28,31 * *: The scheduled auto scaling policy takes effect at a specified time on one or multiple days of a month. Valid values: 1 to 31. If the month does not have a 31st day, the auto scaling policy takes effect on the specified days other than the 31st day.

* * *
UpdateTimelong

The time when the auto scaling policy was updated. Unit: milliseconds.

1616642248938
AppIdstring

The ID of the application.

7171a6ca-d1cd-4928-8642-7d5cfe69****
CreateTimelong

The time when the auto scaling policy was created. Unit: milliseconds.

1616642248938
LastDisableTimelong

The time when the auto scaling policy was last disabled.

1641882854484
ScaleRuleEnabledboolean

Indicates whether the auto scaling policy is enabled. Valid values:

  • true: enabled
  • false: disabled
true
ScaleRuleTypestring

The type of the auto scaling policy. Valid values:

  • timing: the scheduled auto scaling policy.
  • metric: the metric-based auto scaling policy.
  • mix: the hybrid auto scaling policy.
timing
Metricobject

The details of the metric-based auto scaling policy.

Metricsarray<object>

The list of metrics that are used to trigger the auto scaling policy.

Metricobject
MetricTargetAverageUtilizationinteger

The limit on the metric.

  • The limit on the CPU utilization. Unit: percentage.
  • The limit on the memory usage. Unit: percentage.
  • The limit on the average number of active TCP connections per second.
  • The limit on the queries per second (QPS) of the Internet-facing Server Load Balancer (SLB) instance.
  • The limit on the response time of the Internet-facing SLB instance. Unit: milliseconds.
20
MetricTypestring

The metric that is used to trigger the auto scaling policy. Valid values:

  • CPU: the CPU utilization.
  • MEMORY: the memory usage.
  • tcpActiveConn: the average number of active TCP connections per second of an application instance in 30 seconds.
  • SLB_QPS: the average QPS of the Internet-facing SLB instance associated with an application instance in 15 seconds.
  • SLB_RT: the average response time of the Internet-facing SLB instance in 15 seconds.
CPU
MetricsStatusobject

The execution status of the metric-based auto scaling policy.

DesiredReplicaslong

The expected number of instances.

2
NextScaleTimePeriodinteger

The duration for which the metric-based auto scaling policy takes effect next time.

3
CurrentReplicaslong

The current number of instances.

2
LastScaleTimestring

The time when the auto scaling policy was last triggered.

2022-01-11T08:14:32Z
CurrentMetricsarray<object>

The metrics that are used to trigger the auto scaling policy this time.

CurrentMetricobject
Typestring

The type of the data. This parameter corresponds to the metric.

  • Resource: used when the metric is the CPU utilization or memory usage.
  • Pods: used when the metric is the number of active TCP connections.
  • External: used when the metric is about the SLB instance or from Application Real-Time Monitoring Service (ARMS).
Resource
CurrentValuelong

The current value of the metric.

0
Namestring

The name of the metric.

  • cpu: the CPU utilization.
  • memory: the memory usage.
  • tcpActiveConn: the number of active TCP connections.
  • slb_incall_qps: the QPS of the Internet-facing SLB instance.
  • slb_incall_rt: the response time of the Internet-facing SLB instance.
cpu
NextScaleMetricsarray<object>

The metrics that are used to trigger the auto scaling policy next time.

NextScaleMetricobject
NextScaleOutAverageUtilizationinteger

The metric value as a percentage that triggers the application scale-out next time.

21
NextScaleInAverageUtilizationinteger

The metric value as a percentage that triggers the application scale-in next time.

10
Namestring

The name of the metric.

  • cpu: the CPU utilization.
  • memory: the memory usage.
  • tcpActiveConn: the number of active TCP connections.
  • slb_incall_qps: the QPS of the Internet-facing SLB instance.
  • slb_incall_rt: the response time of the Internet-facing SLB instance.
cpu
MaxReplicaslong

The maximum number of instances.

3
MinReplicaslong

The minimum number of instances.

1
MaxReplicasinteger

The maximum number of instances.

3
MinReplicasinteger

The minimum number of instances.

1
ScaleUpRulesobject

Rules that determine the application scale-out.

Steplong

The step size for the scale-out. The maximum number of instances that can be added in a unit of time.

100
StabilizationWindowSecondslong

The cooldown time of the scale-out. Valid values: 0 to 3600. Unit: seconds. The default value is 0.

300
Disabledboolean

Indicates whether the application scale-in was disabled. Valid values:

  • true: The application scale-in was disabled.
  • false: The application scale-in was enabled.
Note When this parameter is set to true, the application instances will never be reduced. This prevents risks to your business in peak hours. By default, this parameter is set to false.
false
ScaleDownRulesobject

Rules that determine the application scale-in.

Steplong

The step size for the scale-in. The maximum number of instances that can be reduced in a unit of time.

100
StabilizationWindowSecondslong

The cooldown time of the scale-in. Valid values: 0 to 3600. Unit: seconds. The default value is 0.

300
Disabledboolean

Indicates whether the application scale-in was disabled. Valid values:

  • true: The application scale-in was disabled.
  • false: The application scale-in was enabled.
Note When this parameter is set to true, the application instances will never be reduced. This prevents risks to your business in peak hours. By default, this parameter is set to false.
false
ScaleRuleNamestring

The name of the auto scaling policy.

test

Examples

Sample success responses

JSONformat

{
  "RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "TraceId": "0a98a02315955564772843261e****",
  "Data": {
    "CurrentPage": 1,
    "TotalSize": 3,
    "PageSize": 10,
    "ApplicationScalingRules": [
      {
        "Timer": {
          "EndDate": "2021-04-25",
          "BeginDate": "2021-03-25",
          "Schedules": [
            {
              "AtTime": "08:00",
              "TargetReplicas": 3,
              "MaxReplicas": 50,
              "MinReplicas": 1
            }
          ],
          "Period": "* * *"
        },
        "UpdateTime": 1616642248938,
        "AppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****",
        "CreateTime": 1616642248938,
        "LastDisableTime": 1641882854484,
        "ScaleRuleEnabled": true,
        "ScaleRuleType": "timing",
        "Metric": {
          "Metrics": [
            {
              "MetricTargetAverageUtilization": 20,
              "MetricType": "CPU"
            }
          ],
          "MetricsStatus": {
            "DesiredReplicas": 2,
            "NextScaleTimePeriod": 3,
            "CurrentReplicas": 2,
            "LastScaleTime": "2022-01-11T08:14:32Z",
            "CurrentMetrics": [
              {
                "Type": "Resource",
                "CurrentValue": 0,
                "Name": "cpu"
              }
            ],
            "NextScaleMetrics": [
              {
                "NextScaleOutAverageUtilization": 21,
                "NextScaleInAverageUtilization": 10,
                "Name": "cpu"
              }
            ],
            "MaxReplicas": 3,
            "MinReplicas": 1
          },
          "MaxReplicas": 3,
          "MinReplicas": 1,
          "ScaleUpRules": {
            "Step": 100,
            "StabilizationWindowSeconds": 300,
            "Disabled": false
          },
          "ScaleDownRules": {
            "Step": 100,
            "StabilizationWindowSeconds": 300,
            "Disabled": false
          }
        },
        "ScaleRuleName": "test"
      }
    ]
  },
  "Message": "",
  "ErrorCode": "",
  "Code": "",
  "Success": true
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-08-30The response structure of the API has changedView Change Details
2023-05-31The response structure of the API has changedView Change Details
2023-05-24The response structure of the API has changedView Change Details
2022-12-19The response structure of the API has changedView Change Details