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

修改防火墙规则

最近更新时间2023.07.03 16:32:37

首次发布时间2022.02.25 18:58:31

本接口用于修改外网防火墙的出方向或入方向规则。

请求方法

POST

请求参数

下表列出了接口特定的请求参数以及公共请求参数 Action 和 Version。 其他公共参数,请参见公共参数

名称

类型

是否必选

示例值

描述

Action

String

ModifySecurityGroupRule

公共参数。该参数表示接口名称。取值:ModifySecurityGroupRule

Version

String

2021-04-30

公共参数。该参数表示接口版本。取值:2021-04-30。

group_identity

String

veew-sg-2551200256591525****

外网防火墙的 ID。您可以通过 DescribeSecurityGroups 接口查询外网防火墙的 ID。

rule_identity

String

veew-sgr-9151880512118522****

外网防火墙规则的 ID。您可以通过 DescribeSecurityGroupRules 接口查询规则的 ID。

policy

RuleParam

{
  "direction": "ingress",
  "ip_cidr": "0.0.0.0/0",
  "ports": "0",
  "protocol": "ICMP",
  "remark": ""
}

外网防火墙规则。

返回数据

名称

类型

示例值

描述

rule

SecurityGroupRule

请参见返回示例

规则详情。

请求示例

POST https://veenedge.volcengineapi.com/?Action=ModifySecurityGroupRule&Version=2021-04-30
&<其他公共参数>
{
  "group_identity": "veew-sg-9250505551518201****",
  "rule_identity": "veew-sgr-5931197925305709****",
  "policy": {
    "direction": "egress",
    "ip_cidr": "0.0.0.0/0",
    "ports": "0",
    "protocol": "ICMP",
    "remark": ""
  }
}

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202305191852120BB5F9EE93EA1F6C****",
        "Action": "ModifySecurityGroupRule",
        "Version": "2021-04-30",
        "Service": "veenedge",
        "Region": "cn-north-1"
    },
    "Result": {
        "rule": {
            "rule_identity": "veew-sgr-5931197925305709****",
            "direction": "egress",
            "rule": "reject",
            "protocol": "ICMP",
            "ports": "0",
            "ip_type": "ipv4",
            "ip_cidr": "0.0.0.0/0",
            "remark": "",
            "group_identity": "veew-sg-9250505551518201****",
            "status": 1,
            "create_time": 1684489815,
            "update_time": 1684493533
        }
    }
}

错误码

如果响应正文中包含 Error 字段,则表示 API 请求失败。关于错误码的更多信息,参见错误码