Transfer ENI

Last updated: 2019-11-29 17:13:28

PDF

1. API Description

This API (MigrateNetworkInterface) is used to migrate ENIs.
Domain for API request: vpc.api.qcloud.com

1) This API is used to migrate the ENI from one CVM to another. The primary ENI cannot be migrated.
2) The CVM before and after the migration must be in shutdown or running status.
3) The CVM after the migration must belong to the VPC sub-machine. The availability zone of​the CVM after the migration must be the same as that of ​the ENI.

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 MigrateNetworkInterface.

Parameter Name Required Type Description
vpcId Yes String Virtual private cloud ID of ENI, for example: vpc-7t9nf3pu.
networkInterfaceId Yes String ENI ID, for example: eni-m6dyj72l.
oldInstanceId Yes String CVM instance ID before the migration, for example: ins-xx44545f.
newInstanceId Yes String CVM instance ID after the migration, for example: ins-xx44545f.

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 Code Table

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.
InvalidInstance.NotFound The CVM instance does not exist. Please check the information you entered. You can query the CVM instance via the DescribeInstances API.
InvalidNetworkInterface.AlreadyAssociated The ENI is already bound to a CVM.

5. Example

Input

https://vpc.api.qcloud.com/v2/index.php?Action=MigrateNetworkInterface
&<Common request parameters>
&vpcId=vpc-xx44545f
&networkInterfaceId=eni-m6dyj72l
&oldInstanceId=ins-xx44545f
&newInstanceId=ins-cddddu74

Output

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