List¶
POST /api/v1/incidents/list
Overview¶
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| pageSize | integer | Number of items returned per page Allow empty: False Example: 10 |
|
| pageIndex | integer | Page number Allow empty: False Example: 1 |
|
| timeRange | array | Time range list (millisecond timestamps) Allow empty: False Example: [1765076432000, 1766554821000] |
|
| search | string | Search keyword Allow empty: False Example: test |
|
| filters | array | Filter conditions Allow empty: False Example: [{'op': '=', 'field': 'level', 'value': ['system_level_1', 'system_level_0']}] |
|
| incidentsStatus | array | Incident status filter list Allow empty: False Example: ['open'] |
|
| level | array | Incident level filter list Allow empty: False Example: ['system_level_1', 'system_level_0'] |
|
| assigner | array | Incident assigner filter list, pass in UUIDs Allow empty: False Example: ['acnt_xxxx32'] |
|
| tags | array | Tag filter list, pass in tag UUIDs Allow empty: False Example: ['tag_xxxx32'] |
|
| schedule | array | On-call schedule list, pass in on-call schedule UUIDs Allow empty: False Example: ['incsch_xxxx'] |
Supplemental Parameter Notes¶
filters Details
Each query condition in the list filters parameter consists of a triple:
| Parameter | Type | Description |
|---|---|---|
| filters.field | string | Filter condition field |
| filters.value | array | Filter condition value list |
| filters.op | string | Comparison operator (= equal; != not equal) |
Currently Supported filters.field Fields
| Parameter | Description |
|---|---|
| tags | Tags |
| incidentsStatus | Incident status ["open", "working", "resolved", "closed"] |
| level | UUID of the incident level |
| assigner | UUID of the assigner |
| schedule | UUID of the on-call schedule |
| resourceType | Incident resource type; aggregated incidents use incident_aggregation |
| aggregationRuleUUID | Aggregation rule UUID |
| host | Host |
| service | Service |
| resource | Resource |
| pod_name | Pod name |
| app_name | Application name |
| app_id | Application ID |
| env | Environment |
| url | URL |
Unsupported filters.field values (for example, project) return ft.IncidentsFilterFieldNotSupported, and the specific field is described in message.
filters Example
Request Example¶
curl 'https://openapi.truewatch.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
Response¶
{
"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"
}