During the development of the Comms API, I've noticed that communicating with the indexer required manipulating requests and responses manually, making the code more complicated to read an maintain.
This issue aims to create an internal library that offers a high-level API to interact with the OpenSearch API.
The utilities should be in charge of:
[ ] Building bulk requests
[ ] Parsing bulk responses and raising errors found (the API returns a 200 status code with errors inside the items)
[ ] Catching any error raised from the opensearch-py library and raising a WazuhIndexerError
Description
During the development of the Comms API, I've noticed that communicating with the indexer required manipulating requests and responses manually, making the code more complicated to read an maintain.
This issue aims to create an internal library that offers a high-level API to interact with the OpenSearch API.
The utilities should be in charge of: