ENI event notifications

更新时间:
复制 MD 格式

Event notifications are sent when Elastic Network Interface (ENI) operations are complete. These operations include creating, deleting, attaching, and detaching ENIs.

ENI operation completion events

The following conditions must be met to generate an ENI operation completion event:

  • The ENI operation completion event feature is in invitational preview.

  • The operation object is a secondary ENI.

    ENIs are classified as primary and secondary. Events are generated only when the operation is performed on a secondary ENI. For more information about ENI properties, see Overview of ENIs.

  • The operation request is successful.

    An event is generated only when the operation request succeeds and no error is reported. For example, an Elastic Compute Service (ECS) instance has a limit on the number of ENIs that can be attached. If you try to attach an ENI after the limit is reached, the operation fails and an error message appears in the ECS console. In this case, no event is generated. The following figure shows an example of an error message.max-error

When an ENI operation is complete, an event notification is sent to the user who initiated the operation.

  • If the ENI is a managed ENI, the operation is initiated by an Alibaba Cloud service. Therefore, the event notification is sent to that service.

  • If the ENI is a standard ENI, the event notification is sent to the user who initiated an operation, such as attaching, detaching, or deleting the ENI.

You can set up ENI operation completion event notifications in EventBridge and Cloud Monitor to promptly receive operation results by email or through a DingTalk chatbot. You can use the notification content to retrieve information about the ENI and automate processing. For more information, see Subscribe to ECS system event notifications and Elastic Compute Service events.

The following code shows an example of an ENI operation completion event in JSON format:

{
    "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",
        "primaryPrivateIp": "192.168.XX.XX",
        "secondaryPrivateIps": ["192.168.XX.XX","192.168.XX.XX"],
        "ipv4Prefixes": ["192.168.XX.XX/24"],
        "ipv6s": ["2001:DB8:XXXX:23:8:800:200C:417A"],
        "ipv6Prefixes": ["2001:DB8::/32"]
    }
}

The following table describes the fields in the `content` object.

Field Name

Description

Example

eniId

The ID of the ENI.

eni-8vb1qo********cdeg2n

operation

The type of operation. Valid values:

  • CreateNetworkInterface: Creates an ENI.

  • AttachNetworkInterface: Attaches an ENI.

  • DetachNetworkInterface: Detaches an ENI.

  • DeleteNetworkInterface: Deletes an ENI.

AttachNetworkInterface

eniStatus

The state of the ENI. Valid values:

  • Available: The ENI is available and can be attached to an instance.

  • InUse: The ENI is attached to an instance.

  • Detaching: The resource is detaching.

  • Deletion in progress.

  • The resource has been deleted.

  • CreateFailed: The create operation failed.

InUse

result

The operation result. Valid values:

  • success: The operation succeeded. The event level is INFO.

  • failed: The operation failed. The event level is WARN.

success

requestId

The ID of the request that corresponds to the operation.

59701492-A8F2-3375-B0B9-D9********27

primaryPrivateIp

The primary private IP address.

192.168.XX.XX

secondaryPrivateIps

secondary private IP address.

["192.168.XX.XX"]

ipv4Prefixes

Secondary private IP prefix

["192.168.XX.XX/14"]

ipv6s

The IPv6 addresses.

2001:DB8:XXXX:23:8:800:200C:417A

ipv6Prefixes

The IPv6 prefixes.

["2001:DB8::/32"]