Audit API

AI Suite Studio traces the main data manipulation operations, such as create, update, delete, publish. You can thus detect which object was created, updated, deleted, when the action was done, and by whom.

The Audit Service implementation stores the audit events in a MongoDB collection named auditEventData, in a separate database called audit. It also exposes the audit services via a REST controller.

To prevent memory outages, the audit events are exposed using pagination.

The Rest Api services which expose audit events are as follows:

  • List audit (GET): /api/v1.0/audit?page=0&size=20
  • List audit by user (GET): /api/v1.0/audit/filter?user=user1&page=0&size=20
  • List audit by action type (GET): /api/v1.0/audit/filter?type=LOGIN&page=0&size=20

    Possible action types:

    • LOGIN - User logged in
    • LOGOUT - User logged out
    • OBJECT_CREATE - Object created
    • OBJECT_UPDATE - Object updated
    • OBJECT_DELETE - Object deleted
    • OBJECT_IMPORT - Object imported
    • OBJECT_EXPORT - Object exported
    • MASS_UNLOCK - Mass unlock of objects (for user/by date/all from a workspace)
    • AUTO_MASS_UNLOCK - Automatic mass unlock of locks with no active session
    • AUDIT_DELETE - Delete audit events
    • PUBLISH - Publish computed parameters
    • UNPUBLISH - Unpublish computed parameters
  • List audit by date (GET):
    /api/v1.0/audit/filter?startDate=2016-01-01&endDate=2017-01-01&page=0&size=20
  • Delete an audit event (DELETE): /api/v1.0/audit/1
  • Get an audit event (GET): /api/v1.0/audit/1

The structure of the audit event response contains the following fields:

  • id
  • date: date of the event
  • user: the user who did the action
  • actionType: such as login, logout, create object..
  • actionStatus: Success or Failed
  • remoteAddress
  • data: the workspace, the entity – possible values: Domain, Parameter, Event, Accounting Method...

Related Links