This topic describes the event types, the formats of event messages, and the meaning of each field in an event message in DataWorks.
Background information
In DataWorks, events are classified into regular events and extension point events based on whether the operation process related to an event in DataWorks can be blocked and whether the processing result of an event message can be returned after a self-managed service subscribes to the event message.
Regular events: You can subscribe to this type of event message. However, the operations that generate this type of event message cannot be blocked. You can use the OpenEvent module to subscribe to this type of event message. For more information, see OpenEvent.
Extension point events: You can subscribe to this type of event message. You can use the Extensions module of DataWorks Open Platform to configure custom responses to this type of event message. For example, if you enable a custom extension to check extension point events in DataWorks and you perform an operation that triggers the check of the custom extension in DataWorks, the operation is blocked until the extension returns the processing result of the event message.
The following tables describe the events supported by each DataWorks service, whether an event is a regular event or an extension point event, the event type defined for an event in EventBridge, and the event code defined for an event in DataWorks Extensions.
Type: The type of an event. This field is used to filter event messages in EventBridge. For more information, see Enable event message subscription.
eventCode: The event code of an event. During on-premises development, you can determine the event type based on the event code in an event message. The event message is sent from DataWorks to EventBridge.
Workspace-level events
Workspace-level services generate workspace-level events. For example, events that are generated after you run nodes in DataStudio are workspace-level events. Events that are generated due to the status change of auto triggered instances in Operation Center are also workspace-level events. You can know from the following tables the events supported by each DataWorks service, whether an event is a regular event or an extension point event, and the message format of an event.
On the Message formats tabs of this section, you can view only partial content of the format of an event message. To view a complete event message sent to EventBridge or Function Compute, see the Appendix: Message formats section in this topic.
Events of DataStudio
Events
Event category
| Event | Regular event | Extension point event | Event type in EventBridge | Event code in Extensions |
Create a node
|
|
| |||
Update a node
|
|
| |||
| Delete a file
|
|
| ||
Commit a file |
|
| |||
Deploy a file |
|
| |||
Run code |
|
| |||
Review the code of a node |
|
| |||
Commit a table to the development environment |
|
| |||
Deploy a table to the production environment |
|
|
Message formats
Node development events (create and update)
File change events (commit, deploy, execute, delete, and review code)
Table change events (commit a table to the development environment and deploy a table to the production environment)
Events of Operation Center
Events
Event category
| Event | Regular event | Extension point event | Event type in EventBridge
| Event code in Extensions |
Delete a node
|
|
| |||
Undeploy a node
|
|
| |||
Freeze a node |
|
| |||
Unfreeze a node |
|
| |||
Backfill data for a node |
|
| |||
Change the status of an auto triggered node |
|
| |||
Freeze an instance |
|
| |||
Unfreeze an instance |
|
| |||
Terminate an instance |
|
| |||
Rerun an instance
|
|
| |||
Set the status of an instance to Succeeded |
|
| |||
Change the status of a workflow
|
|
| |||
Monitor objects and send alerts |
|
|
Message formats
Node change events (delete, undeploy, freeze, and unfreeze)
Data backfilling for nodes
Node status change events
Instance operation events (freeze, unfreeze, terminate, rerun, and set the instance status to Succeeded)
Workflow status change events
Monitoring and alerting
Events of Security Center
Events
Event category
| Event | Regular event | Extension point event | Event type in EventBridge
| Event code in Extensions |
Approval Center (creation or completion of a request processing order) | Create a request processing order |
|
| ||
Complete a request processing order |
|
| |||
Request permissions on tables |
|
|
Message formats
Message body for an Approval Center event (creation or completion of a request processing order)
Message body for a Security Center event (table permission requesting)
Appendix: Authorized content (MaxCompute)
Appendix: Authorized content (DataService)
Events of Data Quality
Events
Event category
| Event | Regular event | Extension point event | Event type in EventBridge
| Event code in Extensions |
Provide feedback on data quality check results
|
| | |||
Report that a data quality check is complete
|
|
|
Message formats
Message body for a Data Quality check event
Tenant-level events
Tenant-level services generate tenant-level events. For example, an event that is generated when a workspace is deleted in the DataWorks console is a tenant-level event. In this section, the tables describe the events supported by each DataWorks service, whether an event is a regular event or an extension point event, and the message format of an event.
On the Message formats tabs of this section, you can view only partial content of the format of an event message. To view a complete event message sent to EventBridge or Function Compute, see the Appendix: Message formats section in this topic.
Events of the DataWorks console
Events
Event category
| Event | Regular event | Extension point event | Event type in EventBridge | Event code in Extensions |
Delete a workspace (pre-event) |
|
| |||
Delete a workspace (post-event) |
|
|
Message formats
Message body for a workspace deletion event
Events of Upload and Download
Events
Event category
| Event | Regular event | Extension point event | Event type in EventBridge | Event code in Extensions |
Download data (pre-event) (file generation) | dataworks:ResourcesDownload:DownloadResources | download-resources | |||
Download data (pre-event) (file download) | dataworks:ResourcesDownload:DownloadResourcesExecute | download-resources-execute | |||
Upload data (pre-event) | dataworks:ResourcesUpload:UploadDataToTable | upload-data-to-table |
Message formats
Message body for a data download and upload event
Appendix: Message formats
Formats of event messages sent to EventBridge
After you configure an event distribution channel in OpenEvent, event messages sent to EventBridge can be filtered based on the value of the Type field when workspace-level or tenant-level events are triggered in DataWorks. Sample format of an event message sent to EventBridge:
{
"datacontenttype": "application/json;charset=utf-8",//// The content format of data. datacontenttype supports only application/json.
"data": {
// The message content varies based on the message type. The following two fields are fixed in each message. For information about the message content of each type of event, see the preceding information.
"tenantId": 28378****10656,// The tenant ID. Each Alibaba Cloud account in DataWorks corresponds to a tenant. Each tenant has its own tenant ID. To view the tenant ID, click the current account in the upper-right corner of the DataStudio page. In the panel that appears, click User Info in the Menu section. You can view the tenant ID in the User Info message.
"eventCode": "xxxx"//
},
"id": "539fd8f4-4ea1-4625-aa8b-6c906674****",// The event ID. The ID is the unique identifier of an event.
"source": "acs.dataworks",// The event source. In this example, the event is pushed by DataWorks.
"specversion": "1.0",
"subject": "",
"time": "2020-11-19T21:04:41+08:00",// The event generation time.
"type": "dataworks:InstanceStatusChanges:InstanceStatusChanges",// The event type. The Type field is used in the EventBridge console to filter all event messages pushed by DataWorks. Each event has a different event type value. You can refer to the preceding information to obtain the event type.
"aliyunaccountid": "123456789098****",// The ID of the Alibaba Cloud account.
"aliyunpublishtime": "2020-11-19T21:04:42.179PRC",// The time when EventBridge receives an event.
"aliyuneventbusname": "default",// The name of the EventBridge event bus used to receive DataWorks event messages.
"aliyunregionid": "cn-hangzhou",// The region where events are received.
"aliyunpublishaddr": "172.25.XX.XX"
}
A complete event message contains information such as the body, ID, source, and generation time of the event message. The following table describes the key fields in the preceding sample code.
Field | Type | Description |
data | object | The body of the event message. The structure of a message body and the fields contained in a message body vary based on the type of the event. For more information, see the following sections in this topic: Message formats of events in DataStudio: Message formats of events in Operation Center: Message formats of events in Security Center: Message formats of events in Data Quality: |
id | String | The unique ID of the event message. You can identify an event message based on the ID of the event message. |
type | String | The type of the event. This field is used to describe the event type of the event source. Sample values:
The Type field is used in the EventBridge console to filter all event messages pushed by DataWorks. Each event has a different event type value. You can refer to the preceding information to obtain the event type. |
Formats of event messages sent to Function Compute
If you develop and deploy an extension in DataWorks based on Function Compute, the related event message is sent to Function Compute as JSON data when an extension point event that is specified in the extension is triggered. Sample format of an event message sent to Function Compute:
{
"blockBusiness": true,
"eventCategoryType": "resources-download",// The event category.
"eventType": "upload-data-to-table",// The event type.
"extensionBizId": "job_6603643923728775070",
"messageBody": {
// The message content varies based on the message type. The following two fields are fixed in each message. For information about the message content of each type of event, see the preceding information.
"tenantId": 28378****10656,// The tenant ID. Each Alibaba Cloud account in DataWorks corresponds to a tenant. Each tenant has its own tenant ID. To view the tenant ID, click the current account in the upper-right corner of the DataStudio page. In the panel that appears, click User Info in the Menu section. You can view the tenant ID in the User Info message.
"eventCode": "xxxx"//
},
"messageId": "52d44ee7-b51f-4d4d-afeb-*******"// The event ID. The ID is the unique identifier of an event.
}
The following table describes the fields in the preceding sample code.
Field | Type | Description | |
messageId | String | The ID of the event. The ID is the unique identifier of an event. | |
messageBody | The specific event message pushed by DataWorks. This field is used when an extension is developed. The field value varies based on the message type. | ||
tenantId | The ID of the tenant. Each Alibaba Cloud account in DataWorks corresponds to a tenant. Each tenant has its own tenant ID. To view the tenant ID, click the current account in the upper-right corner of the DataStudio page. In the panel that appears, click User Info in the Menu section. You can view the tenant ID in the User Info message. | ||
eventCode | The event code. It is used to identify a type of event message. For information about the event code for each event type, see the Event code in Extensions column in each Events table in Development reference: Event lists and event message formats. |