All Products
Search
Document Center

:CreateIpv4Gateway

最終更新日:Aug 21, 2023

Creates an IPv4 gateway.

Usage notes

  • CreateIpv4Gateway is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the GetIpv4GatewayAttribute operation to query the status of the task:
    • If the IPv4 gateway is in the Creating state, the IPv4 gateway is being created.
    • If the IPv4 gateway is in the Created state, the IPv4 gateway is created.
  • You cannot repeatedly call the CreateIpv4Gateway operation to create IPv4 gateways in a virtual private cloud (VPC) 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 CreateIpv4Gateway

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

Ipv4GatewayName String No ipv4

The name of the IPv4 gateway.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

Ipv4GatewayDescription String No test

The description of the IPv4 gateway.

The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

VpcId String Yes vpc-5tss06uvoyps5xoya****

The ID of the VPC where you want to create the IPv4 gateway.

You can create only one IPv4 gateway in a VPC.

DryRun Boolean No false

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, 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 token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
RegionId String Yes ap-southeast-6

The ID of the region where you want to create the IPv4 gateway.

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

ResourceGroupId String No rg-acfmxazb4ph6aiy****

The ID of the resource group.

Tag.N.Key String No FinanceDept

The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string.

The tag key can be at most 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Tag.N.Value String No FinanceJoshua

The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

Response parameters

Parameter Type Example Description
Ipv4GatewayId String ipv4gw-5tsnc6s4ogsedtp3k****

The ID of the IPv4 gateway.

ResourceGroupId String rg-acfmxazb4ph6aiy****

The ID of the resource group.

RequestId String F282742B-1BBB-5F63-A3AF-E92EC575A1A6

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateIpv4Gateway
&Ipv4GatewayName=ipv4
&Ipv4GatewayDescription=test
&VpcId=vpc-5tss06uvoyps5xoya****
&DryRun=false
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&RegionId=ap-southeast-6
&ResourceGroupId=rg-acfmxazb4ph6aiy****
&Tag=[{"Key":"FinanceDept","Value":"FinanceJoshua"}]
&Common request parameters

Sample success responses

XML format

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

<CreateIpv4GatewayResponse>
    <Ipv4GatewayId>ipv4gw-5tsnc6s4ogsedtp3k****</Ipv4GatewayId>
    <ResourceGroupId>rg-acfmxazb4ph6aiy****</ResourceGroupId>
    <RequestId>F282742B-1BBB-5F63-A3AF-E92EC575A1A6</RequestId>
</CreateIpv4GatewayResponse>

JSON format

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

{
  "Ipv4GatewayId" : "ipv4gw-5tsnc6s4ogsedtp3k****",
  "ResourceGroupId" : "rg-acfmxazb4ph6aiy****",
  "RequestId" : "F282742B-1BBB-5F63-A3AF-E92EC575A1A6"
}

Error codes

HttpCode Error code Error message Description
400 OperationDenied.ExistDirectEip The operation is not allowed because of existing direct eip. You are not allowed to create an IPv4 gateway because an EIP in cut-through mode exists.
400 UnsupportedRegion The feature of ipv4Gateway is not supported in the region. IPv4 gateways are not supported in this region.
400 Forbidden.OperateShareResource You cannot operate shared resources. Shared resources do not support this operation.
400 OperationDenied.SubnetRouteV1Exist The operation is not allowed because of existing subnetRouteV1. The subnet routes in the VPC do not meet the requirements.
400 OperationDenied.NormalNatExist The operation is not allowed because of existing normalNat. Standard NAT gateways are deployed in the specified VPC.
400 OperationDenied.VpcExistIpv4Gateway An IPv4 gateway already exists in the VPC. You are not allowed to create an IPv4 gateway because an IPv4 gateway already exists in the VPC.
400 UnsupportedFeature.Ipv4Gateway The feature of ipv4Gateway is not supported for [%s]. The system failed to create the IPv4 gateway because IPv4 gateways are not supported.
400 OperationDenied.VpnExist The operation is not allowed because of existing vpn. You are not allowed to create an IPv4 gateway because a VPN gateway already exists in the VPC.
400 OperationDenied.DirectEipExist The operation is not allowed because of existing directEip. EIPs are associated with the VPC in cut-through mode or enhanced NAT gateways are deployed in the VPC.
400 OperationFailed.GetNfvServiceList The operation is failed because of get nfv serviceList failed. Failed to obtain the nfc service list.
400 IncorrectStatus.Vpc The status of %s [%s] is incorrect. The instance is in an invalid state.
400 OperationFailed.VpcNotExist The operation is failed because of vpc is not found. The specified VPC is not found.
400 IllegalParam.ResourceGroupId Invalid ResourceGroupld value. The specified resource group is invalid or does not exist.

For a list of error codes, see Service error codes.