呼叫 DescribeSiteMonitorList 介面查詢站點監控任務列表。
介面說明
本文將提供一個示例,查詢當前帳號的站點監控任務列表。返回結果顯示,當前帳號存在一條站點監控記錄HanZhou_ECS2。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cms:DescribeSiteMonitorList |
get |
*All Resource
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| 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 |
網站監控任務探測類型。CloudMonitor 支援的探測類型包括: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 |
網站監控任務名稱。 |
New monitoring task |
| 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": "New monitoring task",
"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. | |
| 503 | %s | %s | |
| 406 | ExceedingQuota | Exceeding quota limits. | |
| 429 | ThrottlingException | The request was denied due to request throttling. | |
| 409 | %s | %s |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。