ADR: Delete api endpoint to delete index for a given kind

Status

  • Proposed
  • Under review
  • Approved
  • Retired

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.

Decision

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' 

Consequences

  • As a clean up/run down process, implement a delete API in indexer which deletes index for a given kind. MR 273
  • Update Search service ITs setup & teardown and integrate kind index delete API. MR 229
Edited by Neelesh Thakur