跳转到主要内容
POST
/
alert
/
list-by-card
告警列表-卡片视图
curl --request POST \
  --url 'https://api.flashcat.cloud/alert/list-by-card?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "view_id": "<string>",
  "start_time": 123,
  "end_time": 123,
  "labels": {},
  "is_active": true,
  "title": "<string>",
  "channel_id": 123,
  "integration_id": 123,
  "alert_severity": "<string>",
  "is_my_channel": true,
  "ever_muted": true
}
'
{
  "error": {
    "code": "<string>",
    "message": "<string>"
  },
  "data": {
    "items": [
      {
        "title": "<string>",
        "total": 123,
        "alert_severity": "<string>",
        "alert_ids": [
          "<string>"
        ]
      }
    ]
  }
}

授权

app_key
string
query
必填

请求体

application/json
view_id
string
必填
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

labels
标签筛选 · object
必填

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

is_active
boolean | null

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

title
string

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

channel_id
integer
integration_id
integer
alert_severity
string

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

is_my_channel
boolean

仅筛选与我相关的channel下的告警

ever_muted
boolean

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

响应

200 - application/json
error
object

错误信息,仅失败时存在

data
object