elasticsearch-cli icon indicating copy to clipboard operation
elasticsearch-cli copied to clipboard

Autogenerate routes for Elasticsearch endpoints

Open marclop opened this issue 7 years ago • 3 comments

Currently all of the routes are hardcoded, it would be a good idea to use instead the Elasticsearch API reference

marclop avatar Jun 08 '17 09:06 marclop

Couple of questions.

  1. What are your thoughts on how it will fetch/store the api json files?
  2. Should only the routes be interpreted from the files or should the parameters, arguments, etc. of the routes be interpreted as well?

abennett avatar Feb 06 '18 06:02 abennett

Built out the types for parsing in this commit.

abennett avatar Feb 06 '18 06:02 abennett

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.

marclop avatar Feb 06 '18 15:02 marclop