Activates an IPv4 gateway.

Usage notes

  • The EnableVpcIpv4Gateway operation is asynchronous. After you send the request, the system returns RequestId. However, the operation is still being performed in the system background. You can call the GetIpv4GatewayAttribute operation to query the status of an IPv4 gateway:
    • If the IPv4 gateway is in the Activating state, the IPv4 gateway is being activated.
    • If the IPv4 gateway is in the Created state, the IPv4 gateway is activated.
  • You cannot repeatedly call the EnableVpcIpv4Gateway operation to activate an IPv4 gateway within the specified period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes EnableVpcIpv4Gateway

The operation that you want to perform. Set the value to EnableVpcIpv4Gateway.

Ipv4GatewayId String Yes ipv4gw-5tsp9lumsxoqizvq2****

The ID of the IPv4 gateway that you want to activate.

RegionId String Yes ap-southeast-6

The ID of the region where the IPv4 gateway is deployed.

You can call the DescribeRegions operation to query the most recent region list.

DryRun Boolean No false

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the API request. After the request passes the check, a 2xx HTTP status code is returned and the operation is performed.
ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The client token can contain only ASCII characters.

Note If you do not set this parameter, the system uses RequestId as ClientToken. RequestId may be different for each API request.
RouteTableList.N String No vtb-5ts0ohchwkp3dydt2****

The list of route tables. The system adds a 0.0.0.0/0 route that points to the IPv4 gateway to the route tables. The system supports at most 10 route tables.

Note The route table and the IPv4 gateway must belong to the same virtual private cloud (VPC).

Response parameters

Parameter Type Example Description
RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B45

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=EnableVpcIpv4Gateway
&Ipv4GatewayId=ipv4gw-5tsp9lumsxoqizvq2****
&RegionId=ap-southeast-6
&DryRun=false
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&RouteTableList=["vtb-5ts0ohchwkp3dydt2****"]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<EnableVpcIpv4GatewayResponse>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
</EnableVpcIpv4GatewayResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

Error codes

HttpCode Error code Error message Description
400 OperationDenied.DirectEipExist The operation is not allowed because of existing directEip. The error message returned because elastic IP addresses (EIPs) are associated with the VPC in cut-through mode or enhanced NAT gateways exist in the VPC.

For a list of error codes, visit the API Error Center.