Queries site monitoring tasks.

This topic provides an example on how to query all the site monitoring tasks of your Alibaba Cloud account. In this example, the returned result indicates that the Alibaba Cloud account has one site monitoring task named HanZhou_ECS2.

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 DescribeSiteMonitorList

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

TaskId String No a1ecd34a-8157-44d9-b060-14950837****

The ID of the site monitoring task.

TaskType String No HTTP

The protocol that is used by the site monitoring task. Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP.

Keyword String No site

The keyword to be matched.

Note You can search for tasks by name or address. Fuzzy search is supported.
Page 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.

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

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Message String successful

The returned message.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String C60B8269-9B1C-4C32-8BCC-947D03B09274

The ID of the request.

SiteMonitors Array of SiteMonitor

The site monitoring tasks that are returned.

SiteMonitor
Address String https://aliyun.com

The URL or IP address that is monitored by the site monitoring task.

CreateTime String 2020-11-06 10:20:09

The time when the site monitoring task was created.

Interval String 1

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

OptionsJson Struct

The extended options of the site monitoring task. The options vary based on the specified protocol. For more information, see CreateSiteMonitor.

attempts Long 3

The number of retries after a DNS failure occurred.

authentication Integer 1

Indicates whether the security authentication feature is enabled. Valid values:

  • 0: The feature is enabled.
  • 1: The feature is disabled.
cookie String lang=en

The cookie of the HTTP request.

dns_match_rule String IN_DNS

The relationship between the list of aliases or IP addresses that are expected and the list of DNS results. Valid values:

  • IN_DNS: The list of expected values is a subset of the list of DNS results.
  • DNS_IN: The list of DNS results is a subset of the list of expected values.
  • EQUAL: The list of DNS results is the same as the list of expected values.
  • ANY: The list of DNS results intersects with the list of expected values.
dns_server String 192.168.XX.XX

The domain name or IP address of the DNS server.

Note This parameter is returned only if the TaskType parameter is set to DNS.
dns_type String A

The type of the DNS record. This parameter is returned only if the TaskType parameter is set to DNS. Valid values:

  • A : a record that specifies an IP address related to the specified host name or domain name. Default value: A.
  • CNAME: a record that maps multiple domain names to a domain name.
  • NS: a record that specifies a DNS server used to parse domain names.
  • MX: a record that links domain names to the address of a mail server.
  • TXT: a record that stores the text information of host name or domain names. The text must be 1 to 512 bytes in length. The TXT record serves as a Sender Policy Framework (SPF) record to fight against spam.
failure_rate Float 0.5

The packet loss rate.

Note This parameter is returned only if the TaskType parameter is set to PING.
header String testKey:testValue

The HTTP request header. An HTTP header is a key-value pair in which the key and the value are separated by a colon (:). The format is key1:value1. Each HTTP header occupies a line.

http_method String get

The HTTP request method. Valid values:

  • get
  • post
  • head
match_rule Integer 0

Indicates whether the alert rule is included. Valid values:

  • 0: The alert rule is included.
  • 1: The alert rule is not included.
password String 123****

The password of the SMTP, POP3, or FTP protocol.

ping_num Integer 20

The number of hops for the PING protocol.

port Integer 8080

The port number of the TCP, UDP, SMTP, or POP3 protocol.

protocol String TCP

The protocol that is used to send the request.

request_content String cf0f85

The content of the HTTP request.

request_format String hex

The format of the HTTP request. Valid values:

  • hex: hexadecimal
  • txt: text
response_content String cf0f85

The response to the HTTP request.

  • Hexadecimal format: If the request content is a byte string and cannot be represented in printable characters, you can convert the byte string to printable characters in the hexadecimal format. If you convert the byte string to printable characters in the hexadecimal format, one byte is converted to two hexadecimal characters. For example, (byte)1 is converted to 01 and (byte)27 is converted to 1B. If the request content is a binary array in the Java format, for example, {(byte)1, (byte)27}, you can convert the binary array to 011b or 011B. Hexadecimal characters are not case-sensitive in site monitoring tasks. You can enter 011B in the request content and set the request_format parameter to hex.
  • Text format: Common text refers to strings that consist of printable characters.
response_format String hex

The format of the response. Valid values:

  • hex: hexadecimal
  • txt: text
time_out Long 3000

The timeout period. Unit: milliseconds.

username String testUser

The username of the FTP, SMTP, or POP3 protocol.

TaskId String a1ecd34a-8127-44d9-b060-14950837****

The ID of the site monitoring task.

TaskName String New site monitoring task

The name of the site monitoring task.

TaskState String 1

The status of the site monitoring task. Valid values:

  • 1: The task is enabled.
  • 2: The task is disabled.
TaskType String HTTP

The protocol that is used by the site monitoring task. Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP.

UpdateTime String 2020-11-06 13:44:40

The time when the site monitoring task was updated.

Success String true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.
TotalCount Integer 1

The total number of returned entries.

Examples

Sample requests

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

Sample success responses

XML format

<DescribeSiteMonitorListResponse>
	  <TotalCount>1</TotalCount>
	  <Message>successful</Message>
	  <RequestId>C60B8269-9B1C-4C32-8BCC-947D03B09274</RequestId>
	  <PageSize>10</PageSize>
	  <PageNumber>1</PageNumber>
	  <Code>200</Code>
	  <Success>true</Success>
	  <SiteMonitors>
		    <SiteMonitor>
			      <TaskId>2c8dbdf9-a3ab-46a1-85a4-f094965e****</TaskId>
			      <Address>https://www.aliyun.com</Address>
			      <TaskName>HanZhou_ECS2</TaskName>
			      <OptionsJson>
				        <http_method>get</http_method>
				        <time_out>30000</time_out>
			      </OptionsJson>
			      <TaskType>HTTP</TaskType>
			      <CreateTime>2020-11-06 10:20:09</CreateTime>
			      <UpdateTime>2020-11-06 13:44:40</UpdateTime>
			      <TaskState>1</TaskState>
			      <Interval>1</Interval>
		    </SiteMonitor>
	  </SiteMonitors>
</DescribeSiteMonitorListResponse>

JSON format

{
	"TotalCount": 1,
	"Message": "successful",
	"RequestId": "C60B8269-9B1C-4C32-8BCC-947D03B09274",
	"PageSize": 10,
	"PageNumber": 1,
	"Code": "200",
	"Success": true,
	"SiteMonitors": {
		"SiteMonitor": [
			{
				"TaskId": "2c8dbdf9-a3ab-46a1-85a4-f094965e****",
				"Address": "https://www.aliyun.com",
				"TaskName": "HanZhou_ECS2",
				"OptionsJson": {
					"http_method": "get",
					"time_out": 30000
				},
				"TaskType": "HTTP",
				"CreateTime": "2020-11-06 10:20:09",
				"UpdateTime": "2020-11-06 13:44:40",
				"TaskState": 1,
				"Interval": 1
			}
		]
	}
}

Error codes

For a list of error codes, visit the API Error Center.