跳转到主要内容
告警与响应相关接口/告警规则

创建告警抑制规则

创建新抑制规则关联抑制中告警。

POST/api/v1/alerting/inhibition-rules

操作 ID

CreateAlertInhibitionRule

起始版本

1.0.0

执行模式

同步

认证信息

需要认证

认证信息

调用该 API 时需要在请求头中携带以下认证信息。

Authorizationstring必填

Bearer 令牌

X-Tenant-IDstring

X-Tenant-ID

请求参数

application/json

请求体字段

  • name
    String

    资源名称。

    示例: Suppress disk alerts when host down

  • description
    String

    资源的详细描述。

    示例: Suppress disk alerts when host is unreachable

  • sourceMatchers
    List

    源匹配器。

    • key
      String

      键。

      示例: severity

    • operator
      String

      比较运算符。

      示例: eq

    • value
      String

      字段值。

      示例: critical

  • targetMatchers
    List

    目标匹配器。

    • key
      String

      键。

      示例: severity

    • operator
      String

      比较运算符。

      示例: eq

    • value
      String

      字段值。

      示例: critical

  • equalLabelNames
    List

    等于标签名称。

响应状态

200 OK

请求成功。

Content-Type: application/json

响应体根类型: object

  • uuid
    String

    资源的UUID,唯一标识该资源。

    示例: inhib-001

  • name
    String

    资源名称。

    示例: Suppress disk alerts when host down

  • description
    String

    资源的详细描述。

    示例: Suppress disk alerts when host is unreachable

  • enabled
    Boolean

    是否启用。

    示例: true

  • createDate
    String

    规则创建时间戳。

    示例: 2026-01-15T08:00:00Z

    {"format":"date-time"}

  • lastOpDate
    String

    最近一次操作时间。

    示例: 2026-01-15T08:00:00Z

    {"format":"date-time"}

  • sourceMatchers
    List

    源匹配器。

    • key
      String

      键。

      示例: severity

    • operator
      String

      比较运算符。

      示例: eq

    • value
      String

      字段值。

      示例: critical

  • targetMatchers
    List

    目标匹配器。

    • key
      String

      键。

      示例: severity

    • operator
      String

      比较运算符。

      示例: eq

    • value
      String

      字段值。

      示例: critical

  • equalLabelNames
    List

    等于标签名称。

  • reason
    String

    原因说明。

    示例: value

  • createdBy
    String

    创建该记录的用户UUID。

    示例: value

  • lastModifiedBy
    String

    最后修改人。

    示例: value

  • version
    String

    版本号。

    示例: 10

    {"format":"int64"}

  • currentHitCount
    String

    当前被此抑制规则匹配的不同活跃目标告警主体数量。

    示例: 3

    {"format":"int64"}

  • sourceMatchersDisplay
    List

    按 Content-Language 显示的只读匹配条件,保留原始顺序和重复条件。

    {"readOnly":true}

    • key
      String

      匹配器中的原始告警标签键,例如 `rule_uuid` 或 `resource_type`;与本地化显示名称一并保留,原始键不变。

      示例: value

      {"readOnly":true}

    • operator
      String

      比较运算符。

      示例: value

      {"readOnly":true}

    • value
      String

      字段值。

      示例: value

      {"readOnly":true}

    • displayName
      String

      显示名称。用于界面展示。

      示例: value

      {"readOnly":true}

    • valueDisplayName
      String

      无法解析或无权访问时为空;regex/nregex 保留表达式。

      示例: value

      {"readOnly":true}

  • targetMatchersDisplay
    List

    按 Content-Language 显示的只读匹配条件,保留原始顺序和重复条件。

    {"readOnly":true}

    • key
      String

      匹配器中的原始告警标签键,例如 `rule_uuid` 或 `resource_type`;与本地化显示名称一并保留,原始键不变。

      示例: value

      {"readOnly":true}

    • operator
      String

      比较运算符。

      示例: value

      {"readOnly":true}

    • value
      String

      字段值。

      示例: value

      {"readOnly":true}

    • displayName
      String

      显示名称。用于界面展示。

      示例: value

      {"readOnly":true}

    • valueDisplayName
      String

      无法解析或无权访问时为空;regex/nregex 保留表达式。

      示例: value

      {"readOnly":true}

  • 变更时间

    新增请求体字段 enabled
    查看 API
  • 变更时间

    新增请求体字段 equalLabelNames, key, operator...已删除请求体字段 equalLabels, sourceMatch, targetMatch新增响应字段 createdBy, currentHitCount, displayName...已删除响应字段 equalLabels, sourceMatch, targetMatch
    查看 API