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

UpdateRuleFile

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

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

更新 RecordingRule 规则文件。

请求说明

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

请求参数

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

Content

String

groups:
- name: example
  interval:60s
  rules:
    - record: <string>
      expr: <string>
      labels:
        [ <labelname>: <labelvalue> ]

规则文件内容。

说明

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

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

请求示例

POST /?Action=UpdateRuleFile&Version=2021-03-03
Content-Type:application/json
{
    "Id": "1c3f6e48-b5e1-4832-8564-10eaac12a22c",
    "Description": "这是一段描述",
    "Content": "xxxxxxxx"
}

返回参数

参数名称类型示例值描述
IdString1c3f6e48-b5e1-4832-8564-10eaac12a22c规则文件 ID。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "UpdateRuleFile",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Id": " 1c3f6e48-b5e1-4832-8564-10eaac12a22c"
    }
}

错误码

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

HTTP 状态码错误码错误信息描述
400QuotaExceeded.RuleGroupCountRule Group count has exceeded the quota.创建 RuleFile 个数达到上限。产品限制说明,请参见 使用限制

403

OperationDenied.Update

Operation is denied because RuleFile cannot be updated in Workspace`s current status.

当前工作区状态下无法更新规则文件。

404NotFound.IdThe specified RuleFile %s is not found./The specified Workspace {{id}} is not found.未找到指定规则文件/未找到指定的工作区。
404NotFound.NameThe specified RuleFile {{name}} is not found in Workspace {{workspaceID}}.在工作区内未找到制定的规则文件。