Modifies an availability monitoring task.
Operation description
This topic provides an example on how to change the name of availability monitoring task 12345 in application group 123456 to task2.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:ModifyHostAvailability |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GroupId |
integer |
Yes |
The ID of the application group. |
123456 |
| Id |
integer |
Yes |
The ID of the availability monitoring task. |
12345 |
| TaskName |
string |
Yes |
The name of the availability monitoring task. |
task2 |
| TaskScope |
string |
No |
The detection scope of the availability monitoring task. Valid values:
|
GROUP |
| TaskOption.HttpURI |
string |
No |
The URI for HTTP or Telnet detection types. |
https://www.aliyun.com telnet://127.0.0.1:80 |
| TaskOption.TelnetOrPingHost |
string |
No |
The domain name or address to detect. Note
If the detection task type is PING, you must set this parameter. For more information about how to set the detection task type, see CreateHostAvailability. |
www.aliyun.com |
| TaskOption.HttpResponseCharset |
string |
No |
The response character set for the HTTP detection type. Note
Only UTF-8 is supported. |
UTF-8 |
| TaskOption.HttpPostContent |
string |
No |
The POST content of the HTTP detection request. |
params1=value1 |
| TaskOption.HttpResponseMatchContent |
string |
No |
The content to match in the HTTP detection response. |
ok |
| TaskOption.HttpMethod |
string |
No |
The method for the detection type. Valid values:
Note
If the detection task type is HTTP, you must set this parameter. For more information about how to set the detection task type, see CreateHostAvailability. |
GET |
| TaskOption.HttpNegative |
boolean |
No |
The alert rule for matching HTTP response content. Valid values:
Note
If the detection task type is HTTP, you must set this parameter. For more information about how to set the detection task type, see CreateHostAvailability. |
true |
| TaskOption.HttpHeader |
string |
No |
The header of the HTTP request. The format is |
params1:value1 |
| TaskOption.Interval |
integer |
No |
The detection frequency. Unit: seconds. Valid values: 15, 30, 60, 120, 300, 900, 1800, and 3600. Note
Only CloudMonitor agent 3.5.1 or later supports this parameter. |
60 |
| AlertConfig.NotifyType |
integer |
Yes |
The alert notification type. Valid values: 0: Email + DingTalk chatbot. |
0 |
| AlertConfig.StartTime |
integer |
No |
The start time when the alert takes effect. Valid values: 0 to 23. For example, if AlertConfig.StartTime is set to 0 and AlertConfig.EndTime is set to 22, the alert is effective from 00:00:00 to 22:00:00. Note
If the alert is not within the effective period, no alert notification is sent even if the threshold is exceeded. |
0 |
| AlertConfig.EndTime |
integer |
No |
The end time when the alert takes effect. Valid values: 0 to 23. For example, if AlertConfig.StartTime is set to 0 and AlertConfig.EndTime is set to 22, the alert is effective from 00:00:00 to 22:00:00. Note
If the alert is not within the effective period, no alert notification is sent even if the threshold is exceeded. |
22 |
| AlertConfig.SilenceTime |
integer |
No |
The mute period. Unit: seconds. Default value: 86400 (1 day). |
86400 |
| AlertConfig.WebHook |
string |
No |
The webhook address. |
https://www.aliyun.com/webhook.json |
| AlertConfigEscalationList |
array<object> |
Yes |
The alert configuration list. |
|
|
object |
No |
The alert configuration list. |
||
| MetricName |
string |
Yes |
The metric for the alert. Valid values of N: 1 to 21. Valid values:
|
HttpStatus |
| Value |
string |
No |
The alert threshold. Valid values of N: 1 to 21. |
3 |
| Times |
integer |
No |
The number of alert retries. Valid values of N: 1 to 21. |
3 |
| Operator |
string |
No |
The comparison operator for the alert rule. Valid values of N: 1 to 21. Valid values:
|
> |
| Aggregate |
string |
No |
The statistical method for the alert. Valid values of N: 1 to 21. The valid values vary based on the metric:
Note
The statistical method for status code metrics is the original value (Value). The statistical method for latency or packet loss rate metrics is the average value (Average). |
Value |
| InstanceList |
array |
No |
The list of ECS instances that initiate detection. Valid values of N: 1 to 21. Note
If |
i-absdfkwl321**** |
|
string |
No |
The list of ECS instances that initiate detection. Valid values of N: 1 to 21. Note
If |
2 |
|
| AlertConfigTargetList |
array<object> |
No |
The alert trigger targets. |
|
|
object |
No |
The alert trigger targets. |
||
| Id |
string |
No |
The ID of the alert trigger target. |
1 |
| Arn |
string |
No |
The Alibaba Cloud Resource Name (ARN) of the resource. The format is
|
acs:mns:cn-hangzhou:111:/queues/test/message |
| Level |
string |
No |
The alert level. Valid values:
|
["INFO", "WARN", "CRITICAL"] |
| JsonParams |
string |
No |
The JSON-formatted parameters for the alert callback. |
{"customField1":"value1","customField2":"$.name"} |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| Code |
string |
The HTTP status code. Note
The value 200 indicates success. |
200 |
| Message |
string |
The error message. |
The specified resource is not found. |
| RequestId |
string |
The request ID. |
16E815A3-47E1-4290-87F9-D5C99471FF45 |
| Success |
boolean |
Indicates whether the operation was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "The specified resource is not found.",
"RequestId": "16E815A3-47E1-4290-87F9-D5C99471FF45",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
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. |
| 409 | ResourceConflict | Concurrent modification of resources. | |
| 409 | ResourceExist | Resources already exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.