QueryAlertRules - 查询告警规则

更新时间:
复制为 MD 格式

查询告警规则

接口说明

本文将提供一个示例,查询报警模板列表。返回结果显示,报警模板列表中共有 2 个报警模板,分别是ECS_Template1ECS_Template2

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

POST /queryAlertRules HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

nextToken

string

标记当前开始读取的位置,置空表示从头开始

123456

maxResults

integer

本次读取的最大数据记录数量

10

clientToken

string

幂等参数

xxxxx-xxxx-xxxx

body QueryAlertRulesInput

查询告警规则请求

返回参数

名称

类型

描述

示例值

ServerResponseQueryAlertRulesResult

查询告警规则响应

示例

正常返回示例

JSON格式

{
  "data": {
    "totalCount": 0,
    "alertRules": [
      {
        "uuid": "",
        "createdAt": "",
        "updatedAt": "",
        "status": "",
        "workspace": "",
        "displayName": "",
        "contentTemplate": "",
        "enabled": true,
        "datasourceConfig": {
          "type": "",
          "instanceId": "",
          "regionId": ""
        },
        "queryConfig": {
          "type": "",
          "promQl": "",
          "enableDataCompleteCheck": true,
          "metricSet": "",
          "metric": "",
          "entityDomain": "",
          "entityType": "",
          "entityFilters": [
            {
              "field": "",
              "operator": "",
              "value": ""
            }
          ],
          "labelFilters": [
            {
              "name": "",
              "value": "",
              "operator": ""
            }
          ],
          "entityFields": [
            {
              "field": "",
              "value": ""
            }
          ],
          "serviceIdList": [
            ""
          ],
          "filterList": [
            {
              "key": "",
              "type": "",
              "value": ""
            }
          ],
          "measureList": [
            {
              "measureCode": "",
              "windowSecs": 0,
              "groupBy": [
                ""
              ]
            }
          ]
        },
        "conditionConfig": {
          "type": "",
          "durationSecs": 0,
          "severity": "",
          "operator": "",
          "threshold": 0,
          "aggregate": "",
          "thresholdList": [
            {
              "severity": "",
              "threshold": 0
            }
          ],
          "compareList": [
            {
              "aggregate": "",
              "operator": "",
              "threshold": 0
            }
          ],
          "relation": ""
        },
        "scheduleConfig": {
          "type": "",
          "intervalSecs": 0
        },
        "notifyConfig": {
          "type": "",
          "channels": [
            {
              "type": "",
              "identifiers": [
                ""
              ]
            }
          ],
          "silenceTimeSecs": 0,
          "activeDays": [
            0
          ],
          "activeStartTime": "",
          "activeEndTime": "",
          "utcOffset": ""
        },
        "actionIntegrationConfig": {
          "enabled": true,
          "actions": [
            ""
          ]
        },
        "armsIntegrationConfig": {
          "enabled": true
        },
        "labels": {
          "key": ""
        },
        "annotations": {
          "key": ""
        }
      }
    ]
  },
  "code": "",
  "success": true,
  "requestId": "",
  "message": "",
  "total": 0,
  "pageSize": 0,
  "pageNumber": 0,
  "nextToken": ""
}

错误码

HTTP status code

错误码

错误信息

描述

400 IdempotentParameterMismatch The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.
400 InvalidParameter %s is missing or invalid. 参数%s缺失或不合法。
400 ParameterInvalid The parameter is missing or invalid. %s 参数缺失或者参数无效。
500 InternalUnknownError The request processing has failed due to some unknown error. 服务运行错误。
403 Forbidden You are not authorized to operate the specified resource. 没有权限,请使用RAM进行授权
404 ResourceNotFound The specified resource is not found. 未找到指定资源。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情