Event notification overview

更新时间:
复制 MD 格式

ECS event notifications deliver real-time resource change signals, replacing SDK polling with event-driven automated O&M.

Event notification name

The name field in a notification identifies the event code in <resource type>:<event>:<status> format.

  • <resource type>: the ECS resource type. Example: Instance (ECS instances) and Disk (block storage devices).

  • <event>: the event name. Examples: SystemMaintenance.Reboot, StateChange, PreemptibleInstanceInterruption, DiskOperationCompleted, and CreateSnapshotCompleted.

  • <status>: the event status. Valid values: Overview.

    Note

    The <status> field applies only to system events related to instances and block storage devices.

Event notification format

ECS sends notifications through the method you specify. The following example shows a default JSON notification for an instance state change event.

Note

If your notification method supports format conversion, the notification may be in a different format.

{
    "eventTime": "20181226T220114.058+0800",
    "id": "9435EAD6-3CF6-4494-8F7A-3A********77",
    "level": "INFO",
    "name": "Instance:StateChange",
    "product": "ECS",
    "regionId": "cn-hangzhou",
    "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
    "userId": "169070********30",
    "ver": "1.0",
    "content": {
        "resourceId": "i-bp1ecr********5go2go",
        "resourceType": "ALIYUN::ECS::Instance",
        "state": "Stopping"
    }
}

Fixed top-level fields in a notification:

Field

Description

Example

id

The event ID.

9435EAD6-3CF6-4494-8F7A-3A********77

eventTime

The event time in UTC+8.

20181226T220114.058+0800

level

The event level. Valid values:

  • INFO

  • WARN

  • CRITICAL

INFO

name

The event name. See Event notification name.

Instance:StateChange

product

The service name. Fixed value: ECS.

ECS

regionId

The region ID. Valid values: Regions and zones.

cn-hangzhou

resourceId

The Alibaba Cloud Resource Name (ARN).

acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go

userId

The Alibaba Cloud account ID.

169070********30

content

The event details. Subfields vary by event type:

None