Modifies an availability monitoring task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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. Valid values:

Set the value to 0. The value 0 indicates that alert notifications are sent by using emails and DingTalk chatbots.

GroupId Long Yes 12345

The ID of the application group.

Id Long Yes 12345

The ID of the availability monitoring task.

TaskName String Yes My availability monitoring task

The name of the availability monitoring task.

TaskScope String No GROUP

The scope of instances to be monitored. Valid values:

  • GROUP: All Elastic Compute Service (ECS) instances in the application group are to be monitored.
  • GROUP_SPEC_INSTANCE: Specific ECS instances in the application group are to be monitored. The TaskScope and InstanceList.N parameters must be used in pairs.
TaskOption.HttpURI String No http://www.aliyun.com

The URI to be monitored. Set this parameter 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.
TaskOption.HttpResponseCharset String No UTF-8

The response character set for monitoring availability by sending HTTP requests.

TaskOption.HttpResponseMatchContent String No ok

The content to be matched with the response.

TaskOption.HttpMethod String No GET

The HTTP request method. Valid values:

  • GET
  • POST
  • HEAD
Note Set this parameter if the TaskType parameter is set to HTTP.
TaskOption.HttpNegative Boolean No true

Specifies whether the specified content is included in the response or not for generating an alert. Valid values:

  • true: An alert is triggered if the specified content is included.
  • false: An alert is triggered if the specified content is excluded.
Note This parameter takes effects if the TaskType parameter is set to HTTP.
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 a threshold-triggered alert is generated not during the effective period, notifications are not sent for the alert.
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 a threshold-triggered alert is generated not during the effective period, notifications are not sent for the alert.
AlertConfig.SilenceTime Integer No 86400

The mute period during which notifications are not repeatedly sent for an alert. Unit: seconds. Default value: 86400, which equals to one day.

AlertConfig.WebHook String No http://www.aliyun.com/webhook.json

The callback URL.

AlertConfigEscalationList.N.MetricName String No HttpStatus

The metric for which the alert feature is enabled. Valid values:

  • HttpStatus
  • HttpLatency
  • TelnetStatus
  • TelnetLatency
  • PingLostRate
AlertConfigEscalationList.N.Aggregate String No Value

The method used to calculate metric values that trigger alerts. The value of this parameter varies with the metric. The following content lists the mappings between metrics and calculation methods:

  • HttpStatus: Value
  • HttpLatency: Average
  • TelnetStatus: Value
  • TelnetLatency: Average
  • PingLostRate: Average
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 200.

AlertConfigEscalationList.N.Operator String No >

The comparison operator used in the alert rule. Valid values:

  • >
  • >=
  • <
  • <=
  • =
AlertConfigEscalationList.N.Value String No 3

The threshold for triggering alerts.

InstanceList.N RepeatList No i-absdfkwl321****

The ECS instances to be monitored.

Note If this parameter is not specified, all instances in the application group are to be 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 returned message.

Code String 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Success Boolean true

Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.

Examples

Sample requests

http(s)://[Endpoint]/? Action=ModifyHostAvailability
&AlertConfig.NotifyType=2
&GroupId=12345
&Id=12345
&TaskName=My availability monitoring task
&<Common request parameters>

Sample success responses

XML format

<RequestId>ACBDBB40-DFB6-4F4C-8957-51FFB233969C</RequestId>
<Success>true</Success>
<Code>200</Code>

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.