修改告警规则

最近更新时间:2025-09-23 00:18:23

我的收藏

1. 接口描述

接口请求域名: wedata.tencentcloudapi.com 。

修改告警规则

默认接口请求频率限制:20次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:UpdateOpsAlarmRule。
Version String 公共参数,本接口取值:2025-08-06。
Region String 公共参数,详见产品支持的 地域列表
ProjectId String 项目id
示例值:147****264
AlarmRuleId String 告警规则唯一id,通过接口GetAlarmRule/ListAlarmRule获取
示例值:c7692a59****e3e
AlarmRuleName String 告警规则新的规则名称
示例值:ruleNameRename
MonitorObjectType Integer 监控对象类型,
任务维度监控: 可按照任务/工作流/项目来配置:1.任务、2.工作流、3.项目(默认为1.任务)
项目维度监控: 项目整体任务波动告警, 7:项目波动监控告警
示例值:1
MonitorObjectIds.N Array of String 根据MonitorType 的设置传入不同的业务id,如下1(任务): MonitorObjectIds为任务id列表2(工作流): MonitorObjectIds 为工作流id列表(工作流id可从接口ListWorkflows获取)3(项目): MonitorObjectIds为项目id列表
示例值:["2323**32465"]
AlarmTypes.N Array of String 告警规则监控类型 failure:失败告警 ;overtime:超时告警 success:成功告警; backTrackingOrRerunSuccess: 补录重跑成功告警 backTrackingOrRerunFailure:补录重跑失败告警; 项目波动告警 projectFailureInstanceUpwardFluctuationAlarm: 当天失败实例数向上波动率超过阀值告警; projectFailureInstanceUpwardVolatilityAlarm:当天失败实例数向上波动量超过阀值告警 projectSuccessInstanceDownwardFluctuationAlarm:当天成功实例数向下波动率超过阀值告警; projectSuccessInstanceDownwardVolatilityAlarm: 当天成功实例数向下波动量超过阀值告警 projectFailureInstanceCountAlarm: 当天失败实例数超过阀值告警 projectFailureInstanceProportionAlarm: 当天失败实例数占比超过阀值告警 离线集成任务对账告警: reconciliationFailure: 离线对账任务失败告警 reconciliationOvertime: 离线对账任务运行超时告警 reconciliationMismatch: 数据对账任务不一致条数超过阀值告警
示例值:["failure"]
AlarmRuleDetail AlarmRuleDetail 告警规则配置信息 成功告警无需配置;失败告警可以配置首次失败告警或者所有重试失败告警;超时配置需要配置超时类型及超时阀值;项目波动告警需要配置波动率及防抖周期配置
Status Integer 告警规则的启用状态0--禁用1--启用
示例值:0
AlarmLevel Integer 告警级别 1.普通、2.重要、3.紧急
示例值:1
AlarmGroups.N Array of AlarmGroup 告警接收人配置信息
Description String 告警描述信息
示例值:this is your description

3. 输出参数

参数名称 类型 描述
Data ModifyAlarmRuleResult 更新结果是否成功
true: 更新成功 false:更新失败/未更新
RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 UpdateOpsAlarmRule

输入示例

POST / HTTP/1.1
Host: wedata.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: UpdateOpsAlarmRule
<公共请求参数>

{
    "ProjectId": "1460947878944567296",
    "AlarmRuleId": "01b38b0a-6102-4b96-ac61-cfabb7f22552",
    "AlarmRuleName": "dddd22xxss",
    "MonitorObjectType": 2,
    "MonitorObjectIds": [
        "832b83ea-d285-43bd-b4bb-5a268aa8cb50"
    ],
    "AlarmTypes": [
        "failure"
    ],
    "AlarmRuleDetail": {
        "Trigger": 2,
        "DataBackfillOrRerunTrigger": 1,
        "TimeOutExtInfo": [
            {
                "RuleType": 1,
                "Type": 1
            }
        ],
        "DataBackfillOrRerunTimeOutExtInfo": [
            {
                "RuleType": 1,
                "Type": 1
            }
        ],
        "ProjectInstanceStatisticsAlarmInfoList": [
            {
                "AlarmType": "projectSuccessInstanceDownwardFluctuationAlarm",
                "InstanceThresholdCountPercent": 1,
                "InstanceThresholdCount": 2,
                "StabilizeThreshold": 3,
                "StabilizeStatisticsCycle": 4,
                "IsCumulant": true
            }
        ],
        "ReconciliationExtInfo": [
            {
                "RuleType": "reconciliationMismatch",
                "MismatchCount": 100,
                "Hour": 100,
                "Min": 1
            }
        ]
    },
    "Status": 1,
    "AlarmLevel": 3,
    "AlarmGroups": [
        {
            "AlarmEscalationRecipientIds": [],
            "AlarmEscalationInterval": 0,
            "NotificationFatigue": {
                "NotifyCount": 1,
                "NotifyInterval": 5,
                "QuietIntervals": [
                    {
                        "DaysOfWeek": [
                            1
                        ],
                        "StartTime": "12:00:00",
                        "EndTime": "15:00:00"
                    }
                ]
            },
            "AlarmWays": [
                "1"
            ],
            "WebHooks": [
                {
                    "AlarmWay": "7",
                    "WebHooks": [
                        "xxb"
                    ]
                }
            ],
            "AlarmRecipientType": 3,
            "AlarmRecipientIds": [
                "158"
            ]
        }
    ],
    "Description": "this is your description"
}

输出示例

{
    "Response": {
        "Data": {
            "Status": true
        },
        "RequestId": "a821688d-110f-49ae-8d79-818cbc2ec0cd"
    }
}

5. 开发者资源

腾讯云 API 平台

腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

API Inspector

用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
FailedOperation 操作失败。
InvalidParameter.MissingRequestParameter Missing Servlet Request Parameter
InvalidParameterValue.RuleNameRepeated 告警规则名称重复
InvalidParameterValue.ValidationError Param Validation Error