Skip to content

Events API

Create an API for accessing events associated with a Collection (and possibly on MonitoredItems? that is more Logging rather than an Event though). For the purpose of this issue, an Event is defined as: File Audit, Token Audit, or Token Ingest. We should be able to see any past, current, and queued Events for a Collection.

Some brief prototyping:

/rest/collections/<id>/events

{
  "current": {},
  "queued": {"event_type": "file_audit", "status": "queued"},
  "history": [{"event_type": "token_ingest", "status": "success", "session": 1},
              {"event_type": "token_audit", "status": "success", "session":2}]
}

/rest/collections/<id>/events/<session>

{
 "event_type": "token_ingest", 
 "status": "success", 
 "session": 1
}

/rest/collections/<id>/events/<session>/log

{
  event_log entries
  ...
}

The main api for getting events on a collection is probably a bit misguided at the moment as we won't want to respond with all the history events ever on a collection, but it's a simple example for now. Likewise I'm not entirely sure what the data structure for an event should look like.