跳转到主要内容
POST
查询洞察故障列表

限制说明

使用说明

  • 默认按故障创建时间从新到旧排序(asc: true 为从旧到新)。
  • 可用 p + limit 翻页(最多可取到第 10,000 条),更深的翻页请把上一页返回的 search_after_ctx 传回。传入 search_after_ctx 时,total 只统计游标之后的故障数。
  • responder_ids 保留任一指定成员参与响应的故障。
  • 非账户所有者、非管理员的成员只能看到自己有权访问的协作空间的数据,其他协作空间会被静默排除。
  • is_my_team 为 true 时,team_ids 收窄为调用者所在的团队。传入的 team_ids 都不是调用者所在团队,或调用者不属于任何团队时,返回空结果。

授权

app_key
string
query
必填

在 Flashduty 控制台 我的 → APP Key 中创建的 APP Key。可通过 query 参数 app_key 或请求头 Fd-App-Key 传入。实际可访问范围是该 APP Key 的权限范围与创建者当前角色权限的交集,请妥善保管。

请求体

application/json

故障分页列表请求。在 InsightFilter 基础上增加分页字段。

start_time
integer<int64>
必填

起始时间,Unix 秒。必须大于 0。

end_time
integer<int64>
必填

结束时间,Unix 秒,必须大于 start_time。

team_ids
integer<int64>[]

按团队 ID 过滤,至多 100 项。

Maximum array length: 100
channel_ids
integer<int64>[]

按协作空间 ID 过滤,至多 100 项。

Maximum array length: 100
responder_ids
integer<int64>[]

按响应人成员 ID 过滤。用于 /insight/responder(返回哪些响应人)以及故障列表/导出(任一指定成员参与响应的故障);账户、团队、协作空间维度和 Top-K 接口忽略该字段。最多 100 个。

Maximum array length: 100
severities
enum<string>[]

按严重程度过滤:Critical、Warning、Info 或 Ok。最多 3 个。

Maximum array length: 3
可用选项:
Critical,
Warning,
Info,
Ok
incident_ids
string[]

按故障 ID(24 位十六进制)过滤。仅用于故障列表和故障导出。最多 100 个。

Maximum array length: 100
Pattern: ^[0-9a-fA-F]{24}$
query
string

对故障标题做子串匹配(SQL LIKE %query%)。

labels
object

标签过滤(精确匹配)。

fields
object

自定义字段过滤(精确匹配)。

orderby
enum<string>

故障列表的排序字段;仅支持 created_at(故障创建时间,默认)。用于 /insight/incident/list 和 /insight/incident/export。

可用选项:
created_at
asc
boolean

为 true 时升序,否则降序(默认)。用于故障列表和故障导出;/insight/alert/topk-by-label 有自己的 asc。

is_my_team
boolean

只看调用者所在团队的数据(同时传 team_ids 时取交集)。交集为空或调用者不属于任何团队时,结果为空。

time_zone
string

用于切分 aggregate_unit 时间桶的 IANA 时区(如 Asia/Shanghai、UTC);EST 之类的缩写以及 Etc/GMT±N 会被拒绝。默认 UTC。/insight/incident/export 用它渲染时间,未传时依次回退到账户时区、Asia/Shanghai。

seconds_to_close_from
integer<int64>

解决时长下界(秒,包含)。

必填范围: x >= 0
seconds_to_close_to
integer<int64>

解决时长上界(秒,不包含)。两端同时设置时必须大于 seconds_to_close_from:故障列表和导出会返回 InvalidParameter,其他接口返回空结果。

必填范围: x >= 0
seconds_to_ack_from
integer<int64>

认领时长下界(秒,包含)。

必填范围: x >= 0
seconds_to_ack_to
integer<int64>

认领时长上界(秒,不包含)。两端同时设置时必须大于 seconds_to_ack_from:故障列表和导出会返回 InvalidParameter,其他接口返回空结果。

必填范围: x >= 0
export_fields
string[]

导出 CSV 的列 key 列表,按给定顺序输出;未知或重复的 key 会被拒绝。各导出接口支持的 key 集合不同,见对应接口的描述。仅导出接口使用;最多 50 个。

Maximum array length: 50
description_html_to_text
boolean

导出时是否将描述列中的 HTML 标签转换为纯文本。

include_ever_muted
boolean

是否包含曾被收敛的故障;默认不包含。

p
integer | null
默认值:1

页码,从 1 开始。仅在未提供 search_after_ctx 时生效;p * limit 不能超过 10,000 条。

必填范围: x >= 0
limit
integer | null
默认值:20

每页条数,最大 100,默认 20。

必填范围: 0 <= x <= 100
search_after_ctx
string | null

上一页返回的分页游标(该页最后一行的故障 ID),传入以获取下一页。

响应

成功

成功响应结构。2xx 响应中 request_id 标识本次调用(同时出现在 Flashcat-Request-Id 响应头中),data 为接口业务 payload。失败响应使用不同结构,参见 ErrorResponse。

request_id
string
必填

本次请求的唯一 ID,也会在 Flashcat-Request-Id 响应头中返回。反馈问题时请一并附上。

示例:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

data
object

接口返回的数据,格式见各接口的 200 响应。没有返回数据的接口会返回 {} 或完全不带 data。