Private IP Migration

Last updated: 2017-12-26 15:47:59

1. API Description

This API (MigratePrivateIpAddress) is used to migrate private IPs.
Domain for API request: vpc.api.qcloud.com

1) If a user of this API migrates a private IP from one ENI to another ENI, the primary IP address cannot be migrated.
2) The original ENI and the target ENI must be in the same subnet.

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. The Action field for this API is MigratePrivateIpAddress.

Parameter Name Required Type Description
vpcId Yes String Virtual private cloud ID of ENI, for example: vpc-7t9nf3pu.
privateIpAddress Yes String The private IP address to be migrated, for example: 10.0.0.6.
oldNetworkInterfaceId Yes String ID of the ENI before the private IP is migrated, for example: eni-m6dyj72l.
newNetworkInterfaceId Yes String ID of the ENI to which the private IP is migrated, for example: eni-dfddf454d.

3. Output Parameters

Parameter Name Type Description
code Int Error code. 0: Succeeded; other values: Failed.
message String Error message.
taskId Int Task ID. The operation result can be queried with taskId. For more information, refer to API for Querying Task Execution Result.

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 VPC does not exist. Please check the information you entered. You can query the VPC via the DescribeVpcEx API.
InvalidNetworkInterface.NotFound ENI does not exist. Please check the information you entered. You can query the ENI via the DescribeNetworkInterfaces API.

5. Example

Input


https://vpc.api.qcloud.com/v2/index.php?Action=MigratePrivateIpAddress
&<Common request parameters>
&vpcId=vpc-7t9nf3pu
&privateIpAddress=10.0.0.6
&oldNetworkInterfaceId=eni-m6dyj72l
&newNetworkInterfaceId=eni-dfddf454d

Output

{
    "code": 0,
    "message": "",
    "codeDesc": "Success",
    "data":
        {
            "taskId": 16284
        }
}