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

ListAlertSamples

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

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

获取告警样本列表。

请求说明

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

请求参数

参数名称类型是否必选示例值描述
ActionStringListAlertSamples公共参数,本接口值:ListAlertSamples。
VersionString2021-03-03公共参数,本接口值:2021-03-03。
LimitInteger100告警记录序列样本个数限制,默认值 100,最大值 500。
FilterObject AlertSampleFilter-告警样本过滤。

AlertSampleFilter

参数名称类型是否必选示例值描述
AlertIdString173ee193-0aa6-4dd9-9074-9808c0f758cd按告警样本 ID 过滤。
SampleSinceInteger1600885800按告警开始时间过滤。
SampleUntilInteger1600885800按告警结束时间过滤。

请求示例

POST /?Action=ListAlertSamples&Version=2021-03-03
Content-Type:application/json
{
    "Limit": 100,
    "Filter": {
        "AlertId": "173ee193-0aa6-4dd9-9074-9808c0f758cd",
        "SampleSince": 1600885800,
        "SampleUntil": 1600885800
    }
}

返回参数

参数名称类型示例值描述
TotalInteger100告警样本总数。
ItemsArray of AlertSample-告警样本列表。

AlertSample

参数名称类型示例值描述
AlertIdString173ee193-0aa6-4dd9-9074-9808c0f758cd告警样本 ID。
TimestampInteger1686232540告警样本时间戳,unix_timestamp 类型。

Phase

String

Active

告警样本状态,取值:

  • Pending:达到告警阈值但未满告警持续时间
  • Active:告警中
  • Resolved:自然解除
  • Disabled:人工解除
LevelStringP0告警样本等级,包括:P0、P1 和 P2。
Valuefloat64123.123告警规则的 PromQL 语句下查询到的当前值。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "ListAlertSamples",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Total": 100,
        "Items": [
            {
                "AlertId": "173ee193-0aa6-4dd9-9074-9808c0f758cd",
                "Timestamp": 1686232540,
                "Phase": "Active",
                "Level": "P0",
                "Value": 123.123
            }
        ]
    }
}

错误码

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

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 服务。