Delete ENIs

Last updated: 2018-06-19 10:44:05


1. API Description

This API (DeleteNetworkInterface) is used to delete ENIs.
Domain for API request:

1) An ENI cannot be deleted when it is bound to a CVM.
2) To delete a specified ENI, the ENI must be unbound from the sub-machine first. After the ENI is deleted, all the private IPs on it will be returned.

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

Parameter Name Required Type Description
vpcId Yes String Virtual private cloud ID of ENI, for example: vpc-7t9nf3pu
networkInterfaceId Yes String ENI ID assigned by the system, for example: eni-m6dyj72l

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 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 by using the DescribeVpcEx API
InvalidNetworkInterface.NotFound ENI does not exist. Please check the information you entered. You can query the ENI via the DescribeNetworkInterfaces API
InvalidNetworkInterface.CanNotDelete The ENI cannot be deleted because it is bound to a CVM

5. Example

&<Common request parameters>


    "code": 0,
    "message": "",
    "codeDesc": "Success",
            "taskId": 16284