Modifies an availability monitoring task.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyHostAvailability |
The operation that you want to perform. Set the value to ModifyHostAvailability. |
AlertConfig.NotifyType | Integer | Yes | 2 |
The alert notification methods. Set the value to 0. The value 0 indicates that alert notifications are sent by using emails and DingTalk chatbots. |
AlertConfigEscalationList.N.MetricName | String | Yes | HttpStatus |
The metric for which the alert feature is enabled. Valid values of N: 1 to 21. Valid values of the AlertConfigEscalationList.N.MetricName parameter:
|
GroupId | Long | Yes | 12345 |
The ID of the application group. |
Id | Long | Yes | 123456 |
The ID of the availability monitoring task. |
TaskName | String | Yes | task1 |
The name of the availability monitoring task. |
TaskScope | String | No | GROUP |
The monitoring range of the availability monitoring task. Valid values:
|
TaskOption.HttpURI | String | No | https://www.aliyun.com |
The URI that is monitored. This parameter is returned if the TaskType parameter is set to HTTP. |
TaskOption.TelnetOrPingHost | String | No | www.aliyun.com |
The domain name or IP address to be monitored. Note Set this parameter if the TaskType parameter is set to PING or TELNET. 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. |
TaskOption.HttpPostContent | String | No | params1=value1 |
The post body in the HTTP request. |
TaskOption.HttpResponseMatchContent | String | No | ok |
The response to the HTTP request. |
TaskOption.HttpMethod | String | No | GET |
The HTTP request method. Valid values:
Note Set this parameter if the TaskType parameter is set to HTTP. 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 Set this parameter if the TaskType parameter is set to HTTP. For more information
about how to set the TaskType parameter, see CreateHostAvailability.
|
AlertConfig.StartTime | Integer | No | 0 |
The beginning of the time period during which the alert rule is effective. Valid values: 0 to 23. Note If the threshold is exceeded and an alert is triggered not during the effective period,
the alert notification is not sent.
|
AlertConfig.EndTime | Integer | No | 23 |
The end of the time period during which the alert rule is effective. Valid values: 0 to 23. Note If the threshold is exceeded and an alert is triggered not during the effective period,
the alert notification is not sent.
|
AlertConfig.SilenceTime | Integer | No | 86400 |
The mute period during which notifications are not repeatedly sent for an alert. 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.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 with 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 latency and packet loss rates.
|
AlertConfigEscalationList.N.Times | Integer | No | 3 |
The consecutive number of times for which the metric value is measured 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 of the AlertConfigEscalationList.N.Operator parameter:
|
AlertConfigEscalationList.N.Value | String | No | 3 |
The alert threshold. Valid values of N: 1 to 21. |
InstanceList.N | RepeatList | No | i-absdfkwl321**** |
The ECS instances to be monitored. Valid values of N: 1 to 21. Note If this parameter is not specified, all instances in the application group are monitored.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | ACBDBB40-DFB6-4F4C-8957-51FFB233969C |
The ID of the request. |
Message | String | The Request is not authorization. |
The error message. |
Code | String | 200 |
The HTTP status code. Note The value 200 indicates that the call was successful.
|
Success | Boolean | true |
Indicates whether the call was successful. Valid values:
|
Examples
Sample request
http(s)://[Endpoint]/? Action=ModifyHostAvailability
&AlertConfig.1otifyType=2
&AlertConfigEscalationList.1.MetricName=HttpStatus
&GroupId=12345
&Id=123456
&TaskName=task1
&<Common request parameters>
Sample success responses
XML
format
<ModifyHostAvailabilityResponse>
<RequestId>ACBDBB40-DFB6-4F4C-8957-51FFB233969C</RequestId>
<Success>true</Success>
<Code>200</Code>
</ModifyHostAvailabilityResponse>
JSON
format
{
"RequestId": "ACBDBB40-DFB6-4F4C-8957-51FFB233969C",
"Success": true,
"Code": 200
}
Error codes
For a list of error codes, visit the API Error Center.