应用预置告警模版,批量创建告警策略。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | EnablePresetAlertTemplate | 接口名称。当前 API 的名称为 EnablePresetAlertTemplate 。 |
Version | String | 是 | 2018-01-01 | 接口版本。当前 API 的版本为 2018-01-01 。 |
TemplateId | String | 是 | 1354766247190****** | 告警模版 ID。 |
NotificationId | String | 否 | 189898***00 | 通知策略 ID。 注意 该参数的优先级比 |
AlertMethods | Array of String | 否 | Phone | 告警通知方式,取值:
|
ContactGroupIds | Array of String | 否 | ["145080093687100****"] | 当 |
WebhookIds | Array of String | 否 | ["18913208***4528"] | 当 |
Webhook | String | 否 | http://alert.volc.com/callback | 当 注意
|
EffectStartAt | String | 是 | 00:00 | 告警策略生效的开始时间,格式为HH:MM ,例如:00:00。 |
EffectEndAt | String | 是 | 23:59 | 告警策略生效的截止时间,格式为 说明
|
ProjectName | String | 是 | default | 生成告警策略所属的项目。 |
UpgradePresetAlertTemplate | Boolean | 否 | 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 }
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Array of String | ["184361599203***"] | 告警模版所生成的告警策略的 ID 列表。 |
{ "ResponseMetadata": { "Action": "EnablePresetAlertTemplate", "Region": "cn-beijing", "Service": "Volc_Observe", "Version": "2018-01-01", "RequestId": "20230604110420****100232280022D31" }, "Result": { "Data": [ "184361599203***" ] } }
本接口无特有的错误码。更多信息请参见 错误码。