Queries the details of a site monitoring task by calling the DescribeSiteMonitorAttribute operation.
Operation description
This topic provides an example on how to query the details of the site monitoring task cc641dff-c19d-45f3-ad0a-818a0c4f****. The response shows that the name of the site monitoring task is test123, the monitored address is https://aliyun.com, and the carrier is Alibaba.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TaskId |
string |
Yes |
The ID of the monitoring task. |
cc641dff-c19d-45f3-ad0a-818a0c4f**** |
| IncludeAlert |
boolean |
No |
Specifies whether the returned task details include alert rules. |
false |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Code |
string |
The status code. |
200 |
| Message |
string |
The response message. |
successful |
| MetricRules |
object |
||
| MetricRule |
array<object> |
The alert rules of the monitoring task. |
|
|
object |
The alert rules of the monitoring task. |
||
| ActionEnable |
string |
The status of the alert rule. Valid values: |
true |
| AlarmActions |
string |
The alert contact group to which alert notifications are sent. |
CloudMonitor |
| ComparisonOperator |
string |
The comparison operator of the threshold for the alert rule. Valid values: |
GreaterThanYesterday |
| Dimensions |
string |
The dimensions associated with the alert rule. |
[{"taskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****" }] |
| EvaluationCount |
string |
The number of alert retries. |
3 |
| Expression |
string |
The expression of the alert rule. |
$Availability=30 |
| Level |
string |
The level of the alert rule. Valid values: |
2 |
| MetricName |
string |
The metric name. |
Availability |
| Namespace |
string |
The namespace of the Alibaba Cloud service. |
acs_networkmonitor |
| OkActions |
string |
The alert contact group that receives alert notifications. |
[ "CloudMonitor"] |
| Period |
string |
The time interval. This is typically the reporting period of the metric. Unit: seconds. |
15s |
| RuleId |
string |
The ID of the alert rule. |
bf071ae_7b7aec3817b0fdf**** |
| RuleName |
string |
The name of the alert rule. |
rule1 |
| StateValue |
string |
The alert status. Valid values: |
OK |
| Statistics |
string |
The statistical method for the alert. Valid values: |
Availability |
| Threshold |
string |
The alert threshold. |
30 |
| RequestId |
string |
The request ID. |
D17DF650-7EBD-54D0-903A-1D4E624D7402 |
| SiteMonitors |
object |
The details of the monitoring task. |
|
| Address |
string |
The URL or IP address that is monitored by the task. |
https://aliyun.com |
| AgentGroup |
string |
The type of detection point. Default value: PC. |
PC |
| CustomSchedule |
object |
The custom monitoring schedule. You can select a time period from Monday to Sunday for monitoring. |
|
| days |
object |
||
| days |
array |
The monitoring days. |
|
|
integer |
The monitoring days. |
1 |
|
| end_hour |
integer |
The custom monitoring end time. |
18 |
| start_hour |
integer |
The custom monitoring start time. |
8 |
| time_zone |
string |
The time zone for custom monitoring. |
local |
| Interval |
string |
The monitoring interval. Unit: minutes. Valid values: 1, 5, 15, 30, and 60. |
1 |
| IspCities |
object |
||
| IspCity |
array<object> |
The carrier and city of the detection point. |
|
|
object |
The carrier and city of the detection point. |
||
| City |
string |
The city ID. |
738 |
| CityName |
string |
The city name. |
Beijing. |
| Isp |
string |
The carrier ID. |
465 |
| IspName |
string |
The carrier name. |
Alibaba. |
| Type |
string |
The network type of the detection point. Valid values: |
IDC |
| OptionJson |
object |
The extended options. Each monitoring type has different extended options. For more information, see CreateSiteMonitor. |
|
| assertions |
object |
||
| assertions |
array<object> |
The assertion configuration group. |
|
|
object |
The assertion configuration group. |
||
| operator |
string |
The comparison operator for the assertion. Valid values: |
lessThan |
| property |
string |
The content parsing path for the assertion. |
json path |
| target |
string |
The target value or string for assertion comparison. |
0 |
| type |
string |
The assertion type. Valid values: |
response_time |
| attempts |
integer |
The number of retries after a DNS failure. |
3 |
| auth_info |
object |
The authentication information. |
|
| type |
string |
The authentication type. HTTP Basic Authentication is supported. Valid values: basic. |
basic |
| username |
string |
The username for HTTP Basic Authentication. |
test_username |
| password |
string |
The password for HTTP Basic Authentication. |
test_password |
| use_cookie_session_key |
boolean |
Specifies whether the key is stored in the client cookie for digest authentication. |
false |
| grant_type |
string |
The grant type for OAuth 2.0 authentication. Valid values: client_credentials and password. |
password |
| client_id |
string |
The client ID for OAuth 2.0 client authentication. |
client_id |
| client_secret |
string |
The client secret for OAuth 2.0 client authentication. |
client_secret |
| scopes |
object |
||
| scopes |
array |
The permission scopes requested in OAuth 2.0. |
|
|
string |
A single permission scope requested in OAuth 2.0. |
test_operation |
|
| token_url |
string |
The authorization server URL for OAuth 2.0. |
https://www.example.com |
| auth_style |
string |
The OAuth 2.0 authentication style. Valid values: ROA and RPC. |
ROA |
| access_key_id |
string |
Supported only in multi-step monitoring. The AccessKey ID for Alibaba Cloud authentication. We recommend that you use encrypted storage. |
testAk |
| access_key_secret |
string |
Supported only in multi-step monitoring. The AccessKey secret for Alibaba Cloud authentication. We recommend that you use encrypted storage. |
testSk |
| region_id |
string |
Supported only in multi-step monitoring. The region ID for Alibaba Cloud authentication requests. |
cn-hangzhou |
| api_action |
string |
Supported only in multi-step monitoring. The API action for Alibaba Cloud operations. |
example_api |
| api_version |
string |
Supported only in multi-step monitoring. The API version for Alibaba Cloud operations. |
2019-01-01 |
| with_addon_resources |
boolean |
Supported only in multi-step monitoring. Specifies whether additional resources exist when Alibaba Cloud authentication is used for this step. |
false |
| service_name |
string |
The service name for AWS authentication requests. |
example_service_name |
| session_token |
string |
The session token for AWS authentication. |
example_token |
| blocked_url_list |
object |
||
| blocked_url_list |
array |
The list of blocked resource URLs. Path wildcards are supported. |
|
|
string |
The list of blocked resource URLs. Path wildcards are supported. |
www.taobao.com/** |
|
| browser_headers |
object |
||
| browser_headers |
array<object> |
The custom headers. The structure is |
|
|
object |
The custom headers. The structure is |
{"key":"value"} |
|
| browser_hosts |
object |
||
| browser_hosts |
array |
The custom hosts. The structure is |
|
|
string |
The custom hosts. The structure is |
{"url":"www.taobao.com","ip":"127.0.0.1"} |
|
| browser_info |
object |
||
| browser_info |
array<object> |
The browser information. |
|
|
object |
The browser information. |
||
| browser |
string |
The type of the browser. |
Chrome |
| device |
string |
The screen type. |
laptop |
| browser_insecure |
boolean |
Specifies whether to ignore certificate errors. Valid values: |
false |
| browser_task_version |
string |
The browser monitoring version. Valid values: |
1 |
| cookie |
string |
The cookie for the HTTP request. |
lang=en |
| diagnosis_mtr |
boolean |
Specifies whether to enable automatic MTR network diagnostics after a task failure. Valid values: |
false |
| diagnosis_ping |
boolean |
Specifies whether to enable automatic PING network latency detection after a task failure. Valid values: |
false |
| dns_hijack_whitelist |
string |
The DNS hijacking configuration list. |
www.taobao.com:www.taobao.com.danuoyi.tbcache.com |
| dns_match_rule |
string |
The DNS matching rule. Valid values: |
IN_DNS |
| dns_server |
string |
The IP address of the DNS server. |
192.168.XX.XX |
| dns_type |
string |
The DNS resolution type. This parameter applies only to the DNS monitoring type. Valid values: |
A |
| empty_message |
boolean |
Specifies whether to allow the WebSocket task to return no message or an empty message. Valid values: |
false |
| expect_exist_string |
object |
||
| expect_exist_string |
array |
The list of strings expected to exist on the page. |
|
|
string |
The list of strings expected to exist on the page. |
expected string |
|
| expect_non_exist_string |
object |
||
| expect_non_exist_string |
array |
The list of strings expected not to exist on the page. |
|
|
string |
The list of strings expected not to exist on the page. |
unexpected string |
|
| expect_value |
string |
The alias or address to be resolved. |
dns_server |
| failure_rate |
number |
The packet loss rate. |
0.4 |
| header |
string |
The HTTP request header. |
testKey:testValue |
| http_method |
string |
The HTTP request method. Valid values: |
get |
| ip_network |
string |
The network type of the task. Valid values: v4, v6, and auto. Default value: v4. |
v4 |
| isBase64Encode |
string |
Specifies whether to store the password after Base64 decoding. Valid values: |
false |
| match_rule |
integer |
Specifies whether to include alert rules. Valid values: |
1 |
| min_tls_version |
string |
The minimum TLS version. TLS 1.2 and later are supported by default. TLS 1.0 and 1.1 are disabled. You can change the configuration if you still need to support them. |
tlsv1.2 |
| password |
string |
The password for the SMTP, POP3, or FTP monitoring type. |
123**** |
| ping_num |
integer |
The number of heartbeats for the PING monitoring type. |
29 |
| ping_port |
integer |
The PING port. This parameter applies to TCP PING. |
80 |
| ping_type |
string |
The PING protocol type. Valid values: |
icmp |
| port |
integer |
The port for the TCP, UDP, SMTP, or POP3 monitoring type. |
110 |
| protocol |
string |
The monitoring protocol. |
TCP |
| quic_enabled |
boolean |
Specifies whether the browser monitoring task uses the QUIC protocol. Valid values: |
true |
| quic_target |
object |
||
| quic_target |
array |
The list of sites that are forced to use the QUIC protocol. |
|
|
string |
The site that is forced to use the QUIC protocol. The format is url:port. The port is optional and defaults to 443. |
www.taobao.com |
|
| request_content |
string |
The request content for the HTTP monitoring type. |
aa=bb |
| request_format |
string |
The format of the HTTP request content. Valid values: |
txt |
| response_content |
string |
The matched response content. |
txt |
| response_format |
string |
The format of the HTTP response content. Valid values: |
txt |
| retry_delay |
integer |
The number of retries after a monitoring failure. |
0 |
| screen_shot |
boolean |
Specifies whether to enable page screenshots. |
false |
| strict_mode |
boolean |
false |
|
| time_out |
integer |
The timeout period. Unit: milliseconds. |
3 |
| traffic_hijack_element_blacklist |
object |
||
| traffic_hijack_element_blacklist |
array |
When a redirect occurs, if the URL of a resource loaded by the browser matches an expression in this list, traffic hijacking is considered to have occurred. |
|
|
string |
When a redirect occurs, if the URL of a resource loaded by the browser matches an expression in this list, traffic hijacking is considered to have occurred. |
www.taobao.com |
|
| traffic_hijack_element_count |
integer |
When a redirect occurs, if the number of resources loaded by the browser exceeds this value, traffic hijacking is considered to have occurred. When this value is 0, no verification is performed. Default value: 0. |
0 |
| traffic_hijack_element_whitelist |
object |
||
| traffic_hijack_element_whitelist |
array |
When a redirect occurs, if the URL of a resource loaded by the browser does not match any expression in this list, traffic hijacking is considered to have occurred. |
|
|
string |
When a redirect occurs, if the URL of a resource loaded by the browser does not match any expression in this list, traffic hijacking is considered to have occurred. |
www.taobao.com |
|
| username |
string |
The username for the FTP, SMTP, or POP3 monitoring type. |
testUser |
| waitTime_after_completion |
integer |
The additional wait time after the page is opened in a browser monitoring task. |
3 |
| scroll_end |
boolean |
For browser monitoring tasks, specifies whether to scroll to the bottom of the page after it is opened. |
false |
| host_binding |
string |
The custom host for HTTP tasks. The format is ip1,ip2:address. Multiple mapping lines can be configured. The left side of the colon contains A records or CNAMEs that the domain name can be resolved to, separated by commas. The right side of the colon is the domain name. |
127.0.0.1:www.aliyun.com |
| host_binding_type |
integer |
The method by which the custom host takes effect. Valid values: 0 (random) and 1 (round-robin). Valid values:
|
0 |
| hops |
integer |
The number of hops for traceroute diagnostics when a PING task fails. |
20 |
| icmp_timeout_millis |
integer |
The timeout period for a single PING request in ICMP-based PING tasks. Unit: milliseconds. |
3000 |
| config_variables |
object |
||
| config_variables |
array<object> |
The environment variable configuration. This parameter takes effect for multi-step monitoring. |
|
|
object |
Environment variables can be referenced in parameters of different test steps by using the placeholder {{$.variable_name}}. They can also be updated by parsing the response content of a test step and referenced in subsequent steps. For sensitive information such as API keys, you can select encrypted storage. |
||
| name |
string |
The environment variable name. |
variable_name |
| value |
string |
The variable value. |
variable_value |
| secure |
boolean |
Specifies whether to use encrypted storage. |
true |
| steps |
object |
||
| steps |
array<object> |
The step configuration for multi-step monitoring. |
|
|
array<object> |
The configuration of a single step in multi-step monitoring. |
||
name
deprecated
|
string |
The step name (deprecated). |
step1 |
| step_type |
string |
The monitoring type of this step. Valid values: |
http |
| url |
string |
The URL for a single step in multi-step monitoring. |
https://aliyun.com |
| allow_failure |
boolean |
Specifies whether to continue to the next step if the current step fails. Default value: false. |
true |
| is_critical |
boolean |
Specifies whether to mark the entire monitoring task as failed if the current step fails. Default value: false. |
true |
| wait_time_in_secs |
integer |
The wait time. Unit: seconds. |
5 |
| extracted_variables |
object |
||
| extracted_variables |
array<object> |
The variable extraction configuration. |
|
|
array<object> |
The configuration of a single variable extraction. |
||
| name |
string |
The variable name. |
test_variable |
| parser |
object |
The variable extraction method settings. |
|
| parser_type |
string |
The extraction mode. Valid values: 0 (JSON), 1 (XML), and 2 (regular expression). |
0 |
| value |
string |
The variable extraction expression. |
x.testkey.arrayvalue[0].innerkey |
| field |
string |
This parameter takes effect when the variable location is HTTP header. Specifies the key in the header from which to extract the variable. |
request_id |
| extracted_type |
string |
The location from which to extract the variable. Valid values: 0 (HTTP body) and 1 (HTTP header). |
1 |
| option |
string |
The extended options for this step. Each monitoring type has different extended options. For more information, see CreateSiteMonitor. |
{"enable_operator_dns": true} |
| step_name |
string |
The step name. |
step1 |
| use_generated_cookie |
boolean |
Specifies whether to use the cookies extracted from previous steps. Default value: false. |
true |
| auto_extract_cookie |
boolean |
Specifies whether to automatically extract cookies. The set-cookie header in the HTTP response of this step is parsed, and the cookies are available in subsequent monitoring steps. Default value: false. |
true |
| trace_region |
string |
The deployment region of the target application when integrating with Managed Service for OpenTelemetry. |
cn-hangzhou |
| trace_type |
string |
Settings for the Tracing Analysis protocol used when integrating with Managed Service for OpenTelemetry. |
OpenTelemetry |
| safe_link |
integer |
This parameter takes effect for SMTP tasks. When set to 1, a secure connection is used. Default value: 0. |
0 |
| enable_packet_capture |
boolean |
Specifies whether to enable packet capture for this task. |
true |
| use_private_crt |
boolean |
Specifies whether to use a private certificate. |
|
| private_crt_file_name |
string |
The private certificate file name. |
cert.pem |
| use_ssl |
boolean |
Specifies whether to use an SSL connection when performing TCP tasks. |
tlsv1.0 |
| max_tls_version |
string |
The maximum TLS version. |
tlsv1.3 |
| server_name |
string |
The Server Name Indication (SNI). |
www.aliyun.com |
| supported_cipher_suits |
string |
The supported cipher suites. |
TLS_AES_256_GCM_SHA384 |
| TaskId |
string |
The ID of the monitoring task. |
cc641dff-c19d-45f3-ad0a-818a0c4f**** |
| TaskName |
string |
The name of the monitoring task. |
test123 |
| TaskState |
string |
The status of the monitoring task. Valid values: |
1 |
| TaskType |
string |
The type of the monitoring task. Site monitoring tasks support the following types: HTTP(S), PING, TCP, UDP, DNS, SMTP, POP3, and FTP. |
HTTP |
| VpcConfig |
object |
The VPC configuration of the internal network monitoring task. |
|
| Region |
string |
The region where the target site of the internal network monitoring task resides. |
cn-beijing |
| SecurityGroupId |
string |
The ID of the security group to which the internal network monitoring task is restricted. |
sg-xxxxxx |
| VpcId |
string |
The ID of the VPC to which the internal network monitoring task is attached. |
vpc-xxxxxx |
| VswitchId |
string |
The ID of the vSwitch to which the internal network monitoring task is attached. |
vsw-xxxxxx |
| Success |
boolean |
Indicates whether the operation was successful. Valid values: |
true |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "successful",
"MetricRules": {
"MetricRule": [
{
"ActionEnable": "true",
"AlarmActions": "CloudMonitor",
"ComparisonOperator": "GreaterThanYesterday",
"Dimensions": "[{\"taskId\": \"cc641dff-c19d-45f3-ad0a-818a0c4f****\" }]",
"EvaluationCount": "3",
"Expression": "$Availability=30",
"Level": "2",
"MetricName": "Availability",
"Namespace": "acs_networkmonitor",
"OkActions": "[ \"CloudMonitor\"]",
"Period": "15s",
"RuleId": "bf071ae_7b7aec3817b0fdf****",
"RuleName": "rule1",
"StateValue": "OK",
"Statistics": "Availability",
"Threshold": "30"
}
]
},
"RequestId": "D17DF650-7EBD-54D0-903A-1D4E624D7402",
"SiteMonitors": {
"Address": "https://aliyun.com",
"AgentGroup": "PC",
"CustomSchedule": {
"days": {
"days": [
1
]
},
"end_hour": 18,
"start_hour": 8,
"time_zone": "local"
},
"Interval": "1",
"IspCities": {
"IspCity": [
{
"City": "738",
"CityName": "Beijing.",
"Isp": "465",
"IspName": "Alibaba.",
"Type": "IDC"
}
]
},
"OptionJson": {
"assertions": {
"assertions": [
{
"operator": "lessThan",
"property": "json path",
"target": "0",
"type": "response_time"
}
]
},
"attempts": 3,
"auth_info": {
"type": "basic",
"username": "test_username",
"password": "test_password",
"use_cookie_session_key": false,
"grant_type": "password",
"client_id": "client_id",
"client_secret": "client_secret",
"scopes": {
"scopes": [
"test_operation"
]
},
"token_url": "https://www.example.com",
"auth_style": "ROA",
"access_key_id": "testAk",
"access_key_secret": "testSk",
"region_id": "cn-hangzhou",
"api_action": "example_api",
"api_version": "2019-01-01",
"with_addon_resources": false,
"service_name": "example_service_name",
"session_token": "example_token"
},
"blocked_url_list": {
"blocked_url_list": [
"www.taobao.com/**"
]
},
"browser_headers": {
"browser_headers": [
{
"key": "value"
}
]
},
"browser_hosts": {
"browser_hosts": [
"{\"url\":\"www.taobao.com\",\"ip\":\"127.0.0.1\"}"
]
},
"browser_info": {
"browser_info": [
{
"browser": "Chrome",
"device": "laptop"
}
]
},
"browser_insecure": false,
"browser_task_version": "1",
"cookie": "lang=en",
"diagnosis_mtr": false,
"diagnosis_ping": false,
"dns_hijack_whitelist": "www.taobao.com:www.taobao.com.danuoyi.tbcache.com",
"dns_match_rule": "IN_DNS",
"dns_server": "192.168.XX.XX",
"dns_type": "A",
"empty_message": false,
"expect_exist_string": {
"expect_exist_string": [
"expected string"
]
},
"expect_non_exist_string": {
"expect_non_exist_string": [
"unexpected string"
]
},
"expect_value": "dns_server",
"failure_rate": 0.4,
"header": "testKey:testValue",
"http_method": "get",
"ip_network": "v4",
"isBase64Encode": "false",
"match_rule": 1,
"min_tls_version": "tlsv1.2",
"password": "123****",
"ping_num": 29,
"ping_port": 80,
"ping_type": "icmp",
"port": 110,
"protocol": "TCP",
"quic_enabled": true,
"quic_target": {
"quic_target": [
"www.taobao.com"
]
},
"request_content": "aa=bb",
"request_format": "txt",
"response_content": "txt",
"response_format": "txt",
"retry_delay": 0,
"screen_shot": false,
"strict_mode": false,
"time_out": 3,
"traffic_hijack_element_blacklist": {
"traffic_hijack_element_blacklist": [
"www.taobao.com"
]
},
"traffic_hijack_element_count": 0,
"traffic_hijack_element_whitelist": {
"traffic_hijack_element_whitelist": [
"www.taobao.com"
]
},
"username": "testUser",
"waitTime_after_completion": 3,
"scroll_end": false,
"host_binding": "127.0.0.1:www.aliyun.com",
"host_binding_type": 0,
"hops": 20,
"icmp_timeout_millis": 3000,
"config_variables": {
"config_variables": [
{
"name": "variable_name",
"value": "variable_value",
"secure": true
}
]
},
"steps": {
"steps": [
{
"name": "step1",
"step_type": "http",
"url": "https://aliyun.com",
"allow_failure": true,
"is_critical": true,
"wait_time_in_secs": 5,
"extracted_variables": {
"extracted_variables": [
{
"name": "test_variable",
"parser": {
"parser_type": "0",
"value": "x.testkey.arrayvalue[0].innerkey"
},
"field": "request_id",
"extracted_type": "1"
}
]
},
"option": "{\"enable_operator_dns\": true}",
"step_name": "step1",
"use_generated_cookie": true,
"auto_extract_cookie": true
}
]
},
"trace_region": "cn-hangzhou",
"trace_type": "OpenTelemetry",
"safe_link": 0,
"enable_packet_capture": true,
"use_private_crt": false,
"private_crt_file_name": "cert.pem",
"use_ssl": true,
"max_tls_version": "tlsv1.3",
"server_name": "www.aliyun.com",
"supported_cipher_suits": "TLS_AES_256_GCM_SHA384"
},
"TaskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****",
"TaskName": "test123",
"TaskState": "1",
"TaskType": "HTTP",
"VpcConfig": {
"Region": "cn-beijing",
"SecurityGroupId": "sg-xxxxxx",
"VpcId": "vpc-xxxxxx",
"VswitchId": "vsw-xxxxxx"
}
},
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | The parameter is missing or invalid. %s | The parameter is invalid. |
| 401 | AccessDeniedException | You donot have sufficient access to perform this action. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 402 | LimitExceeded | The quota for this customer had been reached. | |
| 403 | Forbidden | You are not authorized to operate the specified resource. | No permission, please use RAM to authorize |
| 404 | Forbidden | Task Id does not exist | |
| 406 | ExceedingQuota | Exceeding quota limits. | The number of tasks exceeds the limit |
| 429 | Throttli∂ngException | The request was denied due to request throttling. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.