EventLog API
The eventLog module of the @codebolt/plugin-sdk.
import plugin from '@codebolt/plugin-sdk';
Quick Reference
| Method | Description |
|---|---|
appendEvent | Append a single event to the log |
appendEvents | Append multiple events to the log |
createInstance | Create a new event log instance |
deleteInstance | Delete an event log instance |
getInstance | Get an event log instance by ID |
getInstanceStats | Get instance statistics |
listInstances | List all event log instances |
queryEvents | Query events using DSL |
updateInstance | Update an event log instance |
Methods
appendEvent
plugin.eventLog.appendEvent(params: AppendEventParams): Promise<EventLogAppendResponse>
Append a single event to the log
| Parameter | Type | Required | Description |
|---|---|---|---|
params | AppendEventParams | Yes | Event parameters |
Returns: Promise<EventLogAppendResponse>
appendEvents
plugin.eventLog.appendEvents(params: AppendEventsParams): Promise<EventLogAppendMultipleResponse>
Append multiple events to the log
| Parameter | Type | Required | Description |
|---|---|---|---|
params | AppendEventsParams | Yes | Events parameters |
Returns: Promise<EventLogAppendMultipleResponse>
createInstance
plugin.eventLog.createInstance(name: string, description?: string): Promise<EventLogInstanceResponse>
Create a new event log instance
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Instance name |
description | string | No | Optional description |
Returns: Promise<EventLogInstanceResponse>
deleteInstance
plugin.eventLog.deleteInstance(instanceId: string): Promise<EventLogInstanceResponse>
Delete an event log instance
| Parameter | Type | Required | Description |
|---|---|---|---|
instanceId | string | Yes | Instance ID |
Returns: Promise<EventLogInstanceResponse>
getInstance
plugin.eventLog.getInstance(instanceId: string): Promise<EventLogInstanceResponse>
Get an event log instance by ID
| Parameter | Type | Required | Description |
|---|---|---|---|
instanceId | string | Yes | Instance ID |
Returns: Promise<EventLogInstanceResponse>
getInstanceStats
plugin.eventLog.getInstanceStats(instanceId: string): Promise<EventLogStatsResponse>
Get instance statistics
| Parameter | Type | Required | Description |
|---|---|---|---|
instanceId | string | Yes | Instance ID |
Returns: Promise<EventLogStatsResponse>
listInstances
plugin.eventLog.listInstances(): Promise<EventLogInstanceListResponse>
List all event log instances
No parameters.
Returns: Promise<EventLogInstanceListResponse>
queryEvents
plugin.eventLog.queryEvents(query: EventLogDSL): Promise<EventLogQueryResponse>
Query events using DSL
| Parameter | Type | Required | Description |
|---|---|---|---|
query | EventLogDSL | Yes | Query DSL object |
Returns: Promise<EventLogQueryResponse>
updateInstance
plugin.eventLog.updateInstance(instanceId: string, updates: UpdateEventLogInstanceParams): Promise<EventLogInstanceResponse>
Update an event log instance
| Parameter | Type | Required | Description |
|---|---|---|---|
instanceId | string | Yes | Instance ID |
updates | UpdateEventLogInstanceParams | Yes | Update parameters |
Returns: Promise<EventLogInstanceResponse>