跳转至

查询故障操作记录



GET /api/v1/incidents/operate/{incident_uuid}/list

概述

分页读取故障操作记录。

调用前和使用步骤

Key需命中routine.defaultAccess或incidents.incidentsQuery之一。当前空间读取;路径incident_uuid取故障列表的content.data[].uuid。按createAt降序、相同时id降序分页,默认pageIndex=1/pageSize=10,分页在顶层pageInfo,content是含data数组及declaration的对象;空列表不证明故障存在,此入口不先校验父故障。

返回故障操作历史,operateType区分创建/状态/等级/负责人/通知升级等。content是本地化描述,不作为机器判断依据;结构化before/after及升级信息在extend。操作记录写入默认容错,不能将列表无记录证明此前没有发生故障变更或通知。 查询期间新增记录会移动偏移分页,按uuid去重继续读取,不宣称为冻结快照。

路由参数

参数名 类型 必选 说明
incident_uuid string Y 当前工作空间故障UUID,不是告警事件ID、SLO UUID或评论UUID。
允许 null: False
例子: incident_example
获取或填写方式: 从故障列表获取content.data[].uuid。

请求头

参数名 类型 必选 说明
DF-API-KEY string Y 工作空间的 OpenAPI 鉴权凭据。
例子: <DF-API-KEY>
获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。

Query 请求参数

参数名 类型 必选 说明
pageSize integer 可选整数,默认10;当前实现没有声明最大值,调用方应限制合理正数,0/负数不作为稳定的分页契约。
允许 null: False
例子: 10
获取或填写方式: 按查询量选择,建议10至100。
pageIndex integer 可选整数,默认1;建议>=1。当前声明未限制正数,不能依赖负数报错;新增/变更期间偏移分页可移动。
允许 null: False
例子: 1
获取或填写方式: 从第一页开始,按顶层pageInfo续页。

请求例子

curl --get 'https://openapi.guance.com/api/v1/incidents/operate/incident_example/list' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  --data-urlencode pageIndex=1 \
  --data-urlencode pageSize=10

响应

HTTP 200,application/json。下方示例展示可直接读取的主要字段。

