All Products
Search
Document Center

:DescribeApplicationScalingRule

Last Updated:Aug 01, 2024

Queries an auto scaling policy of an application.

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

Request syntax

GET /pop/v1/sam/scale/applicationScalingRule

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

a0d2e04c-159d-40a8-b240-d2f2c263****

a0d2e04c-159d-40a8-b240-d2f2c263****
ScalingRuleNamestringYes

test

test

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

73404D3D-EE4F-4CB2-B197-5C46F6A1****
TraceIdstring

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

0b57ff7e16243300839193068e****
Dataobject

The returned data.

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.

object
AtTimestring

The point in time. Format: Hour:Minute.

08:00
TargetReplicasinteger

The expected number of instances.

2
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.

1624330075827
AppIdstring

The ID of the application.

a0d2e04c-159d-40a8-b240-d2f2c263****
CreateTimelong

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

1624329843790
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.

object
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 QPS of the Internet-facing 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 for an 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 is used to trigger the current auto scaling policy.

object
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.

object
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
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 within a specific period of time.

100
StabilizationWindowSecondslong

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

300
Disabledboolean

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

  • true: The application scale-in is disabled.
  • false: The application scale-in is enabled.
Note When this parameter is set to true, the application instances are never 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 within a specific period of time.

100
StabilizationWindowSecondslong

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

300
Disabledboolean

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

  • true: disabled.
  • false: enabled.
Note When this parameter is set to true, the application instances are never 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": "73404D3D-EE4F-4CB2-B197-5C46F6A1****",
  "TraceId": "0b57ff7e16243300839193068e****",
  "Data": {
    "Timer": {
      "EndDate": "2021-04-25",
      "BeginDate": "2021-03-25",
      "Schedules": [
        {
          "AtTime": "08:00",
          "TargetReplicas": 2
        }
      ],
      "Period": "* * *"
    },
    "UpdateTime": 1624330075827,
    "AppId": "a0d2e04c-159d-40a8-b240-d2f2c263****",
    "CreateTime": 1624329843790,
    "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,
      "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
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