Currently, the following types of Clean Up Tasks are available: formdata, notifications, requestreports, tos (for Terms Of Use), wizard, transactionsvoid, and transactions.
The following endpoints can be used to perform Clean Up processes:
1. Execute Clean Up
POST /cleanup
All types of tasks are cleaned up asynchronously. The user receives a confirmation in the response that the tasks are being executed in the background. This also applies to all other endpoints that perform specific task cleanups.
POST /cleanup/{type}
All tasks of the specified type are cleaned up.
POST /cleanup/{type} (With Criteria)
All tasks of the specified type matching the criteria are deleted. Attention: Endpoints have different sorting criteria.
POST /cleanup/notifications/{olderThanDays}
Remove notifications that are older than a specific number of days.
POST /cleanup/transactionsvoid/{minutes}
Empty and delete transactions that are older than a specific number of minutes.
POST /cleanup/transactions/{days}
Remove transactions that are older than a specific number of days.
POST /cleanup/requestedreports/{Year-Month-Day}
Remove reports that are earlier than a specific date.
Note the format of the parameter: year-month-day, e.g., 2023-04-01 (April 1, 2023).
2. Query Status
GET /cleanup/status
Returns an overview of the current cleanup tasks. If a specific cleanup process has never been executed, the user only receives the information regarding the key and schema of the process.
A cleanup process can have the following statuses: finished, running, failed.
Tasks that have never been executed or have been reset will not appear in the response.
[
{
"key": "wizard",
"status": "FINISHED",
"errorMessage": "",
"startedAt": "2024-04-23T08:00:56.696Z",
"finishedAt": "2024-04-23T08:00:58.287Z",
"schemaName": "acta_nova_cleanup_task"
},
"...... Other Tasks"
]
GET /cleanup/status/{status}
Returns a list of cleanup processes that match the specified status.
3. Reset
DELETE /cleanup/reset
Resets all cleanup processes. If you call GET status afterwards, no tasks will be visible.
DELETE /cleanup/reset/{type}
Resets a specific cleanup process.
Endpoint Security
There are two options available to access the endpoints:
-
The user logs in as an administrator and sends the generated token with the request.
-
If the user is not an administrator but still wishes to perform cleanup tasks, the environment variable
MESH_PLUGIN_ACTA_NOVA_CLEANUP_SECRETmust be configured in Mesh. Once configured, the user can append the corresponding secret as a query parameter to the end of the endpoint URL (e.g.,/cleanup/?secret=secrete123) to access the respective endpoint.
