Bind NAT Gateway with EIP

Last updated: 2019-11-27 14:10:18

PDF

1. API Description

This API (EipBindNatGateway) is used to bind the EIP to a NAT gateway.
Domain name for API requests: vpc.api.qcloud.com

2. Input Parameters

Below is a list of API request parameters. You need to add common request parameters to your request when calling this API. For more information, see the Common Request Parameters page. The Action field for this API is EipBindNatGateway.

Parameter name Required Type Description
natId Yes String Unified ID of the high-availability gateway, for example: nat-df5dfd.
vpcId Yes String ID or unified ID (recommended) of the VPC, for example: vpc-dfd5dfgd.
At least one of the two input parameters assignedEipSet and autoAllocEipNum must be passed in, for example, assignedEipSet.0=183.23.0.0.1.
autoAllocEipNum No Int Number of EIPs in a new request. Value range: [0, 3]. Either assignedEipSet or autoAllocEipNum must be passed in.

3. Output Parameters

Parameter name Type Description
code Int Error code. 0: Successful; other values: Failed.
message String Error message
taskId Int Task ID. You can query the execution result by using the taskId. For more information, see the API for Querying Task Execution Results.

4. Error Codes

The following error codes only include business logic error codes for this API. For additional common error codes, see VPC Error Codes.

Error code Description
InvalidVpc.NotFound Invalid VPC. This error code indicates that the VPC resource does not exist. In this case, verify whether the resource information that you entered is correct. You can query the VPC through the API DescribeVpcEx.
InvalidNatGatewayId.NotFound Invalid NAT gateway. This error code indicates that the NAT gateway resource does not exist. In this case, verify whether the resource information that you entered is correct. You can query the NAT gateway through the API DescribeNatGateway.

5. Example

Input

https://vpc.api.qcloud.com/v2/index.php?Action=EipBindNatGateway
&<Common Request Parameters>
&natId=nat-8pbrkzh6
&vpcId=314
&autoAllocEipNum=1

Output

{
    "code":"0",
    "message":"",
    "taskId":16167
}