Modifies an availability monitoring task.
Operation description
This topic provides an example on how to change the name of an availability monitoring task named 12345
in an application group named 123456
to task2
.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
GroupId | long | Yes | The ID of the application group. | 123456 |
Id | long | Yes | The ID of the availability monitoring task. | 12345 |
TaskName | string | Yes | The name of the availability monitoring task. | task2 |
TaskScope | string | No | The range of instances that are monitored by the availability monitoring task. Valid values:
| GROUP |
TaskOption.HttpURI | string | No | The URI that you want to monitor. This parameter must be specified when TaskType is set to HTTP. | https://www.aliyun.com |
TaskOption.TelnetOrPingHost | string | No | The domain name or IP address that you want to monitor. Note
This parameter must be specified when TaskType is set to PING or TELNET. For more information about how to configure the TaskType parameter, see CreateHostAvailability .
| www.aliyun.com |
TaskOption.HttpResponseCharset | string | No | The character set that is used in the HTTP response. Note
Only UTF-8 is supported.
| UTF-8 |
TaskOption.HttpPostContent | string | No | The content of the HTTP POST request. | params1=value1 |
TaskOption.HttpResponseMatchContent | string | No | The response to the HTTP request. | ok |
TaskOption.HttpMethod | string | No | The HTTP request method. Valid values:
Note
This parameter must be specified when TaskType is set to HTTP. For more information about how to configure the TaskType parameter, see CreateHostAvailability .
| GET |
TaskOption.HttpNegative | boolean | No | The method to trigger an alert. The alert can be triggered based on whether the specified alert rule is included in the response body. Valid values:
Note
This parameter must be specified when TaskType is set to HTTP. For more information about how to configure the TaskType parameter, see CreateHostAvailability .
| true |
TaskOption.HttpHeader | string | No | The header of the HTTP request. Format:
| params1:value1 |
TaskOption.Interval | integer | No | The interval at which detection requests are sent. Unit: seconds. Valid values: 15, 30, 60, 120, 300, 900, 1800, and 3600. Note
This parameter is available only for the CloudMonitor agent V3.5.1 or later.
| 60 |
AlertConfig.NotifyType | integer | Yes | The alert notification methods. Valid values: 0: Alert notifications are sent by using emails and DingTalk chatbots. | 0 |
AlertConfig.StartTime | integer | No | The beginning of the time range during which the alert rule is effective. Valid values: 0 to 23. For example, if the Note
Alert notifications are sent based on the specified threshold only if the alert rule is effective.
| 0 |
AlertConfig.EndTime | integer | No | The end of the time range during which the alert rule is effective. Valid values: 0 to 23. For example, if the Note
Alert notifications are sent based on the specified threshold only if the alert rule is effective.
| 22 |
AlertConfig.SilenceTime | integer | No | The mute period during which new alerts are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400. The default value indicates one day. | 86400 |
AlertConfig.WebHook | string | No | The callback URL. | https://www.aliyun.com/webhook.json |
AlertConfigEscalationList | object [] | Yes | The alert configurations. | |
MetricName | string | Yes | The metric for which the alert feature is enabled. 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 consecutive number of times for which the metric value meets the alert condition before an alert is triggered. Valid values of N: 1 to 21. | 3 |
Operator | string | No | The comparison operator that is used in the alert rule. Valid values of N: 1 to 21. Valid values:
| > |
Aggregate | string | No | The method used to calculate the metric values that trigger alerts. Valid values of N: 1 to 21. The value of this parameter varies based on the metric. The following items show the correspondence between metrics and calculation methods:
Note
The value Value indicates the original value and is used for metrics such as status codes. The value Average indicates the average value and is used for metrics such as the latency and packet loss rate.
| Value |
InstanceList | array | No | The ECS instances that are monitored. Valid values of N: 1 to 21. Note
This parameter must be specified when TaskScope is set to GROUP_SPEC_INSTANCE .
| |
string | No | The ECS instances that are monitored. Valid values of N: 1 to 21. Note
This parameter must be specified when TaskScope is set to GROUP_SPEC_INSTANCE .
| 2 | |
AlertConfigTargetList | object [] | No | The information about the resources for which alerts are triggered. | |
Id | string | No | The ID of the resource for which alerts are triggered. | 1 |
Arn | string | No | The Alibaba Cloud Resource Name (ARN) of the resource. Format:
| acs:mns:cn-hangzhou:111:/queues/test/message |
Level | string | No | The alert level. Valid values:
| ["INFO", "WARN", "CRITICAL"] |
JsonParams | string | No | The parameters of the alert callback. The parameters are in the JSON format. | {"customField1":"value1","customField2":"$.name"} |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
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. | - |
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. | - |
500 | InternalError | The request processing has failed due to some unknown error. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2022-08-05 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||||
|