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

ListNotifyGroupPolicies

最近更新时间2024.04.19 11:53:55

首次发布时间2023.06.30 15:23:34

获取告警聚合策略列表。

请求说明

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

请求参数

参数名称类型是否必选示例值描述
ActionStringListNotifyGroupPolicies公共参数,本接口值:ListNotifyGroupPolicies。
VersionString2021-03-03公共参数,本接口值:2021-03-03。
PageNumberInteger1当前页数,最小值或默认值均为 1。

PageSize

Integer

10

单页数量:

  • 取值范围为 0~100。
  • 默认值为 10。
FilterObject NotifyGroupPolicyFilter-告警聚合策略过滤条件。

NotifyGroupPolicyFilter

参数名称类型是否必选示例值描述
IdsArray of String["ce4d942a-bac3-4ef6-b3a0-b7845b3b53bf"]按告警聚合策略 ID 过滤,精确查询。
NameStringtest按告警聚合策略名称过滤,模糊查询。

请求示例

POST /?Action=ListNotifyGroupPolicies&Version=2021-03-03
Content-Type:application/json
{
    "PageNumber": 1,
    "PageSize": 10,
    "Filter": {
        "Ids": ["ce4d942a-bac3-4ef6-b3a0-b7845b3b53bf"],
        "Name": "test"
    }
}

返回参数

参数名称类型示例值描述
TotalInteger100告警聚合策略总数。
ItemsArray of NotifyGroupPolicy告警聚合策略列表。

NotifyGroupPolicy

参数名称类型示例值描述
IdStringce4d942a-bac3-4ef6-b3a0-b7845b3b53bf告警聚合策略 ID。
CreateTimeString2020-01-01T00:00:00Z告警聚合策略创建时间,RFC3339 格式。
NameStringtest告警聚合策略名称。
DescriptionString这是一段描述告警聚合策略描述信息。
LevelsArray of NotifyGroupPolicyLevel告警聚合策略等级。

NotifyGroupPolicyLevel

参数名称类型示例值描述
LevelStringP0告警聚合策略等级,包括:P0、P1 和 P2。
GroupByArray of String["__rule__"]聚合维度,可选值为__rule__。
GroupWaitString30等待时间。正整数形式,单位为 s。
GroupIntervalString30聚合周期。正整数形式,单位为 s。
RepeatIntervalString30通知周期。正整数形式,单位为 s。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "ListNotifyGroupPolicies",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Total": 1,
        "Items": [
            {
                "Id": "ce4d942a-bac3-4ef6-b3a0-b7845b3b53bf",
                "CreateTime": "2020-01-01T00:00:00Z",
                "Name": " test",
                "Description": "这是一段描述",
                "Levels": [
                    {
                        "Level": "P0",
                        "GroupBy": ["__rule__"],
                        "GroupWait": "30",
                        "GroupInterval": "30",
                        "RepeatInterval": "30"
                    },
                    {
                        "Level": "P1",
                        "GroupBy": ["__rule__"],
                        "GroupWait": "60",
                        "GroupInterval": "180",
                        "RepeatInterval": "7200"
                    },
                    {
                        "Level": "P2",
                        "GroupBy": ["__rule__"],
                        "GroupWait": "60",
                        "GroupInterval": "300",
                        "RepeatInterval": "14400"
                    }
                ]
            }
        ]
    }
}

错误码

本接口错误码如下表所示,公共错误码请参见 公共错误码

HTTP 状态码错误码错误信息描述
400InvalidParameter.{{parameter}}The specified {{parameter}} is invalid.参数不合法,请检查参数正确性后重试。
403ProductUnsubscribedYou are not subscribed to the Volcengine Managed Service for Prometheus (VMP). Please go to the VMP console web page to subscribe to the service当前账号未订阅 VMP 服务。