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

导入告警规则

JSON打包冲突分辨率。

POST/api/v1/alerting/rules/import

操作 ID

ImportAlertRules

起始版本

1.0.0

执行模式

同步

认证信息

需要认证

认证信息

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

Authorizationstring必填

Bearer 令牌

X-Tenant-IDstring

X-Tenant-ID

请求参数

application/json

请求体字段

  • tenantId
    String必填

    租户ID。

    示例: tenant-001

  • jsonContent
    String必填

    JSON内容。

    示例: {...}

  • conflictAction
    String必填

    冲突处理方式。

    示例: skip

响应状态

200 OK
200 OK

该 API 成功时返回以下响应结构。

  • total
    Integer

    返回结果总数。

    示例: 10

  • created
    Integer

    数量规则成功已创建。

    示例: 7

  • updated
    Integer

    数量规则已更新覆盖。

    示例: 2

  • skipped
    Integer

    数量规则已跳过由于冲突。

    示例: 20

  • renamed
    Integer

    重命名数量。

    示例: 1

  • failed
    Integer

    失败数量。

    示例: 20

  • items
    List

    条目列表。

    示例: (nested array)

    • ruleName
      String

      规则名称。

      示例: High CPU Usage

    • status
      String

      状态信息。

      示例: created

    • error
      String

      错误码。操作成功时为 null,失败时返回具体错误信息。

      示例: connection refused