kibana/packages/kbn-spec-to-console
Jean-Louis Leysens 214aee0fef
[Console] Mappings 7.5 part 2 (#48492)
* Update OSS console mappings and update script to handle new time unit entries

* Add console_extensions (ccr follower pause+resume)
2019-10-17 14:27:58 +02:00
..
bin Console update autocomplete definitions (#39508) 2019-07-02 18:33:27 +02:00
lib [Console] Mappings 7.5 part 2 (#48492) 2019-10-17 14:27:58 +02:00
test/fixtures Backport spec_to_console script to work with new JSON file format. (#43427) 2019-08-19 12:26:33 -07:00
index.js adding spec to console utility as Kibana script (#35232) 2019-04-17 20:40:32 -04:00
package.json Update dependency prettier to ^1.18.2 (#47340) 2019-10-05 05:32:24 -07:00
README.md Console update autocomplete definitions (#39508) 2019-07-02 18:33:27 +02:00

A mini utility to convert Elasticsearch's REST spec to Console's (Kibana) autocomplete format.

It is used to semi-manually update Console's autocompletion rules.

Retrieving the spec

If you don't have a copy of the Elasticsearch repo on your machine, follow these steps to clone only the rest API specs

mkdir es-spec && cd es-spec
git init
git remote add origin https://github.com/elastic/elasticsearch
git config core.sparsecheckout true
echo "rest-api-spec/src/main/resources/rest-api-spec/api/*\nx-pack/plugin/src/test/resources/rest-api-spec/api/*" > .git/info/sparse-checkout
git pull --depth=1 origin master

Usage

You need to run the command twice: once for the OSS specs and once for the X-Pack specs
At the root of the Kibana repository, run the following commands:

# OSS
yarn spec_to_console \
  -g "<ELASTICSEARCH-REPO-FOLDER>/rest-api-spec/src/main/resources/rest-api-spec/api/*" \
  -d "src/legacy/core_plugins/console/api_server/spec/generated"

# X-pack
yarn spec_to_console \
  -g "<ELASTICSEARCH-REPO-FOLDER>/x-pack/plugin/src/test/resources/rest-api-spec/api/*" \
  -d "x-pack/plugins/console_extensions/spec/generated"

Information used in Console that is not available in the REST spec

  • Request bodies
  • Data fetched at runtime: indices, fields, snapshots, etc
  • Ad hoc additions