Modifies an availability monitoring task.
This topic describes how to change the name of the 12345
availability monitoring task in the 123456
application group to task2
.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyHostAvailability |
The operation that you want to perform. Set the value to ModifyHostAvailability. |
GroupId | Long | Yes | 123456 |
The ID of the application group. |
Id | Long | Yes | 12345 |
The ID of the availability monitoring task. |
TaskName | String | Yes | task2 |
The name of the availability monitoring task. |
TaskScope | String | No | GROUP |
The range of instances that are monitored by the availability monitoring task. Valid values:
|
TaskOption.HttpURI | String | No | https://www.aliyun.com |
The URI that you want to monitor. If the TaskType parameter is set to HTTP, this parameter is required. |
TaskOption.TelnetOrPingHost | String | No | www.aliyun.com |
The domain name or IP address that you want to monitor. Note If the TaskType parameter is set to PING or TELNET, this parameter is required. For
more information about how to set the TaskType parameter, see CreateHostAvailability.
|
TaskOption.HttpResponseCharset | String | No | UTF-8 |
The character set that is used in the HTTP response. Note Valid value: UTF-8.
|
TaskOption.HttpPostContent | String | No | params1=value1 |
The content of the HTTP POST request. |
TaskOption.HttpResponseMatchContent | String | No | ok |
The response to the HTTP request. |
TaskOption.HttpMethod | String | No | GET |
The HTTP request method. Valid values:
Note If the TaskType parameter is set to HTTP, this parameter is required. For more information
about how to set the TaskType parameter, see CreateHostAvailability.
|
TaskOption.HttpNegative | Boolean | No | true |
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 If the TaskType parameter is set to HTTP, this parameter is required. For more information
about how to set the TaskType parameter, see CreateHostAvailability.
|
TaskOption.HttpHeader | String | No | params1:value1 |
The header of the HTTP request. Format:
|
TaskOption.Interval | Integer | No | 60 |
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.
|
AlertConfig.NotifyType | Integer | Yes | 0 |
The alert notification methods. Valid values: 0: Alert notifications are sent by using emails and DingTalk chatbots. |
AlertConfig.StartTime | Integer | No | 0 |
The beginning of the time period 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.
|
AlertConfig.EndTime | Integer | No | 22 |
The end of the time period 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.
|
AlertConfig.SilenceTime | Integer | No | 86400 |
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. |
AlertConfig.WebHook | String | No | https://www.aliyun.com/webhook.json |
The callback URL. |
AlertConfigEscalationList.N.MetricName | String | Yes | HttpStatus |
The metric for which the alert feature is enabled. Valid values of N: 1 to 21. Valid values:
|
AlertConfigEscalationList.N.Value | String | No | 3 |
The alert threshold. Valid values of N: 1 to 21. |
AlertConfigEscalationList.N.Times | Integer | No | 3 |
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. |
AlertConfigEscalationList.N.Operator | String | No | > |
The comparison operator that is used in the alert rule. Valid values of N: 1 to 21. Valid values:
|
AlertConfigEscalationList.N.Aggregate | String | No | Value |
The method used to calculate metric values that trigger alerts. Valid values of N: 1 to 21. The value of this parameter varies based on the metric. The following points describe 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.
|
InstanceList.N | String | No | 2 |
The ECS instances that are monitored. Valid values of N: 1 to 21. Note If the
TaskScope parameter is set to GROUP_SPEC_INSTANCE , this parameter is required.
|
AlertConfigTargetList.N.Id | String | No | 1 |
The ID of the resource for which alerts are triggered. |
AlertConfigTargetList.N.Arn | String | No | acs:mns:cn-hangzhou:111:/queues/test/message |
The Alibaba Cloud Resource Name (ARN) of the resource. Format:
|
AlertConfigTargetList.N.Level | String | No | ["INFO", "WARN", "CRITICAL"] |
The level of the alert. Valid values:
|
AlertConfigTargetList.N.JsonParams | String | No | {"customField1":"value1","customField2":"$.name"} |
The parameters of the alert callback. The parameters are in the JSON format. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | 200 |
The HTTP status code. Note The status code 200 indicates that the call was successful.
|
Message | String | The specified resource is not found. |
The error message. |
RequestId | String | 16E815A3-47E1-4290-87F9-D5C99471FF45 |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call was successful. Valid values:
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=ModifyHostAvailability
&AlertConfig.NotifyType=0
&AlertConfigEscalationList.1.MetricName=HttpStatus
&GroupId=123456
&Id=12345
&TaskName=task2
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyHostAvailabilityResponse>
<RequestId>16E815A3-47E1-4290-87F9-D5C99471FF45</RequestId>
<Success>true</Success>
<Code>200</Code>
</ModifyHostAvailabilityResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "16E815A3-47E1-4290-87F9-D5C99471FF45",
"Code" : 200,
"Success" : true
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
404 | ResourceNotFound | The specified resource is not found. | The error message returned because the specified resource is not found. |
For a list of error codes, visit the API Error Center.