You need to enable JavaScript to run this app.
导航
CreateAlarmRule - 创建告警策略
最近更新时间:2025.05.13 16:50:39首次发布时间:2022.12.27 10:18:24
我的收藏
有用
有用
无用
无用

创建告警策略

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

CreateAlarmRule

要执行的操作,取值:CreateAlarmRule。

Version
String

2022-07-01

API的版本,取值:2022-07-01。

ProviderCode
String

iam

服务方code

QuotaCode
String

policy

配额code

Description
String

配额描述

配额描述

Dimensions
Array of Object

[{"Name":"region_code","Value":""}]

配额维度

RuleName
String

rule1

告警策略名

AlarmType
String

usage

告警类型

Threshold
String

100

告警阈值

MetricUnit
String

Count

阈值类型

SilenceTime
Integer

60

静默时间

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
RuleID
String

1913591797129412608

规则ID

请求示例

http://open.volcengineapi.com/?Version=2022-07-01&Action=CreateAlarmRule
&ProviderCode=platformServices
&QuotaCode=quota_alarm
&RuleName=策略名
&Statistics=avg
&AlarmType=usage
&Threshold=35
&MetricUnit=Count
&SilenceTime=60
&ProductName=服务名
&QuotaType=normal
&Descripon=策略描述
&Dimensions=[{"Name":"region_code","Value":"quota-test"}]
&EnableState=enable

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20221222112731819ED9E34DA83CBE7676"
    },
    "Result": {
        "RuleID": "1605766959574548480"
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
RoleNotExist

the role is not exist. role:%v

该角色不存在

400
InvalidParameter

The parameter %v[%v] is invalid.

无效参数

400
InvalidRuleName

The rule name '%s' is invalid

配额告警规则名称不合法

400
AlarmRuleNameDuplicate

The rule name of alarm is duplicate. ProviderCode: '%s', QuotaCode: '%s', RuleName: '%s'

配额告警规则名称重复

400
QuotaAlarmNotSupport

The quota alarm is not support because this quota's usage is not reported. ProviderCode: '%s', QuotaCode: '%s'

此配额项不支持创建配额告警

400
QuotaAlarmLimitExceeded

The number of alarm exceed limit. ProviderCode: '%s', QuotaCode: '%s'

配额告警数超出限制

500
ServiceFailure

The request processing has failed because of an unknown error.

服务错误