You need to enable JavaScript to run this app.
导航

CreateNotifyPolicy

最近更新时间2024.04.19 11:53:54

首次发布时间2023.06.30 15:23:34

创建告警通知策略。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com/?Action=CreateNotifyPolicy&Version=2021-03-03

请求参数

参数名称类型是否必选示例值描述
ActionStringCreateNotifyPolicy公共参数,本接口值:CreateNotifyPolicy。
VersionString2021-03-03公共参数,本接口值:2021-03-03。
NameStringtest告警通知策略名称。
DescriptionString这是一段描述告警通知策略描述信息。
LevelsArray of NotifyPolicyLevel-告警通知策略等级。

NotifyPolicyLevel

参数名称类型是否必选示例值描述
LevelStringP0告警通知策略等级,包括:P0、P1 和 P2。
ContactGroupIdsArray of String["f9626b5a-0c9e-420e-b6e5-4c66b84f080d"]告警通知策略的联系人组。

Channels

Array of String

["Email"]

告警通知策略的告警通知方式:

  • Email:邮件
  • Webhook:通用 Webhook
  • LarkBotWebhook:飞书机器人
  • DingTalkBotWebhook:钉钉机器人

注意

Levels.Level 的值不能重复。

请求示例

POST /?Action=CreateNotifyPolicy&Version=2021-03-03
Content-Type:application/json
{
    "Name": " test",
    "Description": "这是一段描述",
    "Levels": [
        {
            "Level": "P0",
            "ContactGroupIds": ["f9626b5a-0c9e-420e-b6e5-4c66b84f080d"],
            "Channels": ["Email"]
        }
    ]
}

返回参数

参数名称类型示例值描述
IdString8cd7b480-6387-44e5-aea4-db4ca2c4b47a告警通知策略 ID。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "CreateNotifyPolicy",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Id": "8cd7b480-6387-44e5-aea4-db4ca2c4b47a"
    }
}

错误码

本接口错误码如下表所示,公共错误码请参见 公共错误码

HTTP 状态码错误码错误信息描述
409Conflict.NameThe specified name conflicts with existing NotifyPolicy.同一账户下不能有同名告警通知策略。