列出¶
POST /api/v1/incidents/list
概述¶
Body 请求参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| pageSize | integer | 每页返回数量 允许为空: False 例子: 10 |
|
| pageIndex | integer | 页码 允许为空: False 例子: 1 |
|
| timeRange | array | 时间范围列表(毫秒级时间戳) 允许为空: False 例子: [1765076432000, 1766554821000] |
|
| search | string | 搜索关键词 允许为空: False 例子: test |
|
| filters | array | 过滤条件 允许为空: False 例子: [{'op': '=', 'field': 'level', 'value': ['system_level_1', 'system_level_0']}] |
|
| incidentsStatus | array | 故障状态过滤列表 允许为空: False 例子: ['open'] |
|
| level | array | 故障等级过滤列表 允许为空: False 例子: ['system_level_1', 'system_level_0'] |
|
| assigner | array | 故障处理人过滤列表,传入UUID 允许为空: False 例子: ['acnt_xxxx32'] |
|
| tags | array | 标签过滤列表,传入标签 UUID 允许为空: False 例子: ['tag_xxxx32'] |
|
| schedule | array | 值班日程列表, 传入值班日程 UUID 允许为空: False 例子: ['incsch_xxxx'] |
参数补充说明¶
filters 详细说明 列表filter参数每一个查询条件为一个三元组构成:
| 参数名 | 参数类型 | 参数说明 |
|---|---|---|
| filters.field | string | 过滤条件字段 |
| filters.value | array | 过滤条件值列表 |
| filters.op | string | 比较符号 (= 等于;!= 不等于) |
filters.field 目前支持的字段
| 参数名 | 说明 |
|---|---|
| tags | 标签 |
| incidentsStatus | 故障状态 ["open", "working", "resolved", "closed"] |
| level | 故障等级对应的uuid |
| assigner | 处理人对应的uuid |
| schedule | 值班日程对应的uuid |
| host | 主机 |
| service | 服务 |
| resource | 资源 |
| pod_name | Pod 名称 |
| app_name | 应用名称 |
| env | 环境 |
| url | URL |
filters 示例
请求例子¶
curl 'https://openapi.guance.com/api/v1/incidents/list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"pageSize":10,"pageIndex":1,"filters":[{"op":"=","field":"level","value":["system_level_1","system_level_0"]}]}' \
--compressed
响应¶
{
"code": 200,
"content": {
"data": [
{
"workspaceUUID": "wksp_xxxxx",
"name": "服务 xxxxx 在过去 10 分钟期间日志数量出现了 1 次异常突增",
"level": "system_level_3",
"description": "xxxxxx",
"source": "internal",
"resourceCategory": "Monitor",
"resourceType": "checker",
"resourceUUID": "",
"resourceUrl": "",
"resourceIdentity": "xxxxxxx",
"assigner": [
"acnt_xxxxxx"
],
"incidentsStatus": "working",
"statusTime": {
"open": 1768926015,
"working": 1768973255
},
"statusChangeTime": 1768973255,
"cumulativeTime": 53474,
"eventCount": 0,
"eventUpdateAt": 1768926015,
"dimensionTag": {
"service": "xxxxxxx"
},
"extend": {},
"dtHost": "",
"dtService": "xxxxxxx",
"dtResource": "",
"dtPodName": "",
"dtAppName": "",
"dtAppId": "",
"dtEnv": "",
"dtUrl": "",
"id": 199,
"uuid": "incident_xxxxxx",
"status": 0,
"creator": "Obsy",
"updator": "acnt_xxxxxx",
"createAt": 1768926000,
"deleteAt": -1,
"updateAt": 1768973256,
"assignerInfo": [
{
"uuid": "acnt_xxxxxx",
"status": 0,
"wsAccountStatus": 0,
"username": "xxxxx",
"name": "xxxx",
"iconUrl": "",
"email": "xxxxx",
"mobile": "",
"acntWsNickname": ""
}
],
"operateRecord": {
"uuid": "incop_xxxx",
"incidentsUUID": "incident_xxxx",
"workspaceUUID": "wksp_xxxx",
"content": "负责人变更: -> xxxx",
"extend": {
"after": [
"acnt_xxxxx"
],
"before": [],
"after_info": [
{
"name": "xxx",
"uuid": "acnt_xxxxx",
"email": "xxxx",
"mobile": "",
"status": 0,
"iconUrl": "",
"username": "xxxx",
"acntWsNickname": "",
"wsAccountStatus": 0
}
],
"before_info": []
},
"operator": "acnt_xxxx",
"operateType": "assigner_update",
"createAt": 1768973255
},
"scheduleInfo": [
{
"workspaceUUID": "wksp_xxxx",
"name": "default",
"timezone": "Asia/Shanghai",
"start": "00:00",
"end": "23:59",
"tagFilter": [],
"dimensionFilter": "",
"notifyTargets": [],
"strategyConfig": [],
"extend": {
"rotationCycle": "day",
"enableRotateNotification": false
},
"isDefault": true,
"rotationUpdateAt": 1768803347,
"id": 6952,
"uuid": "incsch_xxxx",
"status": 0,
"creator": "SYS",
"updator": "acnt_xxxx",
"createAt": 1768803072,
"deleteAt": -1,
"updateAt": 1768803347
}
]
}
],
"pageInfo": {
"pageIndex": 1,
"pageSize": 20,
"count": 1,
"totalCount": 1
}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "xxxxx"
}