All Products
Document Center

Elastic Compute Service:DetachNetworkInterface

Last Updated:Feb 04, 2024

Detaches an elastic network interface (ENI) from an Elastic Compute Service (ECS) instance.

Operation description

The operation that you want to perform. Set the value to DetachNetworkInterface.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters


The ID of the ENI.


The ID of the instance


The ID of the trunk ENI.

Note This parameter is unavailable for use.

The ID of the request.


Response parameters

The current API has no return parameters


Sample success responses


  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"

Error codes

HTTP status codeError codeError messageDescription
400MissingParameter%sA parameter is not specified.
400UnsupportedParameter%sThe parameter is not supported.
400InvalidParameter%sThe specified parameter is invalid.
400InvalidInstanceID.Malformed%sThe specified InstanceId parameter is invalid.
400InvalidOperation.InvalidRegion%sThe specified RegionId parameter is invalid.
400Forbidden.RegionId%sThe service is unavailable in the current region.
400InvalidParams.EniId%sThe specified EniId parameter is invalid.
403InvalidUserType.NotSupported%sYour account does not support this operation.
403Abs.InvalidAccount.NotFound%sYour Alibaba Cloud account does not exist or your AccessKey pair has expired.
403Forbidden.NotSupportRAM%sRAM users are not authorized to perform this operation.
403Forbidden.SubUser%sYou are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization.
403MaxEniCountExceeded%sThe maximum number of ENIs that can be managed has been reached.
403EniPerInstanceLimitExceeded%sThe maximum number of ENIs that can be attached to the specified instance has been reached.
403InvalidOperation.AvailabilityZoneMismatch%sThe operation is invalid.
403InvalidOperation.VpcMismatch%sThe operation is invalid. Check whether the VPC in the operation corresponds to other parameters.
403InvalidSecurityGroupId.NotVpc%sThe specified SecurityGroupId parameter is invalid and the network type of the security group is not VPC.
403InvalidOperation.EniServiceManaged%sThe operation is invalid.
403InvalidOperation.EniLinked%sThe operation is invalid because the current ENI of the instance is associated with other ENIs. You must disassociate the ENI from the other ENIs before you can unbind the ENI from the instance.
403InvalidInstanceId.NotFound%sThe specified instance does not exist. Check whether the InstanceId parameter is valid.
403InvalidOperation.HotPlugNotSupport%sThe operation is not supported while the specified resource is running. For more information, see the return value of the %s placeholder in the error message.
403InvalidParameter.EniNotBelongTrunk%sThe specified ENI is not in trunk mode. For more information, see the return value of the %s placeholder in the error message.
403InvalidOperation.EniTypeNotSupportTrunking%sThe type of the ENI does not support operations related to the trunk mode. For more information, see the return value of the %s placeholder in the error message.
403InvalidOperation.HasMemberEniAttached%sOther ENIs are attached to the ENI that works in trunk mode. For more information, see the return value of the %s placeholder in the error message.
404InvalidEcsId.NotFound%sThe specified instance ID does not exist.
404InvalidEniId.NotFound%sThe specified ENI ID does not exist.
404InvalidVSwitchId.NotFound%sThe specified vSwitch does not exist.
404InvalidSecurityGroupId.NotFound%sThe specified security group ID does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-15The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404