ADR: Delete api endpoint to delete index for a given kind
Context & Scope
Today, Integration tests of Search Service connect to Elasticsearch directly to indices setup (add/update/delete) which are later searched using various query scenario types. This setup has following shortcomings:
- Elasticsearch, being a platform component, must not be exposed through a public interface directly. It also present a security risk.
- It's not a true black box testing of search service. The tests must be run via public interfaces of OSDU Apis.
We are proposing to modify the way search tests are initialized: that is, instead of directly inserting records to Elasticsearch, we want to make the ITs add records via storage service which can be then searched.
As a tear-down/clean up procedure, we will need to delete indices created through the test cases and for this purpose, we need to have a delete API in indexer service. Sample request :
curl --request DELETE \ --url '/api/indexer/v2/index?kind=opendes:welldb:wellbore:1.0.0' \ --header 'authorization: Bearer <JWT>' \ --header 'content-type: application/json' \ --header 'data-partition-id: opendes'