Décrit une stratégie de mise à l'échelle automatique pour une application.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
sae:DescribeApplicationScalingRule |
get |
*All Resource
|
Aucune | Aucune |
Syntaxe de la requête
GET /pop/v1/sam/scale/applicationScalingRule HTTP/1.1
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| AppId |
string |
Oui |
L'identifiant de l'application. |
a0d2e04c-159d-40a8-b240-d2f2c263**** |
| ScalingRuleName |
string |
Oui |
Le nom de la stratégie de mise à l'échelle automatique. |
test |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
Les informations renvoyées. |
||
| RequestId |
string |
L'identifiant de la requête. |
73404D3D-EE4F-4CB2-B197-5C46F6A1**** |
| TraceId |
string |
L'identifiant de trace. Utilisez cet identifiant pour interroger les détails d'une requête. |
0b57ff7e16243300839193068e**** |
| Data |
object |
Les données renvoyées. |
|
| Timer |
object |
La stratégie de mise à l'échelle planifiée. |
|
| EndDate |
string |
The end date of a short-term scheduled scaling policy. The following list describes the valid values:
|
2021-04-25 |
| BeginDate |
string |
The start date of a short-term scheduled scaling policy. The following list describes the valid values:
|
2021-03-25 |
| Schedules |
array<object> |
The points in time when the auto scaling policy is triggered within a day. |
|
|
object |
The data of a point in time. |
||
| AtTime |
string |
The point in time. Format: HH:mm. |
08:00 |
| TargetReplicas |
integer |
The target number of instances. |
2 |
| MinReplicas |
integer |
The minimum number of instances. |
1 |
| MaxReplicas |
integer |
The maximum number of instances. |
10 |
| Period |
string |
The period in which the scheduled scaling policy is executed. Valid values:
|
* * * |
| UpdateTime |
integer |
L'heure à laquelle la stratégie de mise à l'échelle automatique a été mise à jour. Unité : millisecondes. |
1624330075827 |
| AppId |
string |
L'identifiant de l'application. |
a0d2e04c-159d-40a8-b240-d2f2c263**** |
| CreateTime |
integer |
L'heure à laquelle la stratégie de mise à l'échelle automatique a été créée. Unité : millisecondes. |
1624329843790 |
| LastDisableTime |
integer |
L'heure à laquelle la stratégie de mise à l'échelle automatique a été désactivée pour la dernière fois. |
1641882854484 |
| ScaleRuleEnabled |
boolean |
Indique si la stratégie de mise à l'échelle automatique est activée. Valeurs valides :\n\n- true : la stratégie est activée.\n\n- false : la stratégie est désactivée. |
true |
| ScaleRuleType |
string |
Le type de la stratégie de mise à l'échelle automatique. Valeurs valides :
|
timing |
| Metric |
object |
La stratégie de mise à l'échelle basée sur des métriques. |
|
| Metrics |
array<object> |
The list of metric-based scaling policies. |
|
|
object |
The metric data. |
||
| MetricTargetAverageUtilization |
integer |
The target value of the metric.
|
20 |
| MetricType |
string |
The metric that is used to trigger the auto scaling policy. Valid values:
|
CPU |
| SlbProject |
string |
The SLB access log Project. |
test |
| SlbLogstore |
string |
The SLB access log Logstore. |
test |
| Vport |
string |
The port of the SLB instance. |
80 |
| SlbId |
string |
The ID of the SLB instance. |
lb-xxx |
| MetricsStatus |
object |
The status of the metric-based scaling policy. |
|
| DesiredReplicas |
integer |
The target number of instances. |
2 |
| NextScaleTimePeriod |
integer |
The period of the next 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> |
The data of the current metric-based scaling. |
|
|
object |
The metric data. |
||
| Type |
string |
The type of the metric. This parameter is associated with the monitoring metric.
|
Resource |
| CurrentValue |
integer |
The current value. |
0 |
| Name |
string |
The name of the metric.
|
cpu |
| NextScaleMetrics |
array<object> |
The list of metrics for the next scaling activity. |
|
|
object |
The metric data. |
||
| NextScaleOutAverageUtilization |
integer |
The metric threshold for the next scale-out. The value is a percentage. |
21 |
| NextScaleInAverageUtilization |
integer |
The metric threshold for the next scale-in. The value is a percentage. |
10 |
| Name |
string |
The name of the metric.
|
cpu |
| MaxReplicas |
integer |
The maximum number of instances. |
3 |
| MinReplicas |
integer |
The minimum number of instances. |
1 |
| ScaleUpRules |
object |
The scale-out rules. |
|
| Step |
integer |
The scaling step size for scale-outs. The maximum number of instances that can be added at a time. |
100 |
| StabilizationWindowSeconds |
integer |
The cooldown period for scale-outs. The value can be an integer from 0 to 3600. Unit: seconds. Default value: 0. |
300 |
| Disabled |
boolean |
Indicates whether scale-in is disabled. Valid values:
Remarque
If you enable this feature, the application is never scaled in. This prevents business risks that are caused by scale-ins during peak hours. By default, this feature is disabled. |
false |
| ScaleDownRules |
object |
The scale-in rules. |
|
| Step |
integer |
The scaling step size for scale-ins. The maximum number of instances that can be removed at a time. |
100 |
| StabilizationWindowSeconds |
integer |
The cooldown period for scale-ins. The value can be an integer from 0 to 3600. Unit: seconds. Default value: 0. |
300 |
| Disabled |
boolean |
Indicates whether scale-in is disabled. Valid values:
Remarque
If you enable this feature, the application is never scaled in. This prevents business risks that are caused by scale-ins during peak hours. By default, this feature is disabled. |
false |
| ScaleRuleName |
string |
Le nom de la stratégie de mise à l'échelle automatique. |
test |
| MinReadyInstances |
integer |
Le nombre minimum d'instances prêtes. Valeurs valides :
Remarque
Définissez le nombre minimum d'instances prêtes sur une valeur supérieure ou égale à 1 pour chaque déploiement par roulement afin de garantir la continuité de service. |
1 |
| MinReadyInstanceRatio |
integer |
Le pourcentage du nombre minimal d'instances prêtes. Valeurs valides :
Remarque
Si vous spécifiez à la fois MinReadyInstances et MinReadyInstanceRatio, et que la valeur de MinReadyInstanceRatio n'est pas -1, la valeur de MinReadyInstanceRatio prévaut. Par exemple, si MinReadyInstances est défini sur 5 et que MinReadyInstanceRatio est défini sur 50, la valeur 50 est utilisée pour calculer le nombre minimal d'instances prêtes. |
-1 |
| Message |
string |
Les informations supplémentaires. Valeurs valides :
|
success |
| ErrorCode |
string |
Le code d'erreur. Valeurs valides :
|
|
| Code |
string |
Le code d'état HTTP ou un code d'erreur POP. Valeurs valides :
|
200 |
| Success |
boolean |
Indique si l'instance d'application a été redémarrée avec succès.
|
true |
Exemples
JSON format
{
"RequestId": "73404D3D-EE4F-4CB2-B197-5C46F6A1****",
"TraceId": "0b57ff7e16243300839193068e****",
"Data": {
"Timer": {
"EndDate": "2021-04-25",
"BeginDate": "2021-03-25",
"Schedules": [
{
"AtTime": "08:00",
"TargetReplicas": 2,
"MinReplicas": 1,
"MaxReplicas": 10
}
],
"Period": "* * *"
},
"UpdateTime": 1624330075827,
"AppId": "a0d2e04c-159d-40a8-b240-d2f2c263****",
"CreateTime": 1624329843790,
"LastDisableTime": 1641882854484,
"ScaleRuleEnabled": true,
"ScaleRuleType": "timing",
"Metric": {
"Metrics": [
{
"MetricTargetAverageUtilization": 20,
"MetricType": "CPU",
"SlbProject": "test",
"SlbLogstore": "test",
"Vport": "80",
"SlbId": "lb-xxx"
}
],
"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",
"MinReadyInstances": 1,
"MinReadyInstanceRatio": -1
},
"Message": "success",
"ErrorCode": "",
"Code": "200",
"Success": true
}
Codes d'erreur
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.