All Products
Search
Document Center

CloudMonitor:DescribeHostAvailabilityList

Last Updated:Jul 26, 2024

Queries availability monitoring tasks.

Operation description

This topic provides an example to show how to query all the availability monitoring tasks of your Alibaba Cloud account. The sample responses indicate that the account has one availability monitoring task named ecs_instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cms:DescribeHostAvailabilityListget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
IdlongNo

The ID of the availability monitoring task.

123456
IdsstringNo

The IDs of the availability monitoring tasks. Separate multiple IDs with commas (,).

123456,345678
TaskNamestringNo

The name of the availability monitoring task.

ecs_instance
PageNumberintegerNo

The page number.

Pages start from page 1. Default value: 1.

1
PageSizeintegerNo

The number of entries per page.

Minimum value: 1. Default value: 10

10
GroupIdlongNo

The ID of the application group.

12345

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code.

Note The status code 200 indicates that the request was successful.
200
Messagestring

The error message.

The specified resource is not found.
RequestIdstring

The request ID.

4A288E86-45C3-4858-9DB0-6D85B10BD92A
Totalinteger

The total number of returned entries.

1
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
TaskListarray<object>

The details of the availability monitoring tasks.

object
TaskTypestring

The task type. Valid values:

  • PING
  • TELNET
  • HTTP
HTTP
GroupNamestring

The name of the application group.

Group_ECS
GroupIdlong

The ID of the application group.

12345
TaskNamestring

The name of the availability monitoring task.

ecs_instance
Disabledboolean

Indicates whether the availability monitoring task is disabled. Valid values:

  • true: The availability monitoring task is disabled.
  • false: The availability monitoring task is enabled.
false
TaskScopestring

The range of instances that are monitored by the availability monitoring task. Valid values:

  • GROUP: All ECS instances in the application group are monitored.
  • GROUP_SPEC_INSTANCE: Specified ECS instances in the application group are monitored.
GROUP
Idlong

The ID of the availability monitoring task.

123456
Instancesarray

The ECS instances that are monitored.

string

The ID of the ECS instance.

i-abcdefgh12****
TaskOptionobject

The optional parameters of the availability monitoring task.

HttpMethodstring

The HTTP request method. Valid values:

  • GET
  • POST
  • HEAD
GET
Intervalinteger

The interval at which detection requests are sent. Unit: seconds.

60
HttpURIstring

The URI that you want to monitor. If the TaskType parameter is set to HTTP, this parameter is required.

https://www.aliyun.com
TelnetOrPingHoststring

The domain name or IP address that you want to monitor.

ssh.aliyun.com
HttpResponseCharsetstring

The character set that is used in the HTTP response.

UTF-8
HttpPostContentstring

The content of the HTTP POST request.

params1=paramsValue1
HttpNegativeboolean

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:

  • true: If the HTTP response body includes the alert rule, an alert is triggered.
  • false: If the HTTP response does not include the alert rule, an alert is triggered.
true
HttpKeywordstring

The response to the HTTP request.

OK
AlertConfigobject

The configurations of the alert rule.

SilenceTimeinteger

The mute period during which new alerts are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400.

86400
EndTimeinteger

The end of the time period during which the alert rule is effective. Valid values: 0 to 23.

For example, if the AlertConfig.StartTime parameter is set to 0 and the AlertConfig.EndTime parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

Note Alert notifications are sent based on the specified threshold only if the alert rule is effective.
22
StartTimeinteger

The beginning of the time period during which the alert rule is effective. Valid values: 0 to 23.

For example, if the AlertConfig.StartTime parameter is set to 0 and the AlertConfig.EndTime parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

Note Alert notifications are sent based on the specified threshold only if the alert rule is effective.
0
WebHookstring

The callback URL.

CloudMonitor pushes an alert notification to the specified callback URL by sending an HTTP POST request. Only the HTTP protocol is supported.

https://www.aliyun.com
NotifyTypeinteger

The alert notification methods. Valid values:

  • 2: Alert notifications are sent by using emails and DingTalk chatbots.
  • 1: Alert notifications are sent by using emails and DingTalk chatbots.
  • 0: Alert notifications are sent by using emails and DingTalk chatbots.
0
EscalationListarray<object>

The trigger conditions of the alert rule.

object
Valuestring

The alert threshold.

400
MetricNamestring

The name of the metric. Valid values:

  • HttpStatus
  • HttpLatency
  • TelnetStatus
  • TelnetLatency
  • PingLostRate
HttpStatus
Operatorstring

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

  • >
  • >=
  • <
  • <=
  • =
=
Timesstring

The consecutive number of times for which the metric value is measured before an alert is triggered.

3
Aggregatestring

The method used to calculate metric values that trigger alerts. Valid values:

  • Value: the value of the HTTP status code
  • Average: the average HTTP response time
  • Value: the value of the Telnet status code
  • TelnetLatency: the average Telnet response time
  • Average: the average Ping packet loss rate
Value
TargetListarray<object>

The monitored resources.

object
Idstring

The ID of the resource that triggers the alert.

1
Arnstring

The Alibaba Cloud Resource Name (ARN) of the function.

Format: arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}. Fields:

  • Service: the service code
  • Region: the region ID
  • Account: the ID of the Alibaba Cloud account
  • ResourceType: the resource type
  • ResourceId: the resource ID.
acs:mns:cn-hangzhou:17754132319*****:/queues/test/messages
Levelstring

The alert level. Valid values:

  • INFO
  • WARN
  • CRITICAL
INFO
JsonParamsstring

The JSON-formatted parameters of the alert callback.

{"key1":"value1"}

Examples

Sample success responses

JSONformat

{
  "Code": "200",
  "Message": "The specified resource is not found.",
  "RequestId": "4A288E86-45C3-4858-9DB0-6D85B10BD92A",
  "Total": 1,
  "Success": true,
  "TaskList": {
    "NodeTaskConfig": [
      {
        "TaskType": "HTTP",
        "GroupName": "Group_ECS",
        "GroupId": 12345,
        "TaskName": "ecs_instance",
        "Disabled": false,
        "TaskScope": "GROUP",
        "Id": 123456,
        "Instances": {
          "Instance": [
            "i-abcdefgh12****"
          ]
        },
        "TaskOption": {
          "HttpMethod": "GET",
          "Interval": 60,
          "HttpURI": "https://www.aliyun.com",
          "TelnetOrPingHost": "ssh.aliyun.com",
          "HttpResponseCharset": "UTF-8",
          "HttpPostContent": "params1=paramsValue1",
          "HttpNegative": true,
          "HttpKeyword": "OK"
        },
        "AlertConfig": {
          "SilenceTime": 86400,
          "EndTime": 22,
          "StartTime": 0,
          "WebHook": "https://www.aliyun.com",
          "NotifyType": 0,
          "EscalationList": {
            "escalationList": [
              {
                "Value": "400",
                "MetricName": "HttpStatus",
                "Operator": "=",
                "Times": "3",
                "Aggregate": "Value"
              }
            ]
          },
          "TargetList": {
            "Target": [
              {
                "Id": "1",
                "Arn": "acs:mns:cn-hangzhou:17754132319*****:/queues/test/messages",
                "Level": "INFO",
                "JsonParams": "{\"key1\":\"value1\"}"
              }
            ]
          }
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterInvalidIllegal parameters.-
403AccessForbiddenUser not authorized to operate on the specified resource.-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
500InternalErrorThe request processing has failed due to some unknown error.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history