Create NAT Gateways

Last updated: 2020-06-04 17:46:40

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new VPC API 3.0 which is standardized and faster.

    1. API Description

    This API (CreateNatGateway) is used to create an NAT gateway.
    Domain for API request: vpc.api.qcloud.com

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters.

    Parameter Name Required Type Description
    natName Yes string NAT gateway name; supports 1-25 characters, including uppercase and lowercase English letters, numbers, and underscores.
    vpcId Yes string Virtual private cloud ID or unified ID (unified ID is recommended). It can be queried via the DescribeVpcEx API.
    maxConcurrent Yes int The upper limit of concurrent connection of NAT gateway, for example: 1000000, 3000000, 10000000. To learn more, please refer to Virtual Private Cloud Gateway Description.
    bandwidth No int The maximum public network output bandwidth of the gateway (unit: Mbps), which is 100 Mbps by default. For more information, please refer to Virtual Private Cloud Gateway Description.
    assignedEipSet.n No string One of the two elastic IP arrays bound to the gateway, assignedEipSet and autoAllocEipNum, must be passed at least, for example: assignedEipSet.0=10.0.0.1. For more information on elastic IP, please refer to Elastic IP.
    autoAllocEipNum No int The number of elastic IPs for new requests. The system will generate several elastic IPs according to your needs. One of the assignedEipSet and autoAllocEipNum must be passed at least. For more information on elastic IP, please refer to Elastic IP.

    3. Output Parameters

    Parameter Name Type Description
    code Int Error code. 0: Succeeded; other values: Failed
    message string Error message
    billId string Order ID. You can query the creation result by calling QueryNatGatewayProductionStatus API.

    4. Error Codes

    The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

    Error Code Description
    InvalidVpc.NotFound This VPC does not exist. Please check the information entered. You can query the VPC via the DescribeVpcEx API.
    InvalidNatGatewayName The NAT gateway name is invalid. It should contain 1-60 characters, including uppercase and lowercase letters, numbers, and underscores
    NatGatewayLimitExceeded Reached the upper limit of NAT gateways. Please contact customer service to raise the quota. For more information on VPC resource restrictions, see VPC Service Limits

    5. Example

    Input

    https://vpc.api.qcloud.com/v2/index.php?Action=CreateNatGateway
    &>
    &natName=zhezhe
    &vpcId=314
    &maxConcurrent=1000000
    &bandwidth=10
    &autoAllocEipNum=1
    

    Output

    {
        "code":"0",
        "message":"",
        "billId":"20160415160000002485253313199244"
    }

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help