获取¶
GET /api/v1/issue/notification_policy/{issue_notification_policy_uuid}/get
概述¶
读取一条通知策略及其关联日程、频道和创建更新身份。
调用前和使用步骤¶
从通知策略列表复制策略uuid放入路径,读取extend中各通知类型和升级配置。修改前保存name、notificationScheduleUUIDs及extend的目标完整值;日程UUID由relNotificationScheduleInfos[].uuid取得。详情的日程为原始实体配置,不附加列表中的effectiveTimeInfos。策略需要在控制台关联到目标频道,并关联有效通知日程;实际接收人由日程的时区、当日时段、有效期、轮换和通知目标决定。保存策略本身不会立即发送测试通知。
路由参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| issue_notification_policy_uuid | string | Y | 本空间通知策略UUID,非日程UUID。 例子: inpy_example获取或填写方式: 从通知策略列表的content.data[].uuid或创建响应content.uuid获取。 |
请求头¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| DF-API-KEY | string | Y | 工作空间的 OpenAPI 鉴权凭据。 例子: <DF-API-KEY>获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。 |
参数补充说明¶
升级规则是否触发还取决于Issue创建时间、当前状态、负责人、关联事件数、定时任务及日程有效目标,不能仅根据保存的JSON认定消息已发送。
请求例子¶
curl --get 'https://openapi.guance.com/api/v1/issue/notification_policy/inpy_example/get' \
-H 'DF-API-KEY: <DF-API-KEY>'
响应¶
HTTP 200,application/json。下方示例展示可直接读取的主要字段。
| 字段 | 类型 | 说明 |
|---|---|---|
| content.id | integer | 已存在配置的数据库编号;后续接口定位使用uuid。 |
| content.uuid | string | 通知策略UUID,inpy_开头。 |
| content.workspaceUUID | string | 所属工作空间UUID。 |
| content.name | string | 策略名称。 |
| content.status | integer | 记录状态,0启用,2禁用,3删除;列表包含未删除的启用和禁用策略。 |
| content.creator | string | 创建调用身份。 |
| content.updator | string | 最近更新身份,未更新为空字符串。 |
| content.createAt | integer | 创建时间,Unix秒。 |
| content.updateAt | integer | 更新时间,Unix秒,未更新为-1。 |
| content.deleteAt | integer | 删除时间,Unix秒,未删除为-1。 |
| content.extend | object | 保存的通知范围与升级规则,可为{}。 |
| content.extend.notifyTypes | array<string> |
启用的动作类型。 |
| content.extend.notifyTypes[] | string | 单个动作类型,具体作用见参数表。 |
| content.extend.upgradeCfg | object | 按触发类型保存的规则。 |
| content.extend.upgradeCfg.noManager | object | Issue创建时没有有效负责人并进入无负责人候选,状态为Open/Working/Pending时,从Issue创建起等待;已有Issue仅移除负责人不保证重新进入候选。填写正整数秒且为60的倍数。启用类型为issueUpgrade.noManager,未配置时省略。 |
| content.extend.upgradeCfg.noManager.duration | integer | 首次等待秒数。 |
| content.extend.upgradeCfg.noManager.notifyType | string | once或cycle;未保存该值时按once。 |
| content.extend.upgradeCfg.noManager.cycleDuration | integer | 循环间隔,单位秒,cycle模式使用。 |
| content.extend.upgradeCfg.noManager.cycleTimes | integer | 循环触发总次数上限,1至30,包含首次。 |
| content.extend.upgradeCfg.processTimeout | object | Issue处于Open/Working的持续未完成时间。首次从创建计时;从Pending/Resolved/Closed重新进入处理状态时,从重新进入后的状态记录计时。启用类型为issueUpgrade.processTimeout,未配置时省略。 |
| content.extend.upgradeCfg.processTimeout.duration | integer | 首次等待秒数。 |
| content.extend.upgradeCfg.processTimeout.notifyType | string | once或cycle;未保存该值时按once。 |
| content.extend.upgradeCfg.processTimeout.cycleDuration | integer | 循环间隔,单位秒,cycle模式使用。 |
| content.extend.upgradeCfg.processTimeout.cycleTimes | integer | 循环触发总次数上限,1至30,包含首次。 |
| content.extend.upgradeCfg.openProcessTimeout | object | 仅Issue保持Open时生效,从最后一次状态变更时间计时;没有状态记录则从创建时间计时。启用类型为issueUpgrade.processTimeout,未配置时省略。 |
| content.extend.upgradeCfg.openProcessTimeout.duration | integer | 首次等待秒数。 |
| content.extend.upgradeCfg.openProcessTimeout.notifyType | string | once或cycle;未保存该值时按once。 |
| content.extend.upgradeCfg.openProcessTimeout.cycleDuration | integer | 循环间隔,单位秒,cycle模式使用。 |
| content.extend.upgradeCfg.openProcessTimeout.cycleTimes | integer | 循环触发总次数上限,1至30,包含首次。 |
| content.extend.upgradeCfg.eventStorm | object | Issue记录的eventCount严格大于exceedTimes后触发;不按Open/Working状态限定,已完成Issue也可能满足数量条件。启用类型为issueUpgrade.eventStorm,未配置时省略。 |
| content.extend.upgradeCfg.eventStorm.exceedTimes | integer | 数量阈值,eventCount严格超过才触发。 |
| content.extend.upgradeCfg.eventStorm.notifyType | string | once或cycle;未保存该值时按once。 |
| content.extend.upgradeCfg.eventStorm.cycleDuration | integer | 循环间隔,单位秒,cycle模式使用。 |
| content.extend.upgradeCfg.eventStorm.cycleTimes | integer | 循环触发总次数上限,1至30,包含首次。 |
| content.extend.其他字段 | JSON | 来源保存的其他扩展字段,不代表都能控制通知行为。 |
| content.relNotificationScheduleInfos | array<object> |
关联的有效日程对象;列表另含格式化有效期,详情仅为原始日程配置。 |
| content.relNotificationScheduleInfos[].id | integer | 数据库记录编号;操作日程使用uuid。 |
| content.relNotificationScheduleInfos[].uuid | string | 日程 UUID,供查询、修改、删除及通知策略引用。 |
| content.relNotificationScheduleInfos[].workspaceUUID | string | 所属工作空间 UUID。 |
| content.relNotificationScheduleInfos[].name | string | 日程名称。 |
| content.relNotificationScheduleInfos[].timezone | string | 此日程解释当日时段和生效日期所用的 IANA 时区。 |
| content.relNotificationScheduleInfos[].start | string | 当日开始时刻 HH:MM。 |
| content.relNotificationScheduleInfos[].end | string | 当日结束时刻 HH:MM,结束分钟的最后一秒仍有效。 |
| content.relNotificationScheduleInfos[].notifyTargets | array<string> |
按顺序保存的成员、通知对象 UUID 或邮箱。 |
| content.relNotificationScheduleInfos[].notifyTargets[] | string | acnt_ 账号、notify_ 通知对象或邮箱字符串。 |
| content.relNotificationScheduleInfos[].extend | object | 扩展配置;未配置可为 {}。 |
| content.relNotificationScheduleInfos[].extend.enableRotateNotification | boolean | 是否启用轮换;缺省按 false。 |
| content.relNotificationScheduleInfos[].extend.rotationCycle | string | 启用轮换时的周期:day按日、week按周一、month按自然月、workDay仅工作日逐日、weekend仅周末逐日。不识别节假日,未配置可省略。 |
| content.relNotificationScheduleInfos[].extend.effectiveTime | object | 整体有效期,未配置可省略。 |
| content.relNotificationScheduleInfos[].extend.effectiveTime.start | integer | 有效期开始 Unix 秒;0 或省略不限制。 |
| content.relNotificationScheduleInfos[].extend.effectiveTime.end | integer | 有效期结束 Unix 秒;0 或省略不限制。 |
| content.relNotificationScheduleInfos[].rotationUpdateAt | integer | 轮换计算的起始时间,Unix 秒。更改轮换相关配置时重置。 |
| content.relNotificationScheduleInfos[].status | integer | 记录状态,活动记录为 0。 |
| content.relNotificationScheduleInfos[].creator | string | 创建调用身份。 |
| content.relNotificationScheduleInfos[].updator | string | 最近更新身份;未更新为空字符串。 |
| content.relNotificationScheduleInfos[].createAt | integer | 创建时间,Unix 秒。 |
| content.relNotificationScheduleInfos[].updateAt | integer | 更新时间,Unix 秒;未更新为 -1。 |
| content.relNotificationScheduleInfos[].deleteAt | integer | 删除时间,Unix 秒;未删除为 -1。 |
| content.relChannelInfos | array<object> |
引用此策略的频道对象。 |
| content.relChannelInfos[].id | integer | 频道记录编号。 |
| content.relChannelInfos[].uuid | string | 频道 UUID,供修改、删除或订阅使用。 |
| content.relChannelInfos[].workspaceUUID | string | 频道所属工作空间。 |
| content.relChannelInfos[].name | string | 频道名称。default 表示默认频道。 |
| content.relChannelInfos[].description | string | 频道描述。 |
| content.relChannelInfos[].notifyTarget | array<string> |
该频道直接配置的通知对象 UUID。 |
| content.relChannelInfos[].notifyTarget[] | string | 单个通知对象 UUID。 |
| content.relChannelInfos[].notifyUpgradeCfg | object | 升级通知配置,未配置时为空对象。 |
| content.relChannelInfos[].notifyUpgradeCfg.triggerTime | integer | 触发升级通知的等待时长,单位秒。 |
| content.relChannelInfos[].notifyUpgradeCfg.notifyTarget | array<string> |
升级通知对象 UUID 列表。 |
| content.relChannelInfos[].notifyUpgradeCfg.notifyTarget[] | string | 升级通知对象 UUID。 |
| content.relChannelInfos[].status | integer | 记录状态,正常为 0。 |
| content.relChannelInfos[].creator | string | 创建调用身份。 |
| content.relChannelInfos[].updator | string | 最近更新身份,未更新可为空字符串。 |
| content.relChannelInfos[].createAt | integer | 创建时间,Unix 秒。 |
| content.relChannelInfos[].updateAt | integer | 更新时间,Unix 秒,未更新为 -1。 |
| content.relChannelInfos[].deleteAt | integer | 删除时间,Unix 秒,未删除为 -1。 |
| content.creatorInfo | object | 创建/更新身份的可解析账户资料。API Key不属于自然人成员,列表可返回null,详情可为空对象;以下字段按身份可选。 |
| content.creatorInfo.uuid | string | 账号UUID。 |
| content.creatorInfo.status | integer | 账号记录状态。 |
| content.creatorInfo.wsAccountStatus | integer | 账号在工作空间的状态。 |
| content.creatorInfo.username | string | 登录名。 |
| content.creatorInfo.name | string | 显示名称。 |
| content.creatorInfo.iconUrl | string | 头像URL,可省略。 |
| content.creatorInfo.email | string | 邮箱或API Key身份标识。 |
| content.creatorInfo.mobile | string | 手机号,可为空。 |
| content.creatorInfo.countryCode | string | 国家/地区码,可省略。 |
| content.creatorInfo.acntWsNickname | string | 工作空间昵称,可省略。 |
| content.updatorInfo | object | 创建/更新身份的可解析账户资料。API Key不属于自然人成员,列表可返回null,详情可为空对象;以下字段按身份可选。 |
| content.updatorInfo.uuid | string | 账号UUID。 |
| content.updatorInfo.status | integer | 账号记录状态。 |
| content.updatorInfo.wsAccountStatus | integer | 账号在工作空间的状态。 |
| content.updatorInfo.username | string | 登录名。 |
| content.updatorInfo.name | string | 显示名称。 |
| content.updatorInfo.iconUrl | string | 头像URL,可省略。 |
| content.updatorInfo.email | string | 邮箱或API Key身份标识。 |
| content.updatorInfo.mobile | string | 手机号,可为空。 |
| content.updatorInfo.countryCode | string | 国家/地区码,可省略。 |
| content.updatorInfo.acntWsNickname | string | 工作空间昵称,可省略。 |
| content.declaration | object 或 null | 工作空间公共声明。 |
{
"code": 200,
"content": {
"id": 42,
"uuid": "inpy_example",
"workspaceUUID": "wksp_example",
"name": "生产异常通知",
"extend": {
"notifyTypes": [
"issue.add",
"issue.modify",
"issueReply.add",
"issueUpgrade.noManager",
"issueUpgrade.processTimeout",
"issueUpgrade.eventStorm"
],
"upgradeCfg": {
"noManager": {
"duration": 600,
"notifyType": "once"
},
"processTimeout": {
"duration": 1800,
"notifyType": "cycle",
"cycleDuration": 600,
"cycleTimes": 3
},
"openProcessTimeout": {
"duration": 900,
"notifyType": "once"
},
"eventStorm": {
"exceedTimes": 60,
"notifyType": "once"
}
}
},
"status": 0,
"creator": "wsak_example",
"updator": "",
"createAt": 1785430800,
"updateAt": -1,
"deleteAt": -1,
"relNotificationScheduleInfos": [],
"relChannelInfos": [],
"creatorInfo": {},
"updatorInfo": {},
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
错误响应¶
鉴权、限流和公共请求错误参见公共错误定义。
| HTTP 状态 | errorCode | 触发条件 | 消息或响应说明 | 处理方式 |
|---|---|---|---|---|
| 404 | ft.ObjectNotExists | 策略不存在、已删除或不属于当前API Key工作空间 | 指定对象不存在 | 从通知策略列表重新取得本空间UUID。 |
| 500 | ft.InternalServerError | 策略或关联资料读取失败 | 内部错误 | 稍后重试;持续失败提供traceId。 |