Audit log

GET /api/auditLog/

Get all audit log entries as a list.

Results will be sorted by timestamp with the most recent entries first.

Query Parameters:
  • limit (int) – limit the number of results returned

  • offset (int) – skip this many entries

  • start (int) – only entries after this UNIX timestamp will be returned

  • end (int) – only entries before this UNIX timestamp will be returned

GET /api/auditLog/user/(int: user_id)

Get audit log entries for a single user as a list.

Results will be sorted by timestamp with the most recent entries first. :query int limit: limit the number of results returned :query int offset: skip this many entries :query int start: only entries after this UNIX timestamp will be returned :query int end: only entries before this UNIX timestamp will be returned

GET /api/auditLog/action/(action)

Get audit log entries of a single action type.

Results will be sorted by timestamp with the most recent entries first.

Query Parameters:
  • limit (int) – limit the number of results returned

  • offset (int) – skip this many entries

Status Codes:
  • 404 Not Found – if the action is not INSERT, UPDATE, or DELETE (case-insensitive).

GET /api/auditLog/trash

Get the last deletion record of objects with no records since.

Query Parameters:
  • limit (int) – limit the number of results returned

  • offset (int) – skip this many entries

  • start (int) – only entries after this UNIX timestamp will be returned

  • end (int) – only entries before this UNIX timestamp will be returned

GET /api/auditLog/(object_type)/(object_id)

Get audit log entries concerning a single object as a list.

Results will be sorted by timestamp with the most recent entries first.

Query Parameters:
  • limit (int) – limit the number of results returned

  • offset (int) – skip this many entries

  • start (int) – only entries after this UNIX timestamp will be returned

  • end (int) – only entries before this UNIX timestamp will be returned

POST /api/auditLog/(int: entry_id)/undo

Undo the changes made in an audit log entry.

For INSERT actions, the object (and any associated objects) will be deleted.

For UPDATE actions, fields whose current values don’t match the “after” value in the entry will not be modified.

For DELETE actions, the object will be restored. However, linked objects (such as programs when restoring a machine) will not be restored.

Status Codes:
Returns:

the latest audit log entry for the object (which should be the one created as a result of the undo operation)