You need to enable JavaScript to run this app.
导航

获取告警策略列表

最近更新时间2024.05.09 10:29:47

首次发布时间2024.05.09 10:16:53

调用本接口获取所有已创建的告警策略。

使用说明

每个请求中必须包含鉴权信息。该鉴权信息用以验证请求者的身份。参见签名机制

使用限制

节流限制:您每秒最多可以提交 30 个 API 请求。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com/?Action=ListAlertStrategies&Version=2022-03-01

请求参数

Query

参数名称
数据类型
是否必选
参数说明
Action
String
接口名称。当前 API 的名称为 ListAlertStrategies
Version
String
接口版本。当前 API 的版本为 2022-03-01

Body

参数名称
数据类型
是否必选
参数说明
示例
Name
String
指定一个名称,查询与该名称模糊匹配的策略。
证书有效期
Status
String

指定一个状态,查询处于对应状态的策略。该参数有以下取值:

  • Enabled:运行中
  • Disabled:未启用
Enabled
Level
String

指定一个等级,查询具有对应告警等级的策略。该参数有以下取值:

  • info:通知
  • warning:警告
  • critical:严重
warning
Pagination
Object
对查询结果进行分页并返回特定页码上的策略。

返回参数

参数名称
数据类型
参数说明
示例
Data
Object[]
满足查询条件的告警策略列表。
Pagination
Object
分页信息。

请求示例

POST https://open.volcengineapi.com/?Action=ListAlertStrategies&Version=2022-03-01
{
    "Pagination": {
        "PageSize": 10,
        "PageNum": 1
    }
}

返回示例

{
    "ResponseMetadata": {
        "RequestID": "20240508150240183D509F0824C723AB97",
        "Action": "ListAlertStrategies",
        "Version": "2022-03-01",
        "Service": "mcdn",
        "Region": "cn-north-1"
    },
    "Result": {
        "Data": [
            {
                "Id": "296323438476230656",
                "Name": "证书有效期监控",
                "ResourceTypes": [
                    "CDN"
                ],
                "ResourceScope": "All",
                "TriggerType": "Threshold",
                "AlertRule": {
                    "Level": "warning",
                    "Logic": "Any",
                    "Conditions": [
                        {
                            "MetricId": "234264782419615744",
                            "Period": 1,
                            "ThresholdType": "Static",
                            "Operator": "<",
                            "Value": 90,
                            "Format": "Day"
                        }
                    ],
                    "Frequency": 1440,
                    "EnableStartTime": "00:00",
                    "EnableEndTime": "23:59"
                },
                "SubscribeRule": null,
                "Status": "Disabled"
            }
        ],
        "Pagination": {
            "PageSize": 10,
            "PageNum": 1,
            "Total": 1
        }
    }
}

错误码

如果响应正文的 ResponseMetadata 字段中包含 Error 字段,则表示 API 请求失败。关于更多错误码的信息,参见错误码