Consulte les détails d'un modèle d'alerte en appelant l'opération DescribeMetricRuleTemplateAttribute.
Description de l'opération
Cette rubrique fournit un exemple de requête pour consulter les détails du modèle d'alerte 70****.
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
|
cms:DescribeMetricRuleTemplateAttribute |
get |
*All Resource
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| Name |
string |
Non |
Le nom du modèle d'alerte. Vous devez définir Name ou TemplateId. Pour plus d'informations sur la façon d'obtenir le nom du modèle d'alerte, consultez DescribeMetricRuleTemplateList. |
ECS_Template1 |
| TemplateId |
string |
Non |
L'identifiant du modèle d'alerte. Vous devez définir Name ou TemplateId. Pour plus d'informations sur la façon d'obtenir l'identifiant du modèle d'alerte, consultez DescribeMetricRuleTemplateList. |
70**** |
Pour plus d'informations sur les paramètres de requête courants, consultez Paramètres courants.
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
Les paramètres de réponse. |
||
| Code |
integer |
Le code d'état HTTP. Remarque
La valeur 200 indique un succès. |
200 |
| Message |
string |
Le message d'erreur. |
La ressource spécifiée est introuvable |
| RequestId |
string |
L'identifiant de la requête. |
8F3A82AD-DA92-52B0-8EC6-C059D1C3839F |
| Success |
boolean |
Indique si l'opération a réussi. Valeurs valides :
|
true |
| Resource |
object |
Les détails du modèle d'alerte. |
|
| Description |
string |
La description du modèle d'alerte. |
Modèle ECS |
| Name |
string |
Le nom du modèle d'alerte. |
ECS_Template1 |
| RestVersion |
string |
La version du modèle d'alerte. |
1 |
| TemplateId |
string |
L'identifiant du modèle d'alerte. |
70**** |
| AlertTemplates |
object |
||
| AlertTemplate |
array<object> |
The alert templates. |
|
|
array<object> |
The alert template. |
||
| MetricName |
string |
The metric name. |
cpu_total |
| Selector |
string |
The extended options of the alert dimension. |
{"disk":"/"} |
| Webhook |
string |
The URL that triggers an alert callback. |
https://www.aliyun.com |
| Namespace |
string |
The namespace of the Alibaba Cloud service. |
acs_ecs_dashboard |
| Category |
string |
The abbreviation of the Alibaba Cloud service name. |
ecs |
| RuleName |
string |
The name of the alert rule. |
ECS_Rule |
| NoDataPolicy |
string |
The processing method when no monitoring data is found. Valid values:
|
KEEP_LAST_STATE |
| Escalations |
object |
The threshold and alert level. |
|
| Info |
object |
The conditions that trigger Info-level alerts. |
|
| ComparisonOperator |
string |
The comparison operator for Info-level alerts. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for Info-level alerts. |
3 |
| Threshold |
string |
The threshold for Info-level alerts. |
90 |
| Statistics |
string |
The statistical method for Info-level alerts. The valid values of |
Average |
| Warn |
object |
The conditions that trigger Warn-level alerts. |
|
| ComparisonOperator |
string |
The comparison operator for Warn-level alerts. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for Warn-level alerts. |
3 |
| Threshold |
string |
The threshold for Warn-level alerts. |
90 |
| Statistics |
string |
The statistical method for Warn-level alerts. The valid values of |
Average |
| Critical |
object |
The conditions that trigger Critical-level alerts. |
|
| ComparisonOperator |
string |
The comparison operator for Critical-level alerts. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for Critical-level alerts. |
5 |
| Threshold |
string |
The threshold for Critical-level alerts. |
90 |
| Statistics |
string |
The statistical method for Critical-level alerts. The valid values of |
Average |
| Labels |
object |
||
| Labels |
array<object> |
The labels of the alert template. |
|
|
object |
The label of the alert template. |
||
| Key |
string |
The key of the alert template label. |
label1 |
| Value |
string |
The value of the alert template label. |
value1 |
| SilenceTime |
integer |
The mute period. Unit: seconds. |
3600 |
Exemples
JSON format
{
"Code": 200,
"Message": "The specified resource is not found.",
"RequestId": "8F3A82AD-DA92-52B0-8EC6-C059D1C3839F",
"Success": true,
"Resource": {
"Description": "ECS template",
"Name": "ECS_Template1",
"RestVersion": "1",
"TemplateId": "70****",
"AlertTemplates": {
"AlertTemplate": [
{
"MetricName": "cpu_total",
"Selector": "{\"disk\":\"/\"}",
"Webhook": "https://www.aliyun.com",
"Namespace": "acs_ecs_dashboard",
"Category": "ecs",
"RuleName": "ECS_Rule",
"NoDataPolicy": "KEEP_LAST_STATE",
"Escalations": {
"Info": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 3,
"Threshold": "90",
"Statistics": "Average"
},
"Warn": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 3,
"Threshold": "90",
"Statistics": "Average"
},
"Critical": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 5,
"Threshold": "90",
"Statistics": "Average"
}
},
"Labels": {
"Labels": [
{
"Key": "label1",
"Value": "value1"
}
]
},
"SilenceTime": 3600
}
]
}
}
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 400 | %s | %s | |
| 412 | %s | %s | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
| 409 | %s | %s |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.