調用DescribeHybridMonitorTaskList介面查詢資料接入工作清單。
介面說明
本文將提供一個樣本,查詢當前帳號下的所有資料接入任務。返回結果顯示,當前帳號下只有一個資料接入任務aliyun_task。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cms:DescribeHybridMonitorTaskList |
list |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Keyword |
string |
否 |
搜尋索引鍵。 |
task |
| TaskId |
string |
否 |
監控任務 ID。 |
36**** |
| GroupId |
string |
否 |
應用分組 ID。 關於如何擷取應用分組 ID,請參見 DescribeMonitorGroups 。 |
3607**** |
| Namespace |
string |
否 |
指標倉庫名稱。 關於如何擷取指標倉庫名稱,請參見 DescribeHybridMonitorNamespaceList 。 |
aliyun |
| PageSize |
integer |
否 |
分頁時每頁顯示的資料行數。 起始值:1。預設值:10。 |
10 |
| PageNumber |
integer |
否 |
頁碼。 起始值:1。預設值:1。 |
1 |
| IncludeAliyunTask |
boolean |
否 |
返回結果是否包含阿里雲產品的資料接入任務。取值:
|
true |
| TaskType |
string |
否 |
監控任務類型。取值:
枚舉值:
|
aliyun_fc |
| TargetUserId |
integer |
否 |
成員 ID。 說明
僅當您通過管理帳號調用本介面刪除成員的阿里雲資料接入任務(即 |
120886317861**** |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
無。 |
||
| RequestId |
string |
請求 ID。 |
11145B76-566A-5D80-A8A3-FAD98D310079 |
| Success |
string |
操作是否成功。取值:
|
true |
| Code |
string |
狀態代碼。 說明
200 表示成功。 |
200 |
| Message |
string |
返回資訊。
|
success |
| PageSize |
integer |
分頁時每頁顯示的資料行數。 |
10 |
| PageNumber |
integer |
頁碼。 |
1 |
| Total |
integer |
總記錄條數。 |
1 |
| TaskList |
array<object> |
監控工作清單。 |
|
|
array<object> |
無。 |
||
| YARMConfig |
string |
接入企業CloudMonitor的阿里雲產品的設定檔。
|
products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total |
| CreateTime |
string |
建立監控任務的時間戳記。 單位:毫秒。 |
1639382496000 |
| TaskName |
string |
監控任務名稱。 |
aliyun_task |
| Namespace |
string |
主機歸屬的指標倉庫。 |
aliyun |
| UploadRegion |
string |
主機歸屬的地區。 |
cn-hangzhou |
| NetworkType |
string |
主機的網路類型。取值:
|
vpc |
| CollectTimout |
integer |
CloudMonitor外掛程式採集主機監控資料的逾時時間。取值:
單位:秒。 |
15 |
| CollectTargetEndpoint |
string |
CloudMonitor外掛程式採集主機監控資料的地址。 |
http://localhost |
| TaskType |
string |
監控任務類型。取值:
|
aliyun_sls |
| MatchExpressRelation |
string |
監控任務的執行個體過濾條件。取值:
|
or |
| Description |
string |
監控任務描述。 |
aliyun |
| GroupId |
string |
應用分組 ID。 |
3607**** |
| CollectInterval |
integer |
CloudMonitor外掛程式採集主機監控資料的間隔時間。取值:
單位:秒。 |
60 |
| TargetUserId |
string |
成員 ID。 說明
僅當您通過管理帳號調用本介面時,顯示該參數。 |
120886317861**** |
| CollectTargetPath |
string |
CloudMonitor Agent 採集的時候,採集的相對路徑。 |
/metrics |
| CollectTargetType |
string |
採集目標類型。包括:Spring、Tomcat、Nginx、Tengine、JVM、Redis 和 MySQL 等。 |
nginx |
| TaskId |
string |
監控任務 ID。 |
36**** |
| AttachLabels |
array<object> |
監控任務的標籤。 |
|
|
object |
無。 |
||
| Name |
string |
標籤鍵。 |
key1 |
| Value |
string |
標籤值。 |
value1 |
| MatchExpress |
array<object> |
應用分組中執行個體的匹配條件。 |
|
|
object |
無。 |
||
| Value |
string |
執行個體名稱的值。 |
ECS_instance1 |
| Name |
string |
執行個體名稱。 |
name |
| Function |
string |
執行個體名稱的匹配方法。取值:
|
all |
| Instances |
array |
分批採集監控資料的執行個體列表。 |
|
|
string |
執行個體 ID。 |
i-hp368focau7dp0hw**** |
|
| ExtraInfo |
string |
執行個體的附加資訊。 |
test |
| LogFilePath |
string |
本地日誌資料儲存在CloudMonitor所在主機的指定路徑。
|
C:\UserData\log\*.Log |
| LogSplit |
string |
本地日誌資料根據不同匹配模式的切分結果。 說明
本地日誌資料的匹配模式包括:完整正則模式、分隔字元模式和 JSON 模式。 |
{"type": "regex","regex": "\\d+\\.\\d+\\.\\d+\\.\\d+\\s+(\\d+)\\s+\\S+\\s+\\[\\d+/\\S+/\\d+:\\d+:\\d+:\\d+\\s+\\+\\d+\\]\\s+(\\S+)\\s+\\S+\\s+/\\S+/\\S+/\\S+\\s+(\\d+)","columns": [{"name": "field1"},{"name": "filed2","translate": {"default": "-","mappings": [{"from": "(\\w+)","to": "$1x","type": "regex"}]}},{"name": "filed3","translate": {"default": "-","mappings": [{"from": "NumberRange(100,300)","to": "true","type": "function"}]}}]} |
| LogProcess |
string |
本地日誌監控計算方式。 |
[{"metric": "metric1","filters": [{"column": "filed2","type": "include","values": ["222222"]}],"groupBys": [{"column": "filed3","name": "filed3"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]},{"metric": "metric2","filters": [{"column": "field1","type": "include","values": ["11111"]}],"groupBys": [{"column": "filed2","name": "filed2"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]}] |
| LogSample |
string |
本地日誌資料的樣本。 |
{"logContent":"100.116.134.26 1119 - [13/Aug/2019:16:55:46 +0800] POST metrichub-cn-hongkong.aliyun.com /agent/metrics/putLines 200 0 \"-\" \"127.0.0.1:7001\" \"Go-http-client/1.1\" \"-\" \"-\" \"0a98a21a15656865460656276e\"","addData":{"field1":["1119","1119"],"filed2":["POSTx","POST"],"filed3":["true","200"]}} |
| SLSProcess |
string |
SLS 日誌資料的配置資訊。 |
{"express": [],"filter": {"filters": [{"key": "task_type","operator": "=","value": "1"}]},"groupby": [{"alias": "isp","key": "isp","sqlKey": "t.`isp`","valueKey": "isp"}],"interval": 60,"labels": [{"name": "__cms_app__","type": 0,"value": "sitemonitor"}],"statistics": [{"alias": "http_dns_time_avg","function": "avg","key": "http_dns_time"}]} |
| SLSProcessConfig |
object |
SLS 日誌配置。 說明
僅當 |
|
| Filter |
object |
SLS 日誌中參數的過濾條件。 |
|
| Relation |
string |
多個參數過濾條件之間的關係。取值:
|
and |
| Filters |
array<object> |
SLS 日誌中參數的過濾條件。 |
|
|
object |
SLS 日誌中參數的過濾條件。 |
||
| SLSKeyName |
string |
SLS 日誌中過濾的參數名稱。 |
host |
| Operator |
string |
SLS 日誌中參數值的過濾方式。取值:
|
= |
| Value |
string |
SLS 日誌中參數的過濾值。 |
200 |
| Statistics |
array<object> |
SLS 日誌的統計方式。 |
|
|
object |
SLS 日誌的統計方式。 |
||
| SLSKeyName |
string |
SLS 日誌統計的參數名稱。 |
name |
| Function |
string |
在計算周期內根據選定的統計方法對日誌資料進行彙總處理。取值:
|
count |
| Alias |
string |
SLS 日誌統計結果的別名。 |
level_count |
| Parameter1 |
string |
SLS 日誌的統計值。
|
200 |
| Parameter2 |
string |
SLS 日誌的統計值。 說明
僅當 |
299 |
| GroupBy |
array<object> |
對資料進行空間維度彙總,相當於 SQL 中的 Group By。 |
|
|
object |
對資料進行空間維度彙總,相當於 SQL 中的 Group By。 |
||
| SLSKeyName |
string |
SLS 日誌統計的參數名稱。 |
code |
| Alias |
string |
SLS 日誌統計結果的別名。 |
ApiResult |
| Express |
array<object> |
SLS 日誌統計結果的擴充欄位的四則運算結果。 |
|
|
object |
SLS 日誌統計結果的擴充欄位的四則運算結果。 |
||
| Express |
string |
SLS 日誌統計結果的擴充欄位的四則運算結果。 |
success_count |
| Alias |
string |
SLS 日誌統計結果的擴充欄位的四則運算結果的別名。 |
SuccRate |
樣本
正常返回樣本
JSON格式
{
"RequestId": "11145B76-566A-5D80-A8A3-FAD98D310079",
"Success": "true",
"Code": "200",
"Message": "success",
"PageSize": 10,
"PageNumber": 1,
"Total": 1,
"TaskList": [
{
"YARMConfig": "products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total",
"CreateTime": "1639382496000",
"TaskName": "aliyun_task",
"Namespace": "aliyun",
"UploadRegion": "cn-hangzhou",
"NetworkType": "vpc",
"CollectTimout": 15,
"CollectTargetEndpoint": "http://localhost",
"TaskType": "aliyun_sls",
"MatchExpressRelation": "or",
"Description": "aliyun",
"GroupId": "3607****",
"CollectInterval": 60,
"TargetUserId": "120886317861****",
"CollectTargetPath": "/metrics",
"CollectTargetType": "nginx",
"TaskId": "36****",
"AttachLabels": [
{
"Name": "key1",
"Value": "value1"
}
],
"MatchExpress": [
{
"Value": "ECS_instance1",
"Name": "name",
"Function": "all"
}
],
"Instances": [
"i-hp368focau7dp0hw****"
],
"ExtraInfo": "test",
"LogFilePath": "C:\\UserData\\log\\*.Log",
"LogSplit": "{\"type\": \"regex\",\"regex\": \"\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\s+(\\\\d+)\\\\s+\\\\S+\\\\s+\\\\[\\\\d+/\\\\S+/\\\\d+:\\\\d+:\\\\d+:\\\\d+\\\\s+\\\\+\\\\d+\\\\]\\\\s+(\\\\S+)\\\\s+\\\\S+\\\\s+/\\\\S+/\\\\S+/\\\\S+\\\\s+(\\\\d+)\",\"columns\": [{\"name\": \"field1\"},{\"name\": \"filed2\",\"translate\": {\"default\": \"-\",\"mappings\": [{\"from\": \"(\\\\w+)\",\"to\": \"$1x\",\"type\": \"regex\"}]}},{\"name\": \"filed3\",\"translate\": {\"default\": \"-\",\"mappings\": [{\"from\": \"NumberRange(100,300)\",\"to\": \"true\",\"type\": \"function\"}]}}]}",
"LogProcess": "[{\"metric\": \"metric1\",\"filters\": [{\"column\": \"filed2\",\"type\": \"include\",\"values\": [\"222222\"]}],\"groupBys\": [{\"column\": \"filed3\",\"name\": \"filed3\"}],\"calculates\": [{\"column\": \"field1\",\"name\": \"avg\",\"type\": \"avg\"}]},{\"metric\": \"metric2\",\"filters\": [{\"column\": \"field1\",\"type\": \"include\",\"values\": [\"11111\"]}],\"groupBys\": [{\"column\": \"filed2\",\"name\": \"filed2\"}],\"calculates\": [{\"column\": \"field1\",\"name\": \"avg\",\"type\": \"avg\"}]}]",
"LogSample": "{\"logContent\":\"100.116.134.26 1119 - [13/Aug/2019:16:55:46 +0800] POST metrichub-cn-hongkong.aliyun.com /agent/metrics/putLines 200 0 \\\"-\\\" \\\"127.0.0.1:7001\\\" \\\"Go-http-client/1.1\\\" \\\"-\\\" \\\"-\\\" \\\"0a98a21a15656865460656276e\\\"\",\"addData\":{\"field1\":[\"1119\",\"1119\"],\"filed2\":[\"POSTx\",\"POST\"],\"filed3\":[\"true\",\"200\"]}}",
"SLSProcess": "{\"express\": [],\"filter\": {\"filters\": [{\"key\": \"task_type\",\"operator\": \"=\",\"value\": \"1\"}]},\"groupby\": [{\"alias\": \"isp\",\"key\": \"isp\",\"sqlKey\": \"t.`isp`\",\"valueKey\": \"isp\"}],\"interval\": 60,\"labels\": [{\"name\": \"__cms_app__\",\"type\": 0,\"value\": \"sitemonitor\"}],\"statistics\": [{\"alias\": \"http_dns_time_avg\",\"function\": \"avg\",\"key\": \"http_dns_time\"}]}",
"SLSProcessConfig": {
"Filter": {
"Relation": "and",
"Filters": [
{
"SLSKeyName": "host",
"Operator": "=",
"Value": "200"
}
]
},
"Statistics": [
{
"SLSKeyName": "name",
"Function": "count",
"Alias": "level_count",
"Parameter1": "200",
"Parameter2": "299"
}
],
"GroupBy": [
{
"SLSKeyName": "code",
"Alias": "ApiResult"
}
],
"Express": [
{
"Express": "success_count",
"Alias": "SuccRate"
}
]
}
}
]
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | %s | %s | |
| 500 | %s | %s | |
| 500 | InternalError | %s | |
| 403 | %s | %s | |
| 404 | %s | %s |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。