获取告警静默策略。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListSilencePolicies | 接口名称。当前 API 的名称为 ListSilencePolicies 。 |
Version | String | 是 | 2021-03-03 | 接口版本。当前 API 的版本为 2021-03-03 。 |
PageNumber | Long | 否 | 1 | 当前页数,最小值或默认值均为 1。 |
PageSize | Long | 否 | 10 | 单页数量,取值范围为 0~100,默认值为 10。 |
Filter | Object of SilencePolicyFilter | 否 | 过滤条件。 | |
SortBy | String | 否 | CreatedAt | 查询结果是否进行排序,取值CreatedAt 表示进行排序;不配置该字段表示不进行排序。 |
SortOrder | String | 否 | Asc | 查询结果的排序原则,取值:
|
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Ids | Array of String | 否 | ["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"] | 按 ID 过滤,精确查询。 |
Name | String | 否 | test | 按名称过滤,模糊查询。 |
Status | String | 否 | Disabled | 按状态过滤,取值:
|
Sources | Array of String | 否 | General | 按来源过滤。取值:
|
POST https://open.volcengineapi.com/?Action=ListSilencePolicies&Version=2021-03-03
Content-Type: application/json
{
"PageNumber": 1,
"PageSize": 10,
"Filter": {
"Ids": [
"e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"
],
"Name": "test",
"Status": "Disabled",
"Sources": [
"General"
]
},
"SortBy": "CreatedAt",
"SortOrder": "Asc"
}
json
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Total | Long | 100 | 查询结果总数。 |
Items | Array of SilencePolicy | - | 查询结果列表。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Id | String | e28ae750-bbb8-4ff4-abf4-1e0e0f88808c | 告警静默策略 ID。 |
Name | String | test | 告警静默策略名称。 |
Source | String | General | 告警静默策略来源。取值:
|
Status | String | Active | 告警静默策略状态。取值:
|
CreateTime | String | 2020-01-01T00:00:00Z | 告警静默策略的创建时间,RFC3339 格式。 |
UpdateTime | String | 2020-01-01T00:00:00Z | 告警静默策略的更新时间,RFC3339 格式。 |
Description | String | 这是一段描述 | 告警静默策略的描述信息。 |
LabelMatchers | Array of String | - | 告警静默策略中的匹配 Label。 |
AutoDeleteTime | String | 2020-01-01T00:00:00Z | 告警静默策略自动删除时间。 |
TimeRangeMatchers | Array of TimeRangeMatcher | - | 告警静默策略中的匹配时间。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Date | String | 2006-01-02 15:04~2006-01-03 14:04 | 告警静默的时间段。用于配置指定时间段内的告警静默。 |
Location | String | Asia/Shanghai | 时区。 |
PeriodicDate | Object of PeriodicDate | - | 告警静默的周期。用于配置周期生效的告警静默。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Time | String | 20:00~21:12 | 时间周期。 |
HTTP/1.1: 200 OK
Content-Type: application/json
{
"ResponseMetadata": {
"RequestId": "20230604110420****100232280022D31",
"Action": "ListSilencePolicies",
"Version": "2021-03-03",
"Service": "vmp",
"Region": "cn-north-1"
},
"Result": {
"Total": 100,
"Items": [
{
"Id": "e28ae750-bbb8-4ff4-abf4-1e0e0f88808c",
"Name": "test",
"Source": "General",
"Status": "Active",
"CreateTime": "2020-01-01T00:00:00Z",
"UpdateTime": "2020-01-01T00:00:00Z",
"Description": "这是一段描述",
"LabelMatchers": [
[
{
"Label": "app",
"Value": "test",
"Operator": "=~"
}
]
],
"AutoDeleteTime": "2020-01-01T00:00:00Z",
"TimeRangeMatchers": [
{
"Date": "2006-01-02 15:04~2006-01-03 14:04",
"Location": "Asia/Shanghai",
"PeriodicDate": {
"Time": "20:00~21:12",
}
}
]
}
]
}
}
json
本接口错误码如下表所示,公共错误码请参见 公共错误码。
HTTP 状态码 | 错误码 | 错误信息 | 说明 |
---|---|---|---|
400 | InvalidParameter.{{parameter}} | The specified parameter {{parameter}} is invalid. | 指定的参数无效。 |
400 | MissingParameter.{{parameter}} | The required parameter {{parameter}} is missing. | 缺少必要的参数。 |
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 服务。 |