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

GetRuleFile

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

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

查询 RecordingRule 规则文件详情。

请求说明

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

请求参数

参数名称类型是否必选示例值描述
ActionStringGetRuleFile公共参数,本接口值:GetRuleFile。
VersionString2021-03-03公共参数,本接口值:2021-03-03。
IdString1c3f6e48-b5e1-4832-8564-10eaac12a22c规则文件 ID。
WorkspaceIdStringe28ae750-bbb8-4ff4-abf4-1e0e0f88808c工作区 ID,必须和 Name 同时配置。
NameStringtest规则文件名称,必须和 WorkspaceId 同时配置。

说明

IdWorkspaceId + Name 不能同时配置,但至少需要选择一种:

  • 可以通过 Id直接指定需要查询的规则文件。
  • 可以通过 WorkspaceId + Name 在工作区内,通过名称指定需要查询的规则文件。

请求示例

POST /?Action=GetRuleFile&Version=2021-03-03
Content-Type:application/json
{
    "Id": "1c3f6e48-b5e1-4832-8564-10eaac12a22c"
}

返回参数

参数名称类型示例值描述
IdString1c3f6e48-b5e1-4832-8564-10eaac12a22c规则文件 ID。
CreateTimeString2022-01-01T00:00:00Z规则文件创建时间,RFC3339 格式。
LastUpdateTimeString2022-01-01T00:00:00Z规则文件最近更新时间,RFC3339 格式。
NameStringtest规则文件名称。
DescriptionString这是一段描述规则文件描述信息。

Content

string

groups:
- name: example
  rules:
    - record: test
      expr: up

规则文件内容。

Status

String

Running

规则文件状态:

  • Creating:创建中
  • Running:运行中
  • Updating:更新中
  • OverdueShutted:欠费关停
  • Resuming:恢复中
RuleCountInteger2规则文件中的规则数。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "GetRuleFile",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Id": " 1c3f6e48-b5e1-4832-8564-10eaac12a22c",
        "CreateTime": "2022-01-01T00:00:00Z",
        "LastUpdateTime": "2022-01-01T00:00:00Z",
        "Name": "test",
        "Description": "这是一段描述",
        "content": "groups:\n- name: example\n  rules:\n  - expr: up\n    record: test\n",
        "Status": "Running",
        "RuleCount": 2
    }
}

错误码

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

HTTP 状态码错误码错误信息描述
404NotFound.IdThe specified Workspace {{id}} is not found./ The specified RuleFile %s is not found.未找到指定的工作区/未找到指定规则文件。
404NotFound.NameThe specified RuleFile {{name}} is not found in Workspace {{workspaceID}}.在工作区内未找到指定的规则文件。