全部产品
Search
文档中心

专有网络 VPC:EnableVpcIpv4Gateway - 激活IPv4网关

更新时间:Aug 28, 2026

调用EnableVpcIpv4Gateway接口激活IPv4网关。

接口说明

  • EnableVpcIpv4Gateway 接口属于异步接口,即系统会先返回一个 RequestId,但该 IPv4 网关实例并未激活完成,系统后台的激活任务仍在进行。您可以调用 GetIpv4GatewayAttribute 查询 IPv4 网关实例的状态。

    • 当 IPv4 网关实例处于 Activating 状态时,表示正在激活中。

    • 当 IPv4 网关实例处于 Created 状态时,表示激活完成。

  • EnableVpcIpv4Gateway 接口不支持并发激活同一个 IPv4 网关。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

Ipv4GatewayId

string

是

要激活的 IPv4 网关的实例 ID。

ipv4gw-5tsp9lumsxoqizvq2****

RegionId

string

是

IPv4 网关所在地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

ap-southeast-6

DryRun

boolean

否

是否只预检此次请求。取值:

  • true:发送检查请求,不会激活 IPv4 网关。检查项包括是否填写了必需参数、请求格式、业务限制。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation。

  • false(默认值):发送正常请求,通过检查后返回 HTTP 2xx 状态码并直接激活 IPv4 网关。

false

ClientToken

string

否

客户端 Token,用于保证请求的幂等性。

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。

123e4567-e89b-12d3-a456-426655440000

RouteTableList

array

否

路由表列表。系统会为路由表列表中的路由表添加一条 0.0.0.0/0 指向 IPv4 网关的路由条目。

string

否

路由表列表。系统会为路由表列表中的路由表添加一条 0.0.0.0/0 指向 IPv4 网关的路由条目。系统支持的最大路由表数量为 10。

说明

路由表与 IPv4 网关需要属于同一个 VPC。

vtb-5ts0ohchwkp3dydt2****

RegionId

string

是

IPv4 网关所在地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

ap-southeast-6

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

54B48E3D-DF70-471B-AA93-08E683A1B45

错误码

HTTP status code

错误码

错误信息

描述

400 VPC_ROUTE_ENTRY_CIDR_BLOCK_DUPLICATE Specified CIDR block is already exists.
400 ResourceNotFound.Ipv4Gateway The specified resource ipv4Gateway is not found. 未找到指定的Ipv4网关,无法删除
400 IncorrectStatus.Ipv4Gateway The status of %s [%s] is incorrect. 指定的Ipv4Gateway处于非稳态,请稍后重试
400 OperationFailed.Ipv4GatewayAlreadyActive. The operation failed because of ipv4Gateway is already active.
400 OperationDenied.ConflictOfAllZeroRouting The operation is not allowed because of routetable [%s] exist all-zero route entry.
400 UnsupportedFeature.Ipv4Gateway The feature of ipv4Gateway is not supported for [%s]. 创建ipv4网关失败,因为不支持ipv4网关特性
400 OperationDenied.VpnExist The operation is not allowed because of existing vpn. 不允许新建IPv4网关,因为VPC已经存在VPN网关
400 OperationDenied.NatgatewayExist The operation is not allowed because of existing nat.
400 OperationDenied.DirectEipExist The operation is not allowed because of existing directEip. 操作不允许,该VPC下存在直通EIP或增强型NAT网关
400 OperationDenied.VpcHasAlreadyActive The operation is not allowed because of vpc has already been active.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。