绑定对象分组和通知策略至告警模版。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ApplyObjectGroupsByAlertTemplate | 接口名称。当前 API 的名称为 ApplyObjectGroupsByAlertTemplate 。 |
Version | String | 是 | 2018-01-01 | 接口版本。当前 API 的版本为 2018-01-01 。 |
AlertTemplateId | String | 是 | 1354766247190****** | 告警模版 ID。 |
ApplyObjects | Array of AlertNotification | 是 | - | 绑定的对象分组。 |
ProjectName | String | 是 | default | 生成告警策略所属项目。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
NotificationId | String | 否 | 189898***00 | 通知策略 ID。 注意 该参数的优先级比 |
AlertMethods | Array of String | 否 | Phone | 告警通知方式,取值:
|
Webhook | String | 否 | https://qyapi.weixin.qq.com/xxxx | 当AlertMethods 配置为Webhook 时,指定告警回调 Webhook 地址。 |
WebhookIds | Array of String | 否 | ["18913208***4528"] | 当 注意
|
ContactGroupIds | Array of String | 否 | 145080093687100**** | 当 |
ObjectGroupId | String | 是 | 1764547228734****** | 对象分组 ID。 |
EffectStartAt | String | 是 | 00:00 | 告警策略生效的开始时间,格式为HH:MM ,例如:00:00。 |
EffectEndAt | String | 是 | 23:59 | 告警策略生效的截止时间,格式为 说明
|
POST https://open.volcengineapi.com?Action=ApplyObjectGroupsByAlertTemplate&Version=2018-01-01 Content-Type: application/json { "AlertTemplateId": "1354766247190******", "ApplyObjects": [ { "ObjectGroupId": "1764547228734******", "Webhook": "https://qyapi.weixin.qq.com/xxxx", "WebhookIds": [ "18913208***4528" ], "AlertMethods": [ "Phone" ], "ContactGroupIds": [ "145080093687100****" ], "EffectStartAt": "00:00", "EffectEndAt": "23:59" } ], "ProjectName": "default" }
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Array of String | ["1354766247190******"] | 生成的告警策略 ID。 |
{ "ResponseMetadata": { "Action": "ApplyObjectGroupsByAlertTemplate", "Region": "cn-beijing", "Service": "Volc_Observe", "Version": "2018-01-01", "RequestId": "20230604110420****100232280022D31" }, "Result": { "Data": [ "1354766247190******" ] } }
本接口无特有的错误码。更多信息请参见 错误码。