When elastic network interfaces (ENIs) are created, deleted, bound, or unbound, ENI operation events are triggered and event notifications are sent.

Notifications of ENI operation events

The following conditions must be met to trigger ENI operation events:
  • The ENI operation event feature is enabled. The feature is in invitational preview. To use this feature, submit a ticket.
  • The operation objects are secondary ENIs.

    ENIs are classified into primary ENIs and secondary ENIs. ENI operation events can be triggered only when the operation objects are secondary ENIs. For more information about the attributes of ENIs, see Attributes.

  • ENI operations succeed.
    ENI operation events can be triggered only when ENI operations succeed and no error messages are returned. For example, assume that an Elastic Compute Service (ECS) instance has already reached the maximum number of ENIs to which it can be bound. If you attempt to bind more ENIs to the instance, the attach operation fails and an error message similar to the one shown in the following figure appears. In this case, no ENI operation event is triggered. max-error
When an ENI operation that meets the preceding conditions is performed, an ENI operation event is triggered and an event notification is sent to the initiator of the operation.
  • If the operation object is a managed ENI, the operation is initiated by an Alibaba Cloud service. When the operation is complete, an event notification is sent to the Alibaba Cloud service. For more information about managed ENIs, see Managed ENIs.
  • If the operation object is a regular ENI, the operation is initiated by a user to bind, unbind, or delete the ENI. When the operation is complete, an event notification is sent to the user.

You can make configurations in CloudMonitor to receive notifications of ENI operation events and view the ENI operation results by using emails and DingTalk chatbots. You can obtain the information of ENIs and configure ENI operations to be automatically performed in response to the notifications. For more information, see Set event notifications.

The following JSON code shows an example notification of an ENI operation event.
{
    "ver":"1.0",
    "id":"2256A988-0B26-4E2B-820A-8B********A5",
    "product":"ECS",
    "resourceId":"acs:ecs:cn-hangzhou:169070********30:eni/eni-8vb1qo********cdeg2n",
    "level":"INFO",
    "name":"NetworkInterface:NetworkInterfaceOperateCompleted",
    "userId":"169070********30",
    "eventTime":"20190409T121826.922+0800",
    "regionId":"cn-hangzhou",
    "content":{
        "eniId":"eni-8vb1qo********cdeg2n",
        "operation":"AttachNetworkInterface",
        "eniStatus":"InUse",
        "result":"success",
        "requestId":"59701492-A8F2-3375-B0B9-D9********27"
    }
}
The following table describes the subparameters contained in the content parameter.
Subparameter Description Example
eniId The ID of the ENI. eni-8vb1qo********cdeg2n
operation The type of the operation. Valid values:
  • CreateNetworkInterface: creates an ENI.
  • AttachNetworkInterface: binds an ENI.
  • DetachNetworkInterface: unbinds an ENI.
  • DeleteNetworkInterface: deletes an ENI.
AttachNetworkInterface
eniStatus The state of the ENI. Valid values:
  • Available: The ENI is available and can be bound to an instance.
  • InUse: The ENI is bound to an instance.
  • Detaching: The ENI is being unbound from an instance.
  • Deleting: The ENI is being deleted.
  • Deleted: The ENI has been deleted.
  • CreateFailed: The ENI cannot be created.
InUse
result The operation result. Valid values:
  • success: The operation succeeds and the event level of the ENI operation event is INFO.
  • failed: The operation fails and the event level of the ENI operation event is WARN.
success
requestId The ID of the request that corresponds to the operation. 59701492-A8F2-3375-B0B9-D9********27