最近更新时间:2024.04.19 11:53:55
首次发布时间:2023.06.30 15:23:34
获取告警样本列表。
参数名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListAlertSamples | 公共参数,本接口值:ListAlertSamples。 |
Version | String | 是 | 2021-03-03 | 公共参数,本接口值:2021-03-03。 |
Limit | Integer | 否 | 100 | 告警记录序列样本个数限制,默认值 100,最大值 500。 |
Filter | Object AlertSampleFilter | 否 | - | 告警样本过滤。 |
参数名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
AlertId | String | 是 | 173ee193-0aa6-4dd9-9074-9808c0f758cd | 按告警样本 ID 过滤。 |
SampleSince | Integer | 否 | 1600885800 | 按告警开始时间过滤。 |
SampleUntil | Integer | 是 | 1600885800 | 按告警结束时间过滤。 |
POST /?Action=ListAlertSamples&Version=2021-03-03 Content-Type:application/json { "Limit": 100, "Filter": { "AlertId": "173ee193-0aa6-4dd9-9074-9808c0f758cd", "SampleSince": 1600885800, "SampleUntil": 1600885800 } }
参数名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Total | Integer | 100 | 告警样本总数。 |
Items | Array of AlertSample | - | 告警样本列表。 |
参数名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
AlertId | String | 173ee193-0aa6-4dd9-9074-9808c0f758cd | 告警样本 ID。 |
Timestamp | Integer | 1686232540 | 告警样本时间戳,unix_timestamp 类型。 |
Phase | String | Active | 告警样本状态,取值:
|
Level | String | P0 | 告警样本等级,包括:P0、P1 和 P2。 |
Value | float64 | 123.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 状态码 | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter.{{parameter}} | The specified {{parameter}} is invalid. | 参数不合法,请检查参数正确性后重试。 |
403 | ProductUnsubscribed | You 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 服务。 |