Queries availability monitoring tasks.

This topic describes shows how to query the availability monitoring tasks of the current account. The result indicates 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.

TaskName String No ecs_instance

The name of the availability monitoring task.

PageNumber Integer No 1

The number of the page to return. 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 HTTP 200 code indicates that the request succeeds.
Success Boolean true

Indicates whether the call succeeds. Valid value:

  • true: The call succeeds.
  • false: The call fails.
TaskList Array of NodeTaskConfig

The availability monitoring tasks.

NodeTaskConfig
AlertConfig Struct

The configurations of the alert rule.

EndTime Integer 22

The end of the time range for which the alert rule is valid. Valid values: 0 to 23.

Example: If the AlertConfig.StartTime parameter is set to 0 and the AlertConfig.EndTime parameter is set to 22, the alert rule is valid from 00:00:00 to 22:00:00.

Note If the threshold of a metric that is specified in an invalid alert rule is exceeded, no alert notification is sent.
EscalationList Array of escalationList

The trigger condition of the alert rule.

escalationList
Aggregate String Value

The method that is used to calculate the metric values that trigger alerts. The following points describe the correspondence between metrics and calculation methods:

  • HttpStatus: Value
  • HttpLatency: Average
  • TelnetStatus: Value
  • TelnetLatency: Average
  • PingLostRate: Average
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 number of consecutive times that the metric value is measured before an alert is triggered.

Value String 400

The alert threshold.

NotifyType Integer 1

The alert notification method. Valid values:

0: indicates that alert notifications are sent by using emails and DingTalk chatbots.

SilenceTime Integer 86400

The mute period for which alert notifications are not sent even if the alert rule is triggered. Unit: seconds. Default value: 86400.

StartTime Integer 0

The start of the time range when the alert rule is valid. Valid values: 0 to 23.

Example: If the AlertConfig.StartTime parameter is set to 0 and the AlertConfig.EndTime parameter is set to 22, this indicates that the related alert rule is valid from 00:00:00 to 22:00:00.

Note If the threshold of a metric that is specified in an invalid alert rule is exceeded, no alert notification is sent.
WebHook String https://www.aliyun.com

The callback URL.

Disabled Boolean false

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

  • true
  • false
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 Elastic Compute Service (ECS) instances that are monitored.

TaskName String ecs_instance

The name of the availability monitoring task.

TaskOption Struct

The options 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 post body in the HTTP 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 you want to monitor for the availability monitoring task. Valid values:

  • GROUP: All Elastic Compute Service (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 12

The total number of entries that are returned.

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>23</EndTime>
				        <StartTime>0</StartTime>
				        <EscalationList>
					          <escalationList>
						            <Operator>&gt;</Operator>
						            <MetricName>HttpStatus</MetricName>
						            <Times>3</Times>
						            <Value>400</Value>
						            <Aggregate>Value</Aggregate>
					          </escalationList>
					          <escalationList>
						            <Operator>&gt;</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": 23,
					"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

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.