You need to enable JavaScript to run this app.
导航
EnablePresetAlertTemplate
最近更新时间:2025.06.19 14:19:57首次发布时间:2025.06.19 14:19:57
我的收藏
有用
有用
无用
无用

应用预置告警模版,批量创建告警策略。

请求说明

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

调试

请求参数

参数类型是否必选示例值描述
ActionStringEnablePresetAlertTemplate接口名称。当前 API 的名称为 EnablePresetAlertTemplate
VersionString2018-01-01接口版本。当前 API 的版本为 2018-01-01
TemplateIdString1354766247190******告警模版 ID。

NotificationId

String

189898***00

通知策略 ID。
可以调用 ListNotifications 接口,获取通知策略 ID。

注意

该参数的优先级比AlertMethods更高,因此,当使用该参数指定告警通知策略 ID 时,其他告警通知的配置(AlertMethodsContactGroupIdsWebhookIdsEffectStartAtEffectEndAt等)将失效。

AlertMethods

Array of String

Phone

告警通知方式,取值:

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

ContactGroupIds

Array of String

["145080093687100****"]

AlertMethods配置为EmailPhoneSMS时,指定告警联系组 ID。
可以调用 ListContactGroups 接口,获取联系组 ID。

WebhookIds

Array of String

["18913208***4528"]

AlertMethods配置为Webhook时,指定告警 Webhook 回调 ID。
可以调用 ListWebhooks 接口,获取 Webhook 回调 ID。

Webhook

String

http://alert.volc.com/callback

AlertMethods配置为Webhook时,配置告警 Webhook 回调地址。

注意

WebhookIdsWebhook参数仅能配置一个,不能同时配置。

EffectStartAtString00:00告警策略生效的开始时间,格式为HH:MM,例如:00:00。

EffectEndAt

String

23:59

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

说明

EffectEndAt时间必须晚于EffectStartAt时间。

ProjectNameStringdefault生成告警策略所属的项目。

UpgradePresetAlertTemplate

Boolean

false

当预置告警模版有新版本时,是否升级预置告警模板。取值:

  • true:升级。
  • false:不升级。

请求示例

POST https://open.volcengineapi.com?Action=EnablePresetAlertTemplate&Version=2018-01-01
Content-Type: application/json
{
    "TemplateId": "1354766247190******",
    "AlertMethods": [
        "Phone"
    ],
    "ContactGroupIds": [
        "145080093687100****"
    ],
    "EffectStartAt": "00:00",
    "EffectEndAt": "23:59",
    "ProjectName": "default",
    "UpgradePresetAlertTemplate": true
}

返回参数

参数类型示例值描述
DataArray of String["184361599203***"]告警模版所生成的告警策略的 ID 列表。

返回示例

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

错误码

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