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

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeSiteMonitorList

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

TaskIdStringNoa1ecd34a-8157-44d9-b060-14950837****

The ID of the site monitoring task.

TaskTypeStringNoHTTP

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

KeywordStringNosite

The keyword to be matched.

Note You can search for tasks by name or address. Fuzzy search is supported.
PageIntegerNo1

The page number. Default value: 1.

PageSizeIntegerNo10

The number of entries per page. Default value: 10.

TaskStateStringNo1

The task status. Valid values:

  • 1: The task is enabled.
  • 2: The task is disabled.

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

Response parameters

ParameterTypeExampleDescription
RequestIdStringA80DB41C-AF6C-50E1-ADB5-66DCBA3D266B

The request ID.

SuccessStringtrue

Indicates whether the request was successful. Valid values:

  • true
  • false
CodeString200

The status code.

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

The returned message.

PageNumberInteger1

The page number.

PageSizeInteger10

The number of entries per page.

TotalCountInteger1

The total number of entries returned.

SiteMonitorsArray of SiteMonitor

The site monitoring tasks that are returned.

SiteMonitor
TaskTypeStringTCP

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

UpdateTimeString2022-03-08 17:14:31

The time when the site monitoring task was updated.

IntervalString1

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

TaskStateString1

The task status. Valid values:

  • 1: The task is enabled.
  • 2: The task is disabled.
CreateTimeString2021-11-01 11:05:18

The time when the site monitoring task was created.

TaskNameStringNew site monitoring task

The name of the site monitoring task.

AddressStringhttps://aliyun.com

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

TaskIdStringf5783760-1b39-4b6b-80e8-453d962a****

The ID of the site monitoring task.

OptionsJsonObject

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

passwordString123****

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

request_formatStringhex

The format of the HTTP request. Valid values:

  • hex: hexadecimal
  • txt: text
response_contentStringcf0f85

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.
failure_rateFloat0.5

The packet loss rate.

Note This parameter is returned only if the TaskType parameter is set to PING.
time_outLong3000

The timeout period. Unit: milliseconds.

headerStringtestKey:testValue

The header of the HTTP request. 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.

cookieStringlang=en

The cookie of the HTTP request.

portInteger80

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

ping_numInteger20

The number of hops for the PING protocol.

authenticationInteger1

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

  • 0: The feature is enabled.
  • 1: The feature is disabled.
http_methodStringget

The HTTP request method. Valid values:

  • get
  • post
  • head
match_ruleInteger0

Indicates whether the alert rule is included. Valid values:

  • 0: The alert rule is included.
  • 1: The alert rule is not included.
dns_match_ruleStringIN_DNS

The relationship between the list of expected aliases or IP addresses 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.
request_contentStringcf0f85

The content of the HTTP request.

usernameStringtestUser

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

response_formatStringhex

The format of the HTTP response. Valid values:

  • hex: hexadecimal
  • txt: text
dns_typeStringA

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

  • A (default): a record that specifies an IP address related to the specified host name or domain name.
  • 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.
  • AAAA: a record that maps a domain name to the relevant IPv6 address.
dns_serverString192.168.XX.XX

The domain name or IP address of the DNS server.

enable_operator_dnsBooleantrue

Indicates whether the DNS server of the carrier is used.

  • true (default): The DNS server of the carrier is used.
  • false: The DNS server of the carrier is not used. The default DNS server or the specified DNS server is used.
attemptsLong3

The number of retries after a DNS failure occurred.

protocolStringudp

The protocol type of DNS detection. Valid values:

  • udp (default)
  • tcp
  • tcp-tls
proxy_protocolBooleanfalse

Indicates whether the PROXY protocol is enabled. Valid values:

  • false (default): The PROXY protocol is disabled.
  • true: The PROXY protocol is enabled.
acceptable_response_codeString400

The acceptable status code.

Note We recommend that you configure assertions.
isBase64EncodeStringfalse

Indicates whether the password is decoded by using the Base64 algorithm. Valid values:

  • true: The password is decoded by using the Base64 algorithm.
  • false (default): The password is not decoded by using the Base64 algorithm.
cert_verifyBooleanfalse

Indicates whether the certificate is verified. Valid values:

  • false (default): The certificate is not verified.
  • true: The certificate is verified.
