elasticsearch-cli
elasticsearch-cli copied to clipboard
Autogenerate routes for Elasticsearch endpoints
Currently all of the routes are hardcoded, it would be a good idea to use instead the Elasticsearch API reference
Couple of questions.
- What are your thoughts on how it will fetch/store the api json files?
- Should only the routes be interpreted from the files or should the parameters, arguments, etc. of the routes be interpreted as well?
Built out the types for parsing in this commit.
There's some aspects to consider for this generator:
- Each version of Elasticsearch can have different endpoints, so each version or at least minor version (bugfix versions won't introduce new endpoint afaik) should have its own view of the path tree. This can make memory consumption relatively high so an suitable data structure should be used.
- Paths should be formed from the
url.paths
string slice.{name}
signals for a template using the index name in this case. -
_common.json
should be treated differently as it contains common parameters for all endpoints.