跳转到主要内容
POST
/
alert
/
list
告警列表
curl --request POST \
  --url 'https://api.flashcat.cloud/alert/list?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "start_time": 123,
  "end_time": 123,
  "search_after_ctx": "<string>",
  "p": 1,
  "limit": 20,
  "asc": true,
  "orderby": "<string>",
  "title": "<string>",
  "alert_severity": "<string>",
  "is_active": true,
  "labels": {},
  "channel_ids": [
    123
  ],
  "integration_ids": [
    123
  ],
  "alert_keys": [
    "<string>"
  ],
  "ever_muted": true
}
'
{
  "error": {
    "code": "<string>",
    "message": "<string>"
  },
  "data": {
    "items": [
      {
        "alert_id": "<string>",
        "channel_id": 123,
        "channel_name": "<string>",
        "integration_id": 123,
        "integration_name": "<string>",
        "integration_type": "<string>",
        "title": "<string>",
        "alert_key": "<string>",
        "alert_severity": "Info",
        "alert_status": "Info",
        "start_time": 123,
        "last_time": 123,
        "created_at": 123,
        "updated_at": 123,
        "labels": {},
        "title_rule": "<string>",
        "description": "<string>",
        "end_time": 123,
        "events": [
          {
            "event_id": "<string>",
            "integration_id": 123,
            "channel_id": 123,
            "title": "<string>",
            "title_rule": "<string>",
            "alert_id": "<string>",
            "event_status": "Info",
            "event_severity": "Info",
            "event_time": 123,
            "description": "<string>",
            "labels": {}
          }
        ],
        "incident": {
          "incident_id": "<string>",
          "title": "<string>",
          "progress": "Triggered"
        },
        "event_cnt": 123,
        "ever_muted": true
      }
    ],
    "search_after_ctx": "<string>",
    "total": 123,
    "has_next_page": true
  }
}

授权

app_key
string
query
必填

请求体

application/json
start_time
integer
必填

该时间为query的start_time,与告警的start_time无关。实际检索条件为:alert.start_time<=query.end_time and alert.last_time>=query.start_time

end_time
integer
必填

该时间为query的end_time,与告警的end_time无关。实际检索条件为:alert.start_time<=query.end_time and alert.last_time>=query.start_time

search_after_ctx
string

游标分页,不设置为第一页。与p参数二选一。详细解释,请参考 关于分页

p
integer
默认值:1

传统分页,不设置从第一页开始,默认值为1,与search_after_ctx参数二选一。基于传统分页时设置,当设置p参数时,plimit不得超过10000** ,否则返回参数错误。详细解释,请参考 关于分页

limit
integer
默认值:20

分页条数。*当设置p参数时,(p-1)limit不得超过10000 ,否则返回参数错误。详细解释,请参考 关于分页

必填范围: 0 <= x <= 100
asc
boolean

默认按照created_at倒序

orderby
string

支持created_at updated_at,默认为created_at

title
string

支持精确匹配、正则匹配和通配匹配。以'/'作为前后缀的字符串将被识别为正则。 举例:指定('datacenter' IN ['bj01','sh-*','']) AND ('host' IN '/api-server-\d+/'),可匹配到产生于'bj01'和'sh-01'、'sh-02'三个数据中心并且主机名满足'api-server-\d+'正则的报警事件

alert_severity
string

Critical,Info, Warning支持传多个,用逗号分割

is_active
boolean | null

筛选告警状态,如果为false,则仅返回以恢复的告警,如果为true,则仅返回未恢复的告警,如果不传,则返回全部

labels
标签筛选 · object

支持精确匹配、正则匹配和通配匹配。以'/'作为前后缀的字符串将被识别为正则。 举例:指定('datacenter' IN ['bj01','sh-*','']) AND ('host' IN '/api-server-\d+/'),可匹配到产生于'bj01'和'sh-01'、'sh-02'三个数据中心并且主机名满足'api-server-\d+'正则的报警事件

channel_ids
integer[]
integration_ids
integer[]
alert_keys
string[]
ever_muted
boolean

不传查全部,传true仅返回被静默或抑制的告警,传false仅返回未被抑制过的告警

响应

200 - application/json
error
object

错误信息,仅失败时存在

data
object