You need to enable JavaScript to run this app.
导航
CreateNotification
最近更新时间:2025.04.14 14:43:15首次发布时间:2025.04.14 14:43:15
我的收藏
有用
有用
无用
无用

创建通知策略。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com?Action=CreateNotification&Version=2018-01-01

调试

请求参数

参数类型是否必选示例值描述
ActionStringCreateNotification接口名称。当前 API 的名称为 CreateNotification
VersionString2018-01-01接口版本。当前 API 的版本为 2018-01-01

Name

String

notification-demo

通知策略名称。

  • 取值范围为 1~128。
  • 不能以数字、中划线开头。
NotificationsArray of Notify-通知策略详情。
EffectStartAtString00:00通知策略生效的开始时间,格式为HH:MM,例如:00:00。

EffectEndAt

String

23:59

通知策略生效的截止时间,格式为HH:MM,例如:23:59。

说明

EffectEndAt时间必须晚于EffectStartAt时间。

Notify

参数类型是否必选示例值描述

Level

String

notice

告警通知等级,取值:

  • notice:通知
  • warning:警告
  • critical:严重
  • recovery:恢复

WebhookIds

Array of String

18913208***4528

Webhook 回调 ID。
可以调用 ListWebhooks 接口,获取 Webhook 回调 ID。

AlertMethods

Array of String

Email

告警通知方式,取值:

  • Email:使用邮箱接收告警通知。
  • Phone:使用电话接收告警通知。
  • SMS:使用短信接收告警通知。
  • Webhook:使用 Webhook 接收告警通知。

ContactGroupIds

Array of String

145080093687100****

告警联系组 ID。
可以调用 ListContactGroups 接口,获取联系组 ID。

请求示例

POST https://open.volcengineapi.com?Action=CreateNotification&Version=2018-01-01
Content-Type: application/json
{
    "Name": "notification-demo",
    "Notifications": [
        {
            "Level": "notice",
            "WebhookIds": [
                "18913208***4528"
            ],
            "AlertMethods": [
                "Email"
            ],
            "ContactGroupIds": [
                "145080093687100****"
            ]
        }
    ],
    "EffectStartAt": "00:00",
    "EffectEndAt": "23:59"
}

返回参数

参数类型示例值描述
DataArray of String189898***00通知策略 ID。

返回示例

{
    "ResponseMetadata": {
        "Action": "CreateNotification",
        "Region": "cn-beijing",
        "Service": "Volc_Observe",
        "Version": "2018-01-01",
        "RequestId": "20230604110420****100232280022D31"
    },
    "Result": {
        "Data": [
            "189898***00"
        ]
    }
}

错误码

本接口无特有的错误码。更多信息请参见 错误码