更新告警抑制规则 - UpdateInhibitRule
功能介绍
该接口用于更新告警抑制规则。
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,需具备如下身份策略权限。
授权项
访问级别
资源类型(*为必须)
条件键
别名
依赖的授权项
aom:inhibitRule:update
Write
-
-
-
-
URI
PUT /v2/{project_id}/alert/inhibit-rules
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | 项目ID,可以从控制台获取,也可以从调用API处获取。获取方式请参见:获取项目ID。 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 从IAM服务获取的用户Token。 |
Content-Type | 是 | String | 指定类型为application/json。 |
Enterprise-Project-Id | 否 | String | 企业项目id。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
name | 是 | String | 告警抑制规则的名称。名称不可修改。 只能由大小写字母、数字、下划线组成,且不能以下划线开头和结尾,最多不能超过100个字符。 |
desc | 否 | String | 告警抑制规则描述。规则描述长度最大 1024 |
match_v3 | 否 | InhibitMatchV3Tag object | 告警抑制规则编排详情。(如果更新新版告警抑制规则(支持编排能力),该参数必填。否则,该参数为空。) |
binding_group_rule | 否 | String | 告警抑制规则绑定的告警分组规则名称。(如果更新新版告警抑制规则(支持编排能力),该参数可填可不填。否则,该参数为空。) |
source_match | 否 | Array<Array<InhibitMatchTag>> | 根源告警。(如果更新新版告警抑制规则(支持编排能力),该参数为空。否则,该参数必填。) 根源告警最多可设置10个并行条件,每个并行条件下最多可设置10个串行条件。 |
target_match | 否 | Array<Array<InhibitMatchTag>> | 抑制告警。(如果更新新版告警抑制规则(支持编排能力),该参数为空。否则,该参数必填。) 抑制告警最多可设置10个并行条件,每个并行条件下最多可设置10个串行条件。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
nodes | 是 | Array of InhibitRuleNode objects | 节点详情列表。 |
edges | 是 | Array of Edge objects | 边详情列表。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
id | 是 | String | 节点id。命名规范为:flow-“8位随机字符串”。 随机字符串只能由字母、数字、下划线和中划线组成。 例如:flow-M3pfK020 |
type | 是 | String | 节点类型。 Start:开始节点。 End:结束节点。 Card:卡片节点。 |
businessType | 否 | String | 卡片类型。(当type为Card时,该参数必填) |
value | 否 | InhibitConditionSubNode object | 告警抑制规则节点详情。(当type为Card时,该参数必填) |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
nodes | 否 | Array of InhibitConditionSubNode objects | 子节点列表。 |
id | 是 | String | 节点id。命名规范为:{businessType}-“8位随机字符串”。 随机字符串只能由字母、数字、下划线和中划线组成 例如:InhibitSourceCondition-M3pfK020 |
type | 是 | String | 节点类型: |
value | 否 | String | 节点之间关系: |
match | 否 | InhibitMatchTag object | 匹配条件列表。 |
响应参数
状态码:204
No Content 表示请求成功,但没有内容返回。
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 参数解释: 非法请求错误码。 取值范围: 不涉及。 |
error_msg | String | 参数解释: 错误信息。 取值范围: 不涉及。 |
error_type | String | 参数解释: 错误类型。 取值范围: 不涉及。 |
trace_id | String | 参数解释: 请求id。 取值范围: 不涉及。 |
状态码:403
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 参数解释: 非法请求错误码。 取值范围: 不涉及。 |
error_msg | String | 参数解释: 错误信息。 取值范围: 不涉及。 |
error_type | String | 参数解释: 错误类型。 取值范围: 不涉及。 |
trace_id | String | 参数解释: 请求id。 取值范围: 不涉及。 |
请求示例
-
https://{Endpoint}/v2/{project_id}/alert/inhibit-rules { "desc" : "·123", "match_v3" : { "edges" : [ { "id" : "edge-M3pfK202", "source" : "flow-VHSvKyYY", "target" : "flow-ufs5Zsn3" }, { "id" : "edge-OrwQoSVg", "source" : "flow-ufs5Zsn3", "target" : "flow-eAheOiH5", "value" : "true" }, { "id" : "edge-ukREdGnr", "source" : "flow-ufs5Zsn3", "target" : "flow-f6P36v4a", "value" : "false" } ], "nodes" : [ { "id" : "flow-VHSvKyYY", "type" : "Start" }, { "businessType" : "InhibitSourceCondition", "id" : "flow-ufs5Zsn3", "type" : "Card", "value" : { "id" : "InhibitSourceCondition-wtJBNJD7", "nodes" : [ { "id" : "InhibitSourceCondition-awPpHgHv", "match" : { "key" : "resource_type", "operate" : "EQUALS", "value" : [ "service" ] }, "type" : "text" }, { "id" : "InhibitSourceCondition-DmfXe2vN", "match" : { "key" : "resource_type", "operate" : "EQUALS", "value" : [ "service" ] }, "type" : "text" }, { "id" : "InhibitSourceCondition-0fnYAVWg", "nodes" : [ { "id" : "InhibitSourceCondition-Xn7CUof5", "match" : { "key" : "event_severity", "operate" : "EQUALS", "value" : [ "Critical" ] }, "type" : "text" } ], "type" : "bool", "value" : "and" }, { "id" : "InhibitSourceCondition-juUOsA2L", "match" : { "key" : "resource_provider", "operate" : "EQUALS", "value" : [ "1" ] }, "type" : "text" }, { "id" : "InhibitSourceCondition-JvtIwdL6", "match" : { "key" : "1", "operate" : "EQUALS", "value" : [ "1" ] }, "type" : "text" } ], "type" : "bool", "value" : "and" } }, { "businessType" : "InhibitTargetCondition", "id" : "flow-eAheOiH5", "type" : "Card", "value" : { "id" : "InhibitSourceCondition--foPmJou", "nodes" : [ { "id" : "InhibitSourceCondition--m9jJEAN", "match" : { "key" : "resource_type", "operate" : "EQUALS", "value" : [ "service" ] }, "type" : "text" }, { "id" : "InhibitSourceCondition-MmTv1BZ5", "match" : { "key" : "resource_provider", "operate" : "EQUALS", "value" : [ "1" ] }, "type" : "text" }, { "id" : "InhibitSourceCondition-7oz9ddLB", "nodes" : [ { "id" : "InhibitSourceCondition-oM73YTRG", "match" : { "key" : "2", "operate" : "EQUALS", "value" : [ "2" ] }, "type" : "text" } ], "type" : "bool", "value" : "and" } ], "type" : "bool", "value" : "and" } }, { "id" : "flow-f6P36v4a", "type" : "End" } ] }, "name" : "123" } -
https://{Endpoint}/v2/{project_id}/alert/inhibit-rules { "desc" : "", "name" : "test", "source_match" : [ [ { "key" : "event_severity", "operate" : "EQUALS", "value" : [ "Critical" ] } ] ], "target_match" : [ [ { "key" : "event_severity", "operate" : "EQUALS", "value" : [ "Info" ] } ] ] }
响应示例
状态码:400
BadRequest 非法请求。建议直接修改该请求,不要重试该请求。
{
"error_code" : "AOM.08007001",
"error_msg" : "The inhibitRule is not exist",
"trace_id" : ""
} 状态码:403
Forbidden 请求被拒绝访问。返回该状态码,表明请求能够到达服务端,且服务端能够理解用户请求,但是拒绝做更多的事情,因为该请求被设置为拒绝访问,建议直接修改该请求,不要重试该请求。
{
"error_code" : "AOM.0403",
"error_msg" : "auth failed.",
"error_type" : "AUTH_FAILED",
"trace_id" : null
} 状态码
状态码 | 描述 |
|---|---|
204 | No Content 表示请求成功,但没有内容返回。 |
400 | BadRequest 非法请求。建议直接修改该请求,不要重试该请求。 |
403 | Forbidden 请求被拒绝访问。返回该状态码,表明请求能够到达服务端,且服务端能够理解用户请求,但是拒绝做更多的事情,因为该请求被设置为拒绝访问,建议直接修改该请求,不要重试该请求。 |
错误码
请参见错误码。