字段 类型 说明
content object 分页内容对象,记录数组在data,声明在declaration。
content.data array<object> 本页记录数组,无匹配[]。
content.data[].id integer 或 null 数据库行ID;业务定位用uuid,提交前快照可null。
content.data[].uuid string 该资源UUID。
content.data[].status integer 数据库状态,0活动/3删除;与故障业务状态incidentsStatus不同。
content.data[].creator string 创建主体,API Key一般为wsak_资源UUID。
content.data[].updator string 最近更新主体,未更新可为空。
content.data[].createAt integer Unix秒创建时间。
content.data[].updateAt integer Unix秒最近更新时间。
content.data[].deleteAt integer Unix秒删除时间;未删除-1。
content.data[].incidentsUUID string 所属故障UUID。
content.data[].workspaceUUID string 所属空间。
content.data[].content string 本地化操作描述;未承诺可机器解析,按operateType/extend判断。
content.data[].extend object 操作扩展,随operateType变化。
content.data[].extend.before JSON 状态/等级/处理人变更前值,按操作类型可能字符串或数组。
content.data[].extend.after JSON 状态/等级/处理人变更后值。
content.data[].extend.source string 操作来源;缺省studio入口可能不含此键。
content.data[].extend.自定义字段 JSON 升级策略等动作携带的扩展元数据,保留原值不作为请求参数。
content.data[].operator string 实际操作人账号/Key/系统标识。
content.data[].operateType string create/status_update/level_update/assigner_update/notify_level_update等,客户端应兼容扩展。
content.data[].creatorInfo object 主体摘要,无对应信息{}。
content.data[].creatorInfo.uuid string 主体UUID;系统回复主体可能为空或系统标识。
content.data[].creatorInfo.status integer 主体状态。
content.data[].creatorInfo.wsAccountStatus integer 空间成员状态;Key取Key状态,不是故障状态。
content.data[].creatorInfo.username string 登录名/Key名/系统名。
content.data[].creatorInfo.name string 显示名,系统AI显示名使用站点配置。
content.data[].creatorInfo.iconUrl string 头像URL,系统摘要可省略。
content.data[].creatorInfo.email string 联系邮箱;Key摘要可能为Key UUID,并非可投递邮箱。
content.data[].creatorInfo.mobile string 联系手机号,可为空。
content.data[].creatorInfo.countryCode string 区号,系统摘要可省略。
content.data[].creatorInfo.acntWsNickname string 空间昵称,系统摘要可省略。
content.data[].updatorInfo object 主体摘要,无对应信息{}。
content.data[].updatorInfo.uuid string 主体UUID;系统回复主体可能为空或系统标识。
content.data[].updatorInfo.status integer 主体状态。
content.data[].updatorInfo.wsAccountStatus integer 空间成员状态;Key取Key状态,不是故障状态。
content.data[].updatorInfo.username string 登录名/Key名/系统名。
content.data[].updatorInfo.name string 显示名,系统AI显示名使用站点配置。
content.data[].updatorInfo.iconUrl string 头像URL,系统摘要可省略。
content.data[].updatorInfo.email string 联系邮箱;Key摘要可能为Key UUID,并非可投递邮箱。
content.data[].updatorInfo.mobile string 联系手机号,可为空。
content.data[].updatorInfo.countryCode string 区号,系统摘要可省略。
content.data[].updatorInfo.acntWsNickname string 空间昵称,系统摘要可省略。
content.data[].operatorInfo object 主体摘要,无对应信息{}。
content.data[].operatorInfo.uuid string 主体UUID;系统回复主体可能为空或系统标识。
content.data[].operatorInfo.status integer 主体状态。
content.data[].operatorInfo.wsAccountStatus integer 空间成员状态;Key取Key状态,不是故障状态。
content.data[].operatorInfo.username string 登录名/Key名/系统名。
content.data[].operatorInfo.name string 显示名,系统AI显示名使用站点配置。
content.data[].operatorInfo.iconUrl string 头像URL,系统摘要可省略。
content.data[].operatorInfo.email string 联系邮箱;Key摘要可能为Key UUID,并非可投递邮箱。
content.data[].operatorInfo.mobile string 联系手机号,可为空。
content.data[].operatorInfo.countryCode string 区号,系统摘要可省略。
content.data[].operatorInfo.acntWsNickname string 空间昵称,系统摘要可省略。
content.data[].extend.before_info object 或 array 变更前等级摘要或处理人摘要数组;状态变更通常{},等级before本身是显示名称。
content.data[].extend.after_info object 或 array 变更后等级/处理人摘要;按实际operateType和类型读取。
content.data[].extend.schedule_name string 通知升级操作中的值班/策略名称摘要。
content.data[].extend.incidents_status string 通知升级时故障业务状态。
content.data[].extend.strategy_info object 通知升级策略快照。
content.data[].extend.strategy_info.name string 所属日程名称。
content.data[].extend.strategy_info.strategy object 本次选中层级及通知配置快照。
content.data[].extend.notify_info object 通知目标标识到当时目标资料的映射,账号/分组/通知对象形状不同。
content.data[].extend.notify_info.目标标识 object 或 string 该目标当时名称/邮箱/成员等资料,按实际类型读取;不表示成功投递。
content.data[].extend.is_muted boolean 命中故障通知静默时true,即使有升级记录也未实际发送。
content.data[].extend.mute_rule_info object 命中的静默规则摘要。
content.data[].extend.mute_rule_info.uuid string 静默规则UUID。
content.data[].extend.mute_rule_info.name string 静默规则名称。
content.data[].extend.muted_notify_info object 原计划发送但被静默的目标资料映射。
content.data[].extend.muted_notify_info.目标标识 object 或 string 被静默目标资料。
content.data[].extend.strategy_info.strategy.level integer 层级序号,通常从0开始。
content.data[].extend.strategy_info.strategy.levelUpTime integer 从故障状态触发时间起的升级等待秒数。
content.data[].extend.strategy_info.strategy.incidentsLevel array<string> 适用故障等级UUID列表。
content.data[].extend.strategy_info.strategy.incidentsLevel[] string 一个等级UUID。
content.data[].extend.strategy_info.strategy.incidentsStatus array<string> 适用故障状态列表,如open/working。
content.data[].extend.strategy_info.strategy.incidentsStatus[] string 一个故障状态。
content.data[].extend.strategy_info.strategy.ifRepeatNotify boolean 是否重复通知。
content.data[].extend.strategy_info.strategy.repeatNotifyInterval integer 重复通知间隔秒。
content.data[].extend.strategy_info.strategy.notifyConfig array<object> 该层通知配置数组。
content.data[].extend.strategy_info.strategy.notifyConfig[].notifyObjectType string 通知目标分类,如member/object/group,按保存版本读取。
content.data[].extend.strategy_info.strategy.notifyConfig[].notifyObject array<string> 通知目标标识;watchkeeper表示运行时当前值班人,不是固定账号UUID。
content.data[].extend.strategy_info.strategy.notifyConfig[].notifyObject[] string 一个目标账号/分组/通知对象标识或watchkeeper。
content.data[].extend.strategy_info.strategy.notifyConfig[].notifyMethod array<string> 通知方式,常见mobile电话/message短信/email邮件;对象通道按对象配置执行。
content.data[].extend.strategy_info.strategy.notifyConfig[].notifyMethod[] string 一个通知方式。
content.declaration object 或 null 非空content附带的工作空间公共声明,未配置时可为null或空对象;空content对象不添加。
pageInfo.pageIndex integer 当前页,默认1。
pageInfo.pageSize integer 当前页大小,默认10。
pageInfo.count integer 本页条数。
pageInfo.totalCount integer 匹配总条数;变更期间可改变。
{
  "code": 200,
  "content": {
    "data": [
      {
        "uuid": "incop_example",
        "incidentsUUID": "incident_example",
        "workspaceUUID": "wksp_example",
        "content": "触发了新的故障",
        "extend": {},
        "operator": "wsak_example",
        "operateType": "create",
        "id": 123,
        "status": 0,
        "creator": "wsak_example",
        "updator": "",
        "createAt": 1785427200,
        "updateAt": -1,
        "deleteAt": -1,
        "creatorInfo": {},
        "updatorInfo": {},
        "operatorInfo": {}
      }
    ],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE",
  "pageInfo": {
    "pageIndex": 1,
    "pageSize": 10,
    "count": 1,
    "totalCount": 1
  }
}

错误响应

鉴权、限流和公共请求错误参见公共错误定义。

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
406 ft.ParameterValidationFailed 使用未声明的 Query 参数或参数违反规则 参数解析失败 核对 Query 参数表及示例。
500 ft.InternalServerError 数据库读取、历史对象/配置格式或关联摘要构造等未处理异常 内部错误 核对查询参数,保留traceId;可退避重试,持续失败请管理员检查相关历史记录与服务日志。

文档评价

文档内容是否对您有帮助?