获取 RecordingRule 规则文件列表。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListRuleFiles | 接口名称。当前 API 的名称为 ListRuleFiles 。 |
Version | String | 是 | 2021-03-03 | 接口版本。当前 API 的版本为 2021-03-03 。 |
PageNumber | Long | 否 | 1 | 当前页数,最小值或默认值均为 1。 |
PageSize | Long | 否 | 10 | 单页数量:
|
Filter | Object of RuleFileFilter | 否 | - | 规则文件过滤条件。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Ids | Array of String | 否 | ["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"] | 按规则文件 id 过滤,精确查询 |
Name | String | 否 | test | 按规则文件名称过滤,模糊搜索 |
Status | Array of String | 否 | ["Running"] | 按规则文件状态过滤,精确查询 |
WorkspaceId | String | 是 | e28ae750-bbb8-4ff4-abf4-1e0e0f88808c | 按工作区 id 过滤,精确查询 |
POST https://open.volcengineapi.com/?Action=ListRuleFiles&Version=2021-03-03 Content-Type: application/json { "PageNumber": 1, "PageSize": 10, "Filter": { "Ids": [ "e28ae750-bbb8-4ff4-abf4-1e0e0f88808c" ], "Name": "test", "Status": [ "Running" ], "WorkspaceId": "e28ae750-bbb8-4ff4-abf4-1e0e0f88808c" } }
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Total | Long | 100 | 规则文件总数。 |
Items | Array of RuleFile | - | 规则文件列表。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Id | String | e28ae750-bbb8-4ff4-abf4-1e0e0f88808c | 规则文件 id |
Name | String | test | 规则文件名称: |
Status | String | Running | 规则文件状态,可选值: |
Content | String | {"groups": [{"name": "my_first_recording_rule", "rules": [{"expr": "up", "record": "up"}], "interval": "30s"}]} | 规则文件内容: |
RuleCount | Long | 2 | 规则文件中规则数 |
CreateTime | String | 2022-01-01T00:00:00Z | 规则文件创建时间 |
Description | String | 这是一段描述 | 规则文件描述信息: |
LastUpdateTime | String | 2022-01-01T00:00:00Z | 规则文件最近更新时间 |
HTTP/1.1: 200 OK Content-Type: application/json { "ResponseMetadata": { "RequestId": "20230604110420****100232280022D31", "Action": "ListRuleFiles", "Version": "2021-03-03", "Service": "vmp", "Region": "cn-north-1" }, "Result": { "Total": 100, "Items": [ { "Id": "e28ae750-bbb8-4ff4-abf4-1e0e0f88808c", "Name": "test", "Status": "Running", "RuleCount": 2, "CreateTime": "2022-01-01T00:00:00Z", "Description": "这是一段描述", "LastUpdateTime": "2022-01-01T00:00:00Z" } ] } }
本接口错误码如下表所示,公共错误码请参见 公共错误码。
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 服务。 |
404 | NotFound.Workspace | The specified Workspace {{id}} is not found. | 未找到相应 id 的工作区。 |