[x] Create a script that can diff two elasticsearch indices and generate a list of changes. Your script should:
Use command line arguments to provide source and destination indices
Use the collection_id field to find which records have been added and which have been removed.
Store the title field so it is easier for a user to understand what has changed
Generate a list of dictionary "Events" i.e. { 'collection_id': '', 'collection_title': '', 'action': 'added/removed', 'datetime': '<current_datetime in ISO format'
[x] Create a new APP for the events endpoint as part of the archive-opensearch repo
[x] Create an Event model in your new app to hold this information
[x] Create a POST endpoint using the django rest framework to post the information from the script in the first step
[x] Create a GET endpoint using the django-rest-framework to display the events and add a time filter to allow the user to specify the time interval for getting events. e.g. GET /events?start_date=2021-07-25
[x] Add collection_id filter to GET endpoint to allow the user to GET events for a specific collection. i.e. collection added..., collection removed...
[x] Integrate POST endpoint into script to complete the pipeline. diff-index -> generate events -> POST to API -> retrieve recent events
[x] Add authentication to the POST endpoint to protect against random people posting things
[x] Add additional event check to see if DRS IDs have changed and create an "updated" event if they have
source
anddestination
indices{ 'collection_id': '', 'collection_title': '', 'action': 'added/removed', 'datetime': '<current_datetime in ISO format'
Event
model in your new app to hold this informationGET
/events?start_date=2021-07-25GET
events for a specific collection. i.e. collection added..., collection removed...