deleteInstance
codebolt.eventLog.deleteInstance(instanceId: undefined): Promise<EventLogInstanceResponse>
Deletes an event log instance and all its events.
Parameters
instanceId(unknown): The unique identifier of the event log instance to delete.
Returns
Promise<[EventLogInstanceResponse](/docs/reference/type-reference/codeboltjs/interfaces/EventLogInstanceResponse)>: A promise that resolves when the instance is deleted.
Examples
Example 1: Delete Instance
const result = await codebolt.eventLog.deleteInstance('log-instance-id');
if (result.success) {
console.log('Instance deleted');
}
Example 2: Delete with Confirmation
async function deleteWithConfirmation(instanceId) {
const instance = await codebolt.eventLog.getInstance(instanceId);
console.log(`Delete instance "${instance.data.instance.name}"?`);
// Confirm before deleting
const result = await codebolt.eventLog.deleteInstance(instanceId);
return result.success;
}
Notes
- WARNING: Permanently deletes all events in the instance
- Operation is irreversible
- Consider backing up important data before deletion