GetNotifyPolicy - 查询通知策略详情

更新时间:
复制 MD 格式

Get NotifyPolicy

接口说明

传入 workspace 与 uuid 查询指定通知策略。若 uuid 不存在返回 ResourceNotFound。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

GET /api/eventbase/notify-policy HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

workspace

string

是

工作空间 ID,用于隔离不同业务空间的通知策略资源。示例:default-cms-xxxx-cn-hangzhou

default-cms-xxxx-cn-hangzhou

uuid

string

是

通知策略的唯一标识,由创建接口返回。

a1b2c3d4-e5f6-7890-abcd-ef1234567890

返回参数

名称

类型

描述

示例值

object

Schema of Response

requestId

string

Id of the request

0B9377D9-C56B-5C2E-A8A4-A01D6CC3F4B8

notifyPolicy NotifyPolicy

通知策略对象详情,包含策略 uuid、名称、描述、启用状态,及通知策略(分组合并、通知路由、渠道)、订阅(事件过滤、跨 workspace 路由、老产品事件订阅)、响应计划(升级、重复通知、自动恢复、行动集成)等子实体。

示例

正常返回示例

JSON格式

{
  "requestId": "0B9377D9-C56B-5C2E-A8A4-A01D6CC3F4B8",
  "notifyPolicy": {
    "uuid": "04779a183add4f2ca06ab440f16cc580",
    "name": "生产环境告警通知策略",
    "description": "生产环境告警通知策略",
    "enabled": true,
    "version": 1,
    "workspace": "default-cms-xxxx-cn-hangzhou",
    "userId": "1234567890123456",
    "createTime": "1710000000000",
    "updateTime": "1710000000000",
    "notifyStrategy": {
      "description": "生产环境告警通知策略",
      "ignoreRestoredNotification": true,
      "groupingSetting": {
        "groupingKeys": [
          "alertname"
        ],
        "periodMin": 0,
        "silenceSec": 0,
        "times": 0
      },
      "routes": [
        {
          "channels": [
            {
              "channelType": "WEBHOOK",
              "enabledSubChannels": [
                "EMAIL"
              ],
              "receivers": [
                "webhook-uuid-xxx"
              ]
            }
          ],
          "effectTimeRange": {
            "dayInWeek": [
              0
            ],
            "startTimeInMinute": 0,
            "endTimeInMinute": 1439,
            "timeZone": "Asia/Shanghai"
          },
          "filterSetting": {
            "expression": "1 and 2 or 3",
            "conditions": [
              {
                "op": "EQ",
                "field": "severity",
                "value": "CRITICAL"
              }
            ],
            "relation": "AND"
          },
          "digitalEmployeeName": "数字员工名",
          "enableRca": false
        }
      ],
      "customTemplateEntries": [
        {
          "templateUuid": "template-uuid-xxx"
        }
      ]
    },
    "subscription": {
      "filterSetting": {
        "expression": "1 and 2 or 3",
        "conditions": [
          {
            "op": "EQ",
            "field": "severity",
            "value": "CRITICAL"
          }
        ],
        "relation": "AND"
      },
      "workspaceFilterSetting": {
        "tagSelector": {
          "expression": "1 and 2 or 3",
          "conditions": [
            {
              "op": "EQ",
              "field": "severity",
              "value": "CRITICAL"
            }
          ],
          "relation": "AND"
        },
        "workspaceUuids": [
          "\"ws-abc123\""
        ]
      },
      "subscribeLegacyEvent": false
    },
    "responsePlan": {
      "escalationId": [
        "esc-uuid-xxx"
      ],
      "repeatNotifySetting": {
        "endIncidentState": "RECOVERED",
        "repeatInterval": 300
      },
      "autoRecoverSeconds": 300,
      "pushingSetting": {
        "alertActionIds": [
          "action-uuid-xxx"
        ],
        "restoreActionIds": [
          "action-uuid-yyy"
        ]
      }
    }
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidParameterValue Illegal parameters. 参数错误。
500 InternalUnknownError The request processing has failed due to some unknown error. 服务运行错误。
403 Forbidden You are not authorized to operate the specified resource. 没有权限,请使用RAM进行授权
404 NotFound The specified resource is not found. 没有找到对应的资源。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。