You need to enable JavaScript to run this app.
文档中心
私有网络

私有网络

复制全文
下载 pdf
IPv4网关实例
EnableIpv4Gateway-开启IPv4网关实例
复制全文
下载 pdf
EnableIpv4Gateway-开启IPv4网关实例
调用 EnableIpv4Gateway 接口,激活IPv4网关。​
使用说明​
  • 激活之前,请满足如下条件:​
  • IPv4网关已经关联VPC。​
  • 需要访问公网的子网关联的路由表已经添加了下一跳为IPv4网关的路由条目。​
  • 激活后,进出VPC的IPv4公网流量受IPv4网关限制。公网流量经过子网路由表。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:EnableIpv4Gateway​
接口名称。当前 API 的名称为EnableIpv4Gateway。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为 2020-04-01。​
​
Ipv4GatewayId String 必选 示例值:ipv4gw-bp1fgnh68xyz9****​
IPv4网关的ID。​
您可以调用 DescribeIpv4Gateways 接口,查询IPv4网关的ID。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求幂等性。​
  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 仅支持ASCII字符,且不能超过64个字符。​
  • 若不传入ClientToken,则此次API调用不进行幂等校验。​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:2021062415303301022514515207C4****​
请求ID。​
​
​
请求示例​
​
GET /?Action=EnableIpv4Gateway&Version=2020-04-01&Ipv4GatewayId=ipv4gw-bp1fgnh68xyz9**** HTTP/1.1​
Host: vpc.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/vpc/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "EnableIpv4Gateway",​
"Version": "2020-04-01",​
"Service": "vpc",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2021062415303301022514515207C4****"​
}​
}​
​
错误码​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InvalidIpv4Gateway.ConflictWithAnycastEip​
The specified IPv4 gateway conflicts with that of the VPC which contains anycast EIP.​
指定的IPv4网关与包含任播公网IP的VPC冲突。​
400​
InvalidIpv4Gateway.ConflictWithDirectEip​
The specified IPv4 gateway conflicts with that of the VPC which contains direct EIP.​
指定的IPv4网关与包含直通公网IP的VPC冲突。​
400​
InvalidIpv4Gateway.ConflictWithNat​
The specified IPv4 gateway conflicts with that of the VPC which contains NAT gateway.​
指定的IPv4网关与包含NAT网关的VPC冲突。​
400​
InvalidIpv4Gateway.ConflictWithUserCidr​
The specified IPv4 gateway conflicts with that of the VPC with user CIDR block configured.​
指定的IPv4网关与配置了用户网段的VPC冲突。​
400​
InvalidIpv4Gateway.Enable​
The specified IPv4 gateway is not in the correct status for the request. The specified IPv4 gateway is enabled.​
指定的IPv4网关所处状态无法响应该请求。指定的IPv4网关已启用。​
400​
InvalidIpv4Gateway.InvalidRoute​
The route entry for the next hop to the IPv4 gateway is missing.​
不存在下一跳到IPv4网关的路由条目。​
400​
InvalidIpv4Gateway.InvalidStatus​
The specified IPv4Gateway is not in the correct status for the request.​
指定的IPv4网关所处状态无法响应该请求。​
400​
InvalidIpv4Gateway.NotAttachVpc​
The specified IPv4 gateway is not in the correct status for the request. The specified IPv4 gateway is not attached to a VPC.​
指定的IPv4网关所处状态无法响应该请求。指定的IPv4网关没有关联VPC。​
400​
InvalidParameter.ClientTokenMalformed​
The specified parameter ClientToken is malformed.​
指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。​
400​
InvalidVpc.InvalidStatus​
The specified VPC is not in the correct status for the request.​
指定的VPC所处状态无法响应该请求。​
404​
InvalidIpv4Gateway.NotFound​
The specified Ipv4Gateway does not exist.​
指定的IPv4网关不存在。​
404​
InvalidVpc.NotFound​
The specified VPC does not exist.​
指定的VPC不存在。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
最近更新时间:2025.12.16 19:06:08
这个页面对您有帮助吗?
有用
有用
无用
无用