unfollow_redirectBooleanfalse

Indicates whether redirects are followed if the status code 301 or 302 is returned. Valid values:

  • true: Redirects are not followed.
  • false (default): Redirects are followed.
diagnosis_mtrBooleanfalse

Indicates whether MTR is automatically used to diagnose network issues if a task fails. Valid values:

  • false (default): MTR is not automatically used to diagnose network issues if a task fails.
  • true: MTR is automatically used to diagnose network issues if a task fails.
diagnosis_pingBooleanfalse

Indicates whether ping requests are automatically sent to detect network latency if a detection task fails. Valid values:

  • false (default): Ping requests are not automatically sent to detect network latency if a detection task fails.
  • true: Ping requests are automatically sent to detect network latency if a detection task fails.
retry_delayInteger1

The number of times a failed detection request is retried.

assertionsArray of assertions

The assertions.

assertions
propertyStringjson path

The parsing path of the assertion.

  • If the assertion type is body_json, the path is json path.
  • If the assertion type is body_xml, the path is xml path.
typeStringresponse_time

The assertion type. Valid values:

  • response_time: checks whether the response time meets expectations.
  • status_code: checks whether the HTTP status code meets expectations.
  • header: checks whether the fields in the response header meet expectations.
  • body_text: checks whether the content in the response body meets expectations by using text matching.
  • body_json: checks whether the content in the response body meets expectations by using JSON parsing (JSONPath).
  • body_xml: checks whether the content in the response body meets expectations by using XML parsing (XPath).
operatorStringlessThan

The comparison operator of the assertion. Valid values:

  • contains: contains
  • doesNotContain: does not contain
  • matches: matches regular expressions
  • doesNotMatch: does not match regular expressions
  • is: equal to a numeric value or matches a character
  • isNot: not equal to
  • lessThan: less than
  • moreThan: greater than
targetString1000

The numeric value or character used for matching.

AgentGroupStringPC

The probe type. Valid values:

  • PC
  • MOBILE

Examples

Sample requests

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

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeSiteMonitorListResponse>
    <TotalCount>1</TotalCount>
    <RequestId>A80DB41C-AF6C-50E1-ADB5-66DCBA3D266B</RequestId>
    <Message>successful</Message>
    <PageSize>10</PageSize>
    <PageNumber>1</PageNumber>
    <Code>200</Code>
    <Success>true</Success>
    <SiteMonitors>
        <SiteMonitor>
            <TaskId>f5783760-1b39-4b6b-80e8-453d962a****</TaskId>
            <Address>https://aliyun.com</Address>
            <EndTime></EndTime>
            <TaskName>test123</TaskName>
            <OptionsJson>
                <response_content></response_content>
                <request_format>hex</request_format>
                <response_format>hex</response_format>
                <request_content>cf0f85</request_content>
                <port>80</port>
            </OptionsJson>
            <TaskType>TCP</TaskType>
            <CreateTime>2021-11-01 11:05:18</CreateTime>
            <UpdateTime>2022-03-08 17:14:31</UpdateTime>
            <TaskState>1</TaskState>
            <Interval>1</Interval>
        </SiteMonitor>
    </SiteMonitors>
</DescribeSiteMonitorListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : 1,
  "RequestId" : "A80DB41C-AF6C-50E1-ADB5-66DCBA3D266B",
  "Message" : "successful",
  "PageSize" : 10,
  "PageNumber" : 1,
  "Code" : "200",
  "Success" : true,
  "SiteMonitors" : {
    "SiteMonitor" : [ {
      "TaskId" : "f5783760-1b39-4b6b-80e8-453d962a****",
      "Address" : "https://aliyun.com",
      "EndTime" : "",
      "TaskName" : "test123",
      "OptionsJson" : {
        "response_content" : "",
        "request_format" : "hex",
        "response_format" : "hex",
        "request_content" : "cf0f85",
        "port" : 80
      },
      "TaskType" : "TCP",
      "CreateTime" : "2021-11-01 11:05:18",
      "UpdateTime" : "2022-03-08 17:14:31",
      "TaskState" : 1,
      "Interval" : 1
    } ]
  }
}

Error codes

For a list of error codes, see Service error codes.