Queries availability monitoring tasks.

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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeHostAvailabilityList

The operation that you want to perform. Set the value to DescribeHostAvailabilityList.

Id Long No 123456

The ID of the availability monitoring task.

Ids String No 123456,345678

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

TaskName String No ecs_instance

The name of the availability monitoring task.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Default value: 10.

GroupId Long No 12345

The ID of the application group.

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

Response parameters

Parameter Type Example Description
RequestId String 4A288E86-45C3-4858-9DB0-6D85B10BD92A

The ID of the request.

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:

  • true: The call was successful.
  • false: The call failed.
TaskList Array of NodeTaskConfig

The details of the availability monitoring tasks.

NodeTaskConfig
AlertConfig Struct

The configurations of the alert rule.

EndTime Integer 22

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.
EscalationList Array of escalationList

The trigger conditions of the alert rule.

escalationList
Aggregate String Value

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
MetricName String HttpStatus

The name of the metric. Valid values:

  • HttpStatus: HTTP status code
  • HttpLatency: HTTP response time
  • TelnetStatus: Telnet status code
  • TelnetLatency: Telnet response time
  • PingLostRate: Ping packet loss rate
Operator String =

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

  • >
  • >=
  • <
  • <=
  • =
Times String 3

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

Value String 400

The alert threshold.

NotifyType Integer 1

The alert notification methods. Valid values:

0: Alert notifications are sent by using emails and DingTalk chatbots.

SilenceTime Integer 86400

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

StartTime Integer 0

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.
WebHook String https://www.aliyun.com

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.

Disabled Boolean false

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

  • true: The availability monitoring task is disabled.
  • false: The availability monitoring task is enabled.
GroupId Long 12345

The ID of the application group.

GroupName String Group_ECS

The name of the application group.

Id Long 123456

The ID of the availability monitoring task.

Instances List i-abcdefgh12****

The ECS instances that are monitored.

TaskName String ecs_instance

The name of the availability monitoring task.

TaskOption Struct

The optional parameters of the availability monitoring task.

HttpKeyword String OK

The response to the HTTP request.

HttpMethod String GET

The HTTP request method. Valid values:

  • GET
  • POST
  • HEAD
HttpNegative Boolean 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:

  • 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.
HttpPostContent String params1=paramsValue1

The content of the HTTP POST request.

HttpResponseCharset String UTF-8

The character set that is used in the HTTP response.

HttpURI String https://www.aliyun.com

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

Interval Integer 60

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

TelnetOrPingHost String ssh.aliyun.com

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

TaskScope String GROUP

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.
TaskType String HTTP

The type of the availability monitoring task. Valid values:

  • PING
  • TELNET
  • HTTP
Total Integer 1

The total number of returned entries.

Message String The specified resource is not found.

The error message.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeHostAvailabilityList
&<Common request parameters>

Sample success responses

XML format

<DescribeHostAvailabilityListResponse>
	  <RequestId>4A288E86-45C3-4858-9DB0-6D85B10BD92A</RequestId>
	  <Total>1</Total>
	  <TaskList>
		    <NodeTaskConfig>
			      <GroupName>Group_ECS</GroupName>
			      <TaskOption>
				        <HttpURI>https://aliyun.com</HttpURI>
				        <HttpMethod>GET</HttpMethod>
			      </TaskOption>
			      <AlertConfig>
				        <NotifyType>1</NotifyType>
				        <SilenceTime>86400</SilenceTime>
				        <EndTime>22</EndTime>
				        <StartTime>0</StartTime>
				        <EscalationList>
					          <escalationList>
						            <Operator>=</Operator>
						            <MetricName>HttpStatus</MetricName>
						            <Times>3</Times>
						            <Value>400</Value>
						            <Aggregate>Value</Aggregate>
					          </escalationList>
					          <escalationList>
						            <Operator>=</Operator>
						            <MetricName>HttpLatency</MetricName>
						            <Times>3</Times>
						            <Value>500</Value>
						            <Aggregate>Average</Aggregate>
					          </escalationList>
				        </EscalationList>
			      </AlertConfig>
			      <TaskName>ecs_instance</TaskName>
			      <TaskScope>GROUP</TaskScope>
			      <TaskType>HTTP</TaskType>
			      <Id>123456</Id>
			      <Disabled>false</Disabled>
			      <GroupId>12345</GroupId>
		    </NodeTaskConfig>
	  </TaskList>
	  <Code>200</Code>
	  <Success>true</Success>
</DescribeHostAvailabilityListResponse>

JSON format

{
	"RequestId": "4A288E86-45C3-4858-9DB0-6D85B10BD92A",
	"Total": 1,
	"TaskList": {
		"NodeTaskConfig": [
			{
				"GroupName": "Group_ECS",
				"TaskOption": {
					"HttpURI": "https://aliyun.com",
					"HttpMethod": "GET"
				},
				"AlertConfig": {
					"NotifyType": 1,
					"SilenceTime": 86400,
					"EndTime": 22,
					"StartTime": 0,
					"EscalationList": {
						"escalationList": [
							{
								"Operator": "=",
								"MetricName": "HttpStatus",
								"Times": 3,
								"Value": "400",
								"Aggregate": "Value"
							},
							{
								"Operator": "=",
								"MetricName": "HttpLatency",
								"Times": 3,
								"Value": "500",
								"Aggregate": "Average"
							}
						]
					}
				},
				"TaskName": "ecs_instance",
				"TaskScope": "GROUP",
				"TaskType": "HTTP",
				"Id": 123456,
				"Disabled": false,
				"GroupId": 12345
			}
		]
	},
	"Code": 200,
	"Success": true
}

Error codes

HTTP status code 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.