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

绑定对象分组和通知策略至告警模版。

请求说明

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

调试

请求参数

参数类型是否必选示例值描述
ActionStringApplyObjectGroupsByAlertTemplate接口名称。当前 API 的名称为 ApplyObjectGroupsByAlertTemplate
VersionString2018-01-01接口版本。当前 API 的版本为 2018-01-01
AlertTemplateIdString1354766247190******告警模版 ID。
ApplyObjectsArray of AlertNotification-绑定的对象分组。
ProjectNameStringdefault生成告警策略所属项目。

AlertNotification

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

NotificationId

String

189898***00

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

注意

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

AlertMethods

Array of String

Phone

告警通知方式,取值:

  • Email:使用邮箱接收告警通知。
  • Phone:使用电话接收告警通知。
  • SMS:使用短信接收告警通知。
  • Webhook:使用 Webhook 接收告警通知。
WebhookStringhttps://qyapi.weixin.qq.com/xxxxAlertMethods配置为Webhook时,指定告警回调 Webhook 地址。

WebhookIds

Array of String

["18913208***4528"]

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

注意

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

ContactGroupIds

Array of String

145080093687100****

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

ObjectGroupIdString1764547228734******对象分组 ID。
EffectStartAtString00:00告警策略生效的开始时间,格式为HH:MM,例如:00:00。

EffectEndAt

String

23:59

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

说明

EffectEndAt时间必须晚于EffectStartAt时间。

请求示例

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"
}

返回参数

参数类型示例值描述
DataArray of String["1354766247190******"]生成的告警策略 ID。

返回示例

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

错误码

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