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
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 page number. Default value: 1. |
PageSize | Integer | No | 10 | The number of entries per page. Default value: 10. |
TaskState | String | No | 1 | The task status. Valid values:
|
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | A80DB41C-AF6C-50E1-ADB5-66DCBA3D266B | The request ID. |
Success | String | true | Indicates whether the request was successful. Valid values:
|
Code | String | 200 | The status code. Note The status code 200 indicates that the request was successful. |
Message | String | successful | The returned message. |
PageNumber | Integer | 1 | The page number. |
PageSize | Integer | 10 | The number of entries per page. |
TotalCount | Integer | 1 | The total number of entries returned. |
SiteMonitors | Array of SiteMonitor | The site monitoring tasks that are returned. | |
SiteMonitor | |||
TaskType | String | TCP | The protocol that is used by the site monitoring task. Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP. |
UpdateTime | String | 2022-03-08 17:14:31 | The time when the site monitoring task was updated. |
Interval | String | 1 | The interval at which detection requests are sent. Unit: minutes. |
TaskState | String | 1 | The task status. Valid values:
|
CreateTime | String | 2021-11-01 11:05:18 | The time when the site monitoring task was created. |
TaskName | String | New site monitoring task | The name of the site monitoring task. |
Address | String | https://aliyun.com | The URL or IP address that is monitored by the site monitoring task. |
TaskId | String | f5783760-1b39-4b6b-80e8-453d962a**** | The ID of the site monitoring task. |
OptionsJson | Object | The extended options of the site monitoring task. The options vary based on the specified protocol. For more information, see CreateSiteMonitor. | |
password | String | 123**** | The password of the SMTP, POP3, or FTP protocol. |
request_format | String | hex | The format of the HTTP request. Valid values:
|
response_content | String | cf0f85 | The response to the HTTP request.
|
failure_rate | Float | 0.5 | The packet loss rate. Note This parameter is returned only if the TaskType parameter is set to PING. |
time_out | Long | 3000 | The timeout period. Unit: milliseconds. |
header | String | testKey: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 |
cookie | String | lang=en | The cookie of the HTTP request. |
port | Integer | 80 | The port number of the TCP, UDP, SMTP, or POP3 protocol. |
ping_num | Integer | 20 | The number of hops for the PING protocol. |
authentication | Integer | 1 | Indicates whether the security authentication feature is enabled. Valid values:
|
http_method | String | get | The HTTP request method. Valid values:
|
match_rule | Integer | 0 | Indicates whether the alert rule is included. Valid values:
|
dns_match_rule | String | IN_DNS | The relationship between the list of expected aliases or IP addresses and the list of DNS results. Valid values:
|
request_content | String | cf0f85 | The content of the HTTP request. |
username | String | testUser | The username of the FTP, SMTP, or POP3 protocol. |
response_format | String | hex | The format of the HTTP response. Valid values:
|
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:
|
dns_server | String | 192.168.XX.XX | The domain name or IP address of the DNS server. |
enable_operator_dns | Boolean | true | Indicates whether the DNS server of the carrier is used.
|
attempts | Long | 3 | The number of retries after a DNS failure occurred. |
protocol | String | udp | The protocol type of DNS detection. Valid values:
|
proxy_protocol | Boolean | false | Indicates whether the PROXY protocol is enabled. Valid values:
|
acceptable_response_code | String | 400 | The acceptable status code. Note We recommend that you configure assertions. |
isBase64Encode | String | false | Indicates whether the password is decoded by using the Base64 algorithm. Valid values:
|
cert_verify | Boolean | false | Indicates whether the certificate is verified. Valid values:
|
unfollow_redirect | Boolean | false | Indicates whether redirects are followed if the status code 301 or 302 is returned. Valid values:
|
diagnosis_mtr | Boolean | false | Indicates whether MTR is automatically used to diagnose network issues if a task fails. Valid values:
|
diagnosis_ping | Boolean | false | Indicates whether ping requests are automatically sent to detect network latency if a detection task fails. Valid values:
|
retry_delay | Integer | 1 | The number of times a failed detection request is retried. |
assertions | Array of assertions | The assertions. | |
assertions | |||
property | String | json path | The parsing path of the assertion.
|
type | String | response_time | The assertion type. Valid values:
|
operator | String | lessThan | The comparison operator of the assertion. Valid values:
|
target | String | 1000 | The numeric value or character used for matching. |
AgentGroup | String | PC | The probe type. Valid values:
|
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.