调用DescribeSiteMonitorList接口查询站点监控任务列表。
接口说明
本文将提供一个示例,查询当前账号的站点监控任务列表。返回结果显示,当前账号存在一条站点监控记录HanZhou_ECS2。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cms:DescribeSiteMonitorList |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TaskId |
string |
否 |
站点监控任务 ID。 |
a1ecd34a-8157-44d9-b060-14950837**** |
| TaskType |
string |
否 |
站点监控任务探测类型。云监控支持的探测类型包括:HTTP 、PING 、TCP 、UDP 、DNS 、SMTP 、POP3 、FTP。 |
HTTP |
| Keyword |
string |
否 |
查询站点监控任务的关键字。 说明
支持根据任务名称或任务地址模糊搜索。 |
site |
| Page |
integer |
否 |
分页页码。默认值:1。 |
1 |
| PageSize |
integer |
否 |
每页显示条数。默认值:10。 |
10 |
| TaskState |
string |
否 |
任务状态。取值:
|
1 |
| AgentGroup |
string |
否 |
任务使用的节点类型。取值:
|
PC |
关于公共请求参数的详情,请参见公共参数。
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
无。 |
||
| RequestId |
string |
请求 ID。 |
A80DB41C-AF6C-50E1-ADB5-66DCBA3D266B |
| Success |
string |
操作是否成功。取值:
|
true |
| Code |
string |
状态码。 说明
200 表示成功。 |
200 |
| Message |
string |
返回信息。 |
successful |
| PageNumber |
integer |
分页页码。 |
1 |
| PageSize |
integer |
每页显示记录条数。 |
10 |
| TotalCount |
integer |
总记录条数。 |
1 |
| SiteMonitors |
object |
||
| SiteMonitor |
array<object> |
站点监控任务列表。 |
|
|
array<object> |
无。 |
||
| TaskType |
string |
站点监控任务探测类型。云监控支持的探测类型包括:HTTP 、PING 、TCP 、UDP 、DNS 、SMTP 、POP3 、FTP。 |
TCP |
| UpdateTime |
string |
站点监控任务更新时间。 |
2022-03-08 17:14:31 |
| Interval |
string |
探测频率。单位:分钟。 |
1 |
| TaskState |
string |
任务状态。取值:
|
1 |
| CreateTime |
string |
任务的创建时间。 |
2021-11-01 11:05:18 |
| TaskName |
string |
站点监控任务名称。 |
新的探测任务 |
| Address |
string |
任务的探测 URL 地址或 IP 地址。 |
https://aliyun.com |
| TaskId |
string |
站点监控任务 ID。 |
f5783760-1b39-4b6b-80e8-453d962a**** |
| OptionsJson |
object |
扩展选项。每一种探测类型有不同的扩展类型,详情请参见 CreateSiteMonitor 。 |
|
| password |
string |
SMTP、POP3 或 FTP 探测类型的密码。 |
123**** |
| request_format |
string |
HTTP 请求内容格式。取值:
|
hex |
| response_content |
string |
匹配响应内容。
|
cf0f85 |
| failure_rate |
number |
丢包率。 说明
该参数仅适用于 PING 探测类型。 |
0.5 |
| time_out |
integer |
超时时间。单位:毫秒。 |
3000 |
| header |
string |
HTTP 请求头。格式为 |
testKey:testValue |
| cookie |
string |
发送 HTTP 请求的 Cookie 文本。 |
lang=en |
| port |
integer |
TCP、UDP、SMTP 或 POP3 探测类型的端口。 |
80 |
| ping_num |
integer |
PING 探测的次数设置。 |
20 |
| authentication |
integer |
是否开启安全验证。取值:
|
1 |
| http_method |
string |
HTTP 的请求方法。取值:
|
get |
| match_rule |
integer |
是否包含报警规则。取值:
|
0 |
| dns_match_rule |
string |
DNS 的匹配规则。取值:
|
IN_DNS |
| request_content |
string |
HTTP 探测请求内容。 |
cf0f85 |
| username |
string |
FTP、SMTP 或 POP3 的用户名。 |
testUser |
| response_format |
string |
HTTP 响应内容格式。取值:
|
hex |
| dns_type |
string |
DNS 解析类型。仅适用于 DNS 探测类型。取值:
|
A |
| dns_server |
string |
指定 DNS 解析服务器的域名或 IP 地址。 |
192.168.XX.XX |
| enable_operator_dns |
boolean |
是否使用运营商的 DNS。
|
true |
| attempts |
integer |
DNS 失败后重试次数。 |
3 |
| protocol |
string |
DNS 探测协议类型。取值:
|
udp |
| proxy_protocol |
boolean |
是否开启 ProxyProtocol。取值:
|
false |
| acceptable_response_code |
string |
可接受的状态码。 说明
建议您使用断言配置。 |
400 |
| isBase64Encode |
string |
是否对密码进行 base64 解码存储。取值:
|
false |
| cert_verify |
boolean |
是否验证证书。取值:
|
false |
| unfollow_redirect |
boolean |
如果出现 301 或 302 状态码,是否跟随再次做重定向探测。取值:
|
false |
| diagnosis_mtr |
boolean |
是否开启任务失败后的自动 MTR 网络诊断。取值:
|
false |
| diagnosis_ping |
boolean |
是否开启探测任务失败后自动 Ping 网络延时探测。取值:
|
false |
| retry_delay |
integer |
探测失败后重试次数。 |
1 |
| assertions |
object |
||
| assertions |
array<object> |
断言配置组。 |
|
|
object |
断言配置组。 |
||
| property |
string |
断言内容解析路径。
|
json path |
| type |
string |
断言类型。取值:
|
response_time |
| operator |
string |
断言比较操作符。取值:
|
lessThan |
| target |
string |
断言匹配比较的目标数值或字符。 |
1000 |
| AgentGroup |
string |
探针类型。取值:
|
PC |
示例
正常返回示例
JSON格式
{
"RequestId": "A80DB41C-AF6C-50E1-ADB5-66DCBA3D266B",
"Success": "true",
"Code": "200",
"Message": "successful",
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 1,
"SiteMonitors": {
"SiteMonitor": [
{
"TaskType": "TCP",
"UpdateTime": "2022-03-08 17:14:31",
"Interval": "1",
"TaskState": "1",
"CreateTime": "2021-11-01 11:05:18",
"TaskName": "新的探测任务",
"Address": "https://aliyun.com",
"TaskId": "f5783760-1b39-4b6b-80e8-453d962a****",
"OptionsJson": {
"password": "123****",
"request_format": "hex",
"response_content": "cf0f85",
"failure_rate": 0.5,
"time_out": 3000,
"header": "testKey:testValue",
"cookie": "lang=en",
"port": 80,
"ping_num": 20,
"authentication": 1,
"http_method": "get",
"match_rule": 0,
"dns_match_rule": "IN_DNS",
"request_content": "cf0f85",
"username": "testUser",
"response_format": "hex",
"dns_type": "A",
"dns_server": "192.168.XX.XX",
"enable_operator_dns": true,
"attempts": 3,
"protocol": "udp",
"proxy_protocol": false,
"acceptable_response_code": "400",
"isBase64Encode": "false",
"cert_verify": false,
"unfollow_redirect": false,
"diagnosis_mtr": false,
"diagnosis_ping": false,
"retry_delay": 1,
"assertions": {
"assertions": [
{
"property": "json path",
"type": "response_time",
"operator": "lessThan",
"target": "1000"
}
]
}
},
"AgentGroup": "PC"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidQueryParameter | %s | |
| 401 | AccessDeniedException | You donot have sufficient access to perform this action. | |
| 500 | %s | %s | |
| 500 | InternalError | %s | |
| 402 | LimitExceeded | The quota for this customer had been reached. | |
| 403 | Forbidden | You are not authorized to operate the specified resource. | 没有权限,请使用RAM进行授权 |
| 503 | %s | %s | |
| 406 | ExceedingQuota | Exceeding quota limits. | 任务数量超出限额 |
| 429 | ThrottlingException | The request was denied due to request throttling. | |
| 409 | %s | %s |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。