Consulte la liste des tâches de surveillance de la disponibilité.
Description de l'opération
Cette rubrique fournit un exemple montrant comment interroger la liste des tâches de surveillance de la disponibilité pour le compte actuel. La réponse indique que le compte actuel possède un enregistrement de tâche de surveillance de la disponibilité ecs_instance.
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:DescribeHostAvailabilityList |
get |
*All Resource
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| Id |
integer |
Non |
L'identifiant de la tâche de surveillance de la disponibilité. |
123456 |
| Ids |
string |
Non |
Les identifiants de plusieurs tâches de surveillance de la disponibilité. Séparez les identifiants multiples par des virgules (,). |
123456,345678 |
| TaskName |
string |
Non |
Le nom de la tâche de surveillance de la disponibilité. |
ecs_instance |
| PageNumber |
integer |
Non |
Le numéro de page. Valeur minimale : 1. Valeur par défaut : 1. |
1 |
| PageSize |
integer |
Non |
Le nombre d'entrées par page. Valeur minimale : 1. Valeur par défaut : 10. |
10 |
| GroupId |
integer |
Non |
L'identifiant du groupe d'applications. |
12345 |
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 |
|||
| Code |
string |
Le code d'état. 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. |
4A288E86-45C3-4858-9DB0-6D85B10BD92A |
| Total |
integer |
Le nombre total d'enregistrements. |
1 |
| Success |
boolean |
Indique si l'opération a réussi. Valeurs valides :
|
true |
| TaskList |
object |
||
| NodeTaskConfig |
array<object> |
La liste des tâches de surveillance de la disponibilité. |
|
|
array<object> |
La liste des tâches de surveillance de la disponibilité. |
||
| TaskType |
string |
The task type. Valid values:
|
HTTP |
| GroupName |
string |
The name of the application group. |
Group_ECS |
| GroupId |
integer |
The ID of the application group. |
12345 |
| TaskName |
string |
The name of the availability monitoring task. |
ecs_instance |
| Disabled |
boolean |
Indicates whether the availability monitoring task is disabled. Valid values:
|
false |
| TaskScope |
string |
The detection scope of the availability monitoring task. Valid values:
|
GROUP |
| Id |
integer |
The ID of the availability monitoring task. |
123456 |
| Instances |
object |
||
| Instance |
array |
The list of ECS instances that initiate detection. |
|
|
string |
The list of ECS instances that initiate detection. |
i-abcdefgh12**** |
|
| TaskOption |
object |
The parameter options of the availability monitoring task. |
|
| HttpMethod |
string |
The method of the detection type. Valid values:
|
GET |
| Interval |
integer |
The detection frequency. Unit: seconds. |
60 |
| HttpURI |
string |
The URI for HTTP detection. |
https://www.aliyun.com |
| TelnetOrPingHost |
string |
The domain name or address to detect. |
ssh.aliyun.com |
| HttpResponseCharset |
string |
The response character set for HTTP detection. |
UTF-8 |
| HttpPostContent |
string |
The POST content of the HTTP detection request. |
params1=paramsValue1 |
| HttpNegative |
boolean |
The alert rule for matching HTTP response content. Valid values:
|
true |
| HttpKeyword |
string |
The keyword to match in the HTTP detection response content. |
OK |
| AlertConfig |
object |
The alert rule configuration. |
|
| SilenceTime |
integer |
The mute period. Unit: seconds. Default value: 86400. |
86400 |
| EndTime |
integer |
The end time of the effective time window for the alert. The data type is integer. Valid values: 0 to 23. Unit: hours. The value represents a specific time of day (for example, 22 indicates 22:00:00). The time zone is UTC+8 by default. Remarque
If the current time is not within the effective time window, the system does not send alert notifications even if the threshold is exceeded. |
22 |
| StartTime |
integer |
The start time of the effective time window for the alert. The data type is integer. Valid values: 0 to 23. Unit: hours. The value represents a specific time of day (for example, 0 indicates 00:00:00). The time zone is UTC+8 by default. Remarque
If the current time is not within the effective time window, the system does not send alert notifications even if the threshold is exceeded. |
0 |
| WebHook |
string |
The callback URL when an alert is triggered. CloudMonitor pushes alert information to this URL by using POST requests. Only the HTTP protocol is supported. |
https://www.aliyun.com |
| NotifyType |
integer |
The alert notification type. Valid values:
|
1 |
| EscalationList |
object |
||
| escalationList |
array<object> |
The alert trigger conditions. |
|
|
object |
The alert trigger conditions. |
||
| Value |
string |
The alert threshold. |
400 |
| MetricName |
string |
The metric for the alert. Valid values:
|
HttpStatus |
| Operator |
string |
The comparison operator for the alert rule. Valid values:
|
= |
| Times |
string |
The alert period. The number of consecutive periods during which the threshold is exceeded. |
3 |
| Aggregate |
string |
The statistical method for the alert. Valid values vary by metric:
|
Value |
| TargetList |
object |
||
| Target |
array<object> |
The list of alert targets. |
|
|
object |
The list of alert targets. |
||
| Id |
string |
The ID of the alert trigger target. |
1 |
| Arn |
string |
The ARN of the resource. Format:
|
acs:mns:cn-hangzhou:17754132319*****:/queues/test/messages |
| Level |
string |
The alert level. Valid values:
|
INFO |
| JsonParams |
string |
The JSON-formatted parameters of the alert callback. |
{"key1":"value1"} |
Exemples
JSON format
{
"Code": "200",
"Message": "The specified resource is not found.",
"RequestId": "4A288E86-45C3-4858-9DB0-6D85B10BD92A",
"Total": 1,
"Success": true,
"TaskList": {
"NodeTaskConfig": [
{
"TaskType": "HTTP",
"GroupName": "Group_ECS",
"GroupId": 12345,
"TaskName": "ecs_instance",
"Disabled": false,
"TaskScope": "GROUP",
"Id": 123456,
"Instances": {
"Instance": [
"i-abcdefgh12****"
]
},
"TaskOption": {
"HttpMethod": "GET",
"Interval": 60,
"HttpURI": "https://www.aliyun.com",
"TelnetOrPingHost": "ssh.aliyun.com",
"HttpResponseCharset": "UTF-8",
"HttpPostContent": "params1=paramsValue1",
"HttpNegative": true,
"HttpKeyword": "OK"
},
"AlertConfig": {
"SilenceTime": 86400,
"EndTime": 22,
"StartTime": 0,
"WebHook": "https://www.aliyun.com",
"NotifyType": 1,
"EscalationList": {
"escalationList": [
{
"Value": "400",
"MetricName": "HttpStatus",
"Operator": "=",
"Times": "3",
"Aggregate": "Value"
}
]
},
"TargetList": {
"Target": [
{
"Id": "1",
"Arn": "acs:mns:cn-hangzhou:17754132319*****:/queues/test/messages",
"Level": "INFO",
"JsonParams": "{\"key1\":\"value1\"}"
}
]
}
}
}
]
}
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 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. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.