调用DescribeHybridMonitorTaskList接口查询数据接入任务列表。
接口说明
本文将提供一个示例,查询当前账号下的所有数据接入任务。返回结果显示,当前账号下只有一个数据接入任务aliyun_task
。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
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 | long | 否 | 成员 ID。 说明
仅当您通过管理账号调用本接口删除成员的阿里云数据接入任务(即 TaskType 为aliyun_fc )时,需要设置该参数。
| 120886317861**** |
关于公共请求参数的详情,请参见公共参数。
返回参数
示例
正常返回示例
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 | InternalError | %s |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2022-07-20 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 查看变更详情 |
2021-10-25 | 新增 OpenAPI | 查看变更详情 |