Describes the Auto Scaling policies for an application.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:DescribeApplicationScalingRules |
get |
*All Resource
|
None | None |
Request syntax
GET /pop/v1/sam/scale/applicationScalingRules HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AppId |
string |
Yes |
The application ID. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned information. |
||
| RequestId |
string |
The request ID. |
91F93257-7A4A-4BD3-9A7E-2F6EAE6D**** |
| TraceId |
string |
The trace ID used to query the details of a request. |
0a98a02315955564772843261e**** |
| Data |
object |
The returned data. |
|
| CurrentPage |
integer |
The current page number. |
1 |
| TotalSize |
integer |
The total number of auto scaling policies for the application. |
3 |
| PageSize |
integer |
The number of entries per page. |
10 |
| ApplicationScalingRules |
array<object> |
A list of auto scaling policies for the application. |
|
|
array<object> |
An auto scaling policy. |
||
| Timer |
object |
The scheduled scaling policy. |
|
| EndDate |
string |
The end date of the short-term scheduled scaling policy. The following rules apply:
|
2021-04-25 |
| BeginDate |
string |
The start date of the short-term scheduled scaling policy. The following rules apply:
|
2021-03-25 |
| Schedules |
array<object> |
The daily trigger schedule for the policy. |
|
|
object |
A specific trigger time and its target number of instances. |
||
| AtTime |
string |
The trigger time in |
08:00 |
| TargetReplicas |
integer |
The target number of instances. |
3 |
| MaxReplicas |
integer |
The maximum number of instances. |
50 |
| MinReplicas |
integer |
The minimum number of instances. |
1 |
| Period |
string |
The days on which the scheduled scaling policy runs. Valid values:
|
* * * |
| TimeZone |
string |
The time zone. |
|
| UpdateTime |
integer |
The timestamp of the last policy update, in milliseconds. |
1616642248938 |
| AppId |
string |
The application ID. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| CreateTime |
integer |
The timestamp of the policy's creation, in milliseconds. |
1616642248938 |
| LastDisableTime |
integer |
The timestamp of when the policy was last disabled. |
1641882854484 |
| ScaleRuleEnabled |
boolean |
Indicates whether the auto scaling policy is enabled. Valid values:
|
true |
| ScaleRuleType |
string |
The type of the auto scaling policy. Valid values:
|
timing |
| Metric |
object |
The metric-based scaling policy. |
|
| Metrics |
array<object> |
The metric-based conditions that trigger scaling. |
|
|
object |
A metric condition that can trigger a scaling event. |
||
| MetricTargetAverageUtilization |
integer |
The target value for the metric. The unit varies based on the value of
|
20 |
| MetricType |
string |
The metric used to trigger the auto scaling policy. Valid values:
|
CPU |
| SlbProject |
string |
The project in Log Service that stores SLB access logs. |
test |
| SlbLogstore |
string |
The Logstore in Log Service that stores SLB access logs. |
test |
| Vport |
string |
The monitored port of the SLB instance. |
80 |
| SlbId |
string |
The ID of the SLB instance. |
lb-xxx |
| PrometheusMetrics |
array<object> |
The Prometheus metrics. |
|
|
object |
|||
| PrometheusQuery |
string |
The Prometheus query. |
|
| TargetMetricValue |
string |
The target value for the Prometheus query that triggers a scaling event. |
|
| MetricsStatus |
object |
The status of the metric-based scaling policy. |
|
| DesiredReplicas |
integer |
The target number of instances. |
2 |
| NextScaleTimePeriod |
integer |
The next period for metric-based scaling. |
3 |
| CurrentReplicas |
integer |
The current number of instances. |
2 |
| LastScaleTime |
string |
The time of the last scaling activity. |
2022-01-11T08:14:32Z |
| CurrentMetrics |
array<object> |
A list of the current metrics for scaling. |
|
|
object |
The metric data. |
||
| Type |
string |
The data type. This parameter is associated with the specified metric.
|
Resource |
| CurrentValue |
integer |
The current value. |
0 |
| Name |
string |
The name of the trigger condition.
|
cpu |
| NextScaleMetrics |
array<object> |
A list of metrics for the next scaling activity. |
|
|
object |
The metric data. |
||
| NextScaleOutAverageUtilization |
integer |
The metric value that triggers the next scale-out event. The value is a percentage. |
21 |
| NextScaleInAverageUtilization |
integer |
The metric value that triggers the next scale-in event. The value is a percentage. |
10 |
| Name |
string |
The name of the trigger condition.
|
cpu |
| MaxReplicas |
integer |
The maximum number of instances. |
3 |
| MinReplicas |
integer |
The minimum number of instances. |
1 |
| MaxReplicas |
integer |
The maximum number of instances. |
3 |
| MinReplicas |
integer |
The minimum number of instances. |
1 |
| ScaleUpRules |
object |
Configuration for scale-out events. |
|
| Step |
integer |
The number of instances to add in a single scale-out event. |
100 |
| StabilizationWindowSeconds |
integer |
The cooldown time for scale-out events, in seconds. During this period, no further scaling events are triggered. The value must be an integer from 0 to 3,600. The default value is 0. |
300 |
| Disabled |
boolean |
Specifies whether to disable scale-out. Valid values:
Note
If this parameter is set to |
false |
| ScaleDownRules |
object |
Configuration for scale-in events. |
|
| Step |
integer |
The number of instances to remove in a single scale-in event. |
100 |
| StabilizationWindowSeconds |
integer |
The cooldown time for scale-in events, in seconds. During this period, no further scaling events are triggered. The value must be an integer from 0 to 3,600. The default value is 0. |
300 |
| Disabled |
boolean |
Specifies whether to disable scale-in. Valid values:
Note
Setting this to |
false |
| MetricSource |
string |
The source of the metrics. |
|
| PrometheusUrl |
string |
The endpoint of the Prometheus service. |
|
| PrometheusToken |
string |
The Prometheus token. |
|
| ScaleRuleName |
string |
The name of the auto scaling policy. |
test |
| MinReadyInstances |
integer |
The minimum number of available instances. Valid values:
Note
To ensure business continuity during a rolling deployment, we recommend that you set this parameter to a value greater than or equal to 1. |
1 |
| MinReadyInstanceRatio |
integer |
The minimum number of available instances, specified as a percentage. Valid values:
Note
If you specify both MinReadyInstances and MinReadyInstanceRatio, the value of MinReadyInstanceRatio takes precedence, unless it is set to -1. |
-1 |
| Message |
string |
The response message. Valid values:
|
success |
| ErrorCode |
string |
The error code. This parameter is returned only when the request fails.
|
|
| Code |
string |
The HTTP status code. Valid values:
|
200 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"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": "* * *",
"TimeZone": ""
},
"UpdateTime": 1616642248938,
"AppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****",
"CreateTime": 1616642248938,
"LastDisableTime": 1641882854484,
"ScaleRuleEnabled": true,
"ScaleRuleType": "timing",
"Metric": {
"Metrics": [
{
"MetricTargetAverageUtilization": 20,
"MetricType": "CPU",
"SlbProject": "test",
"SlbLogstore": "test",
"Vport": "80",
"SlbId": "lb-xxx"
}
],
"PrometheusMetrics": [
{
"PrometheusQuery": "",
"TargetMetricValue": ""
}
],
"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
},
"MetricSource": "",
"PrometheusUrl": "",
"PrometheusToken": ""
},
"ScaleRuleName": "test",
"MinReadyInstances": 1,
"MinReadyInstanceRatio": -1
}
]
},
"Message": "success",
"ErrorCode": "",
"Code": "200",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.