跳转至

等级 列出



GET /api/v1/incidents/level/list

概述

列出当前空间默认及自定义故障等级配置。

调用前和使用步骤

Key需命中routine.defaultAccess或incidents.incidentsLevelManage之一,仅当前Key所属空间。此模块与Issue等级接口共享底层等级与默认等级配置,变更可能同时影响故障/Issue等级选择;并非只在本模块建立独立副本。后台启用全局等级时,实际有效等级选择可由全局配置优先决定,本空间管理列表仍只列默认和空间自定义项,不含后台全局等级。请管理员确认生效口径后修改,不把管理列表所有项都当可用等级。

无请求参数、不分页。默认四项始终列出,并用isDisabled标记空间默认开关;自定义项附加isDefault=false及身份摘要。读取列表不会过滤掉已禁用默认项,选故障等级前须检查开关/后台全局优先规则,不以出现在管理列表作为可用证明。默认项没有数据库id/creator等自定义实体字段,客户端须兼容两种形状。

请求头

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

参数补充说明

只列空间默认与空间自定义等级,不包含管理后台全局等级。默认项可能被标记isDisabled=true但仍列在管理响应中。

请求例子

curl --get 'https://openapi.guance.com/api/v1/incidents/level/list' \
  -H 'DF-API-KEY: <DF-API-KEY>'

响应

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

字段 类型 说明
content array<object> 默认四项在前,空间自定义按createAt降序;不分页、不含后台全局等级。
content[].uuid string 默认system_level_0/1/2/3,自定义issl_等。
content[].name string 默认名称P0/P1/P2/未知按语言配置返回,自定义取保存值。
content[].color string 展示颜色。
content[].description string 等级说明。
content[].isDefault boolean 默认true,自定义false。
content[].isDisabled boolean 或 null 仅默认项返回,来自空间默认等级开关;被禁用仍在管理列表中。
content[].id integer 或 null 数据库行ID;业务定位用uuid,提交前快照可null。
content[].status integer 数据库状态,0活动/3删除;与故障业务状态incidentsStatus不同。
content[].creator string 创建主体,API Key一般为wsak_资源UUID。
content[].updator string 最近更新主体,未更新可为空。
content[].createAt integer Unix秒创建时间。
content[].updateAt integer Unix秒最近更新时间。
content[].deleteAt integer Unix秒删除时间;未删除-1。
content[].workspaceUUID string 仅自定义项,所属空间。
content[].extend JSON 或 null 仅自定义项保存的扩展。
content[].extend.自定义字段 JSON 创建方保存的动态扩展键值。
content[].isManage boolean 本空间自定义通常false。
content[].creatorInfo object 仅自定义项的主体摘要,未找到{}。
content[].creatorInfo.uuid string 主体UUID;系统回复主体可能为空或系统标识。
content[].creatorInfo.status integer 主体状态。
content[].creatorInfo.wsAccountStatus integer 空间成员状态;Key取Key状态,不是故障状态。
content[].creatorInfo.username string 登录名/Key名/系统名。
content[].creatorInfo.name string 显示名,系统AI显示名使用站点配置。
content[].creatorInfo.iconUrl string 头像URL,系统摘要可省略。
content[].creatorInfo.email string 联系邮箱;Key摘要可能为Key UUID,并非可投递邮箱。
content[].creatorInfo.mobile string 联系手机号,可为空。
content[].creatorInfo.countryCode string 区号,系统摘要可省略。
content[].creatorInfo.acntWsNickname string 空间昵称,系统摘要可省略。
content[].updatorInfo object 仅自定义项的主体摘要,未找到{}。
content[].updatorInfo.uuid string 主体UUID;系统回复主体可能为空或系统标识。
content[].updatorInfo.status integer 主体状态。
content[].updatorInfo.wsAccountStatus integer 空间成员状态;Key取Key状态,不是故障状态。
content[].updatorInfo.username string 登录名/Key名/系统名。
content[].updatorInfo.name string 显示名,系统AI显示名使用站点配置。
content[].updatorInfo.iconUrl string 头像URL,系统摘要可省略。
content[].updatorInfo.email string 联系邮箱;Key摘要可能为Key UUID,并非可投递邮箱。
content[].updatorInfo.mobile string 联系手机号,可为空。
content[].updatorInfo.countryCode string 区号,系统摘要可省略。
content[].updatorInfo.acntWsNickname string 空间昵称,系统摘要可省略。
content[].declaration object 每个非空项的当前空间公共声明。
{
  "code": 200,
  "content": [
    {
      "name": "P0",
      "color": "#E94444",
      "description": "默认等级配置,业务重要功能不可用且大面积影响用户。",
      "uuid": "system_level_0",
      "isDefault": true,
      "isDisabled": false,
      "declaration": {}
    },
    {
      "name": "P1",
      "color": "#FF7931",
      "description": "默认等级配置,业务重要功能不可用,但影响用户有限,如仅影响内部用户。",
      "uuid": "system_level_1",
      "isDefault": true,
      "isDisabled": false,
      "declaration": {}
    },
    {
      "name": "P2",
      "color": "#FFB44A",
      "description": "默认等级配置,业务周边功能不可用,持续故障将大面积影响用户体验。",
      "uuid": "system_level_2",
      "isDefault": true,
      "isDisabled": false,
      "declaration": {}
    },
    {
      "name": "未知",
      "color": "#C9C9C9",
      "description": "默认等级配置,业务影响未知。",
      "uuid": "system_level_3",
      "isDefault": true,
      "isDisabled": false,
      "declaration": {}
    },
    {
      "id": 123,
      "uuid": "issl_example",
      "status": 0,
      "creator": "wsak_example",
      "updator": "",
      "createAt": 1785427200,
      "updateAt": -1,
      "deleteAt": -1,
      "workspaceUUID": "wksp_example",
      "name": "P3-轻微",
      "color": "#3F94DC",
      "description": "局部功能受影响",
      "extend": {},
      "isManage": false,
      "declaration": {},
      "isDefault": false,
      "creatorInfo": {},
      "updatorInfo": {}
    }
  ],
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

错误响应

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

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

文档评价

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