-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add template simulation API for simulating template composition #56842
Conversation
This adds an API for simulating template composition with or without an index template. It looks like: ``` POST /_index_template/_simulate/my-template ``` To simulate a template named `my-template` that already exists, or, to simulate a template that does not already exist: ``` POST /_index_template/_simulate { "index_patterns": ["my-index"] "composed_of": ["ct1", "ct2"], } ``` This is related to elastic#55686, which adds an API to simulate composition based on an index name (hence the `_simulate_index` vs `_simulate`). This commit also adds reference documentation for both simulation APIs. Relates to elastic#53101 Resolves elastic#56390 Resolves elastic#56255
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
.startObject() | ||
.field(MapperService.SINGLE_MAPPING_NAME, mappings) | ||
.endObject()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreidan I had to remove this wrapping because the simulated documents came back with the _doc
parameter in the mappings, and they can't be sent as new component or index templates with _doc
in the mappings
Pinging @elastic/es-ui (:ES-UI) |
This also doesn't include HLRC support (yet), since it's already over 800 lines I figured it should be split into a separate PR. |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding support for this Lee
This LGTM, left a couple of minor suggestions, but this looks great already
...va/org/elasticsearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java
Outdated
Show resolved
Hide resolved
…mplate/post/TransportSimulateTemplateAction.java Co-authored-by: Andrei Dan <[email protected]>
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reviewed the docs and had one comment. Thanks for adding this!
…tic#56842) This adds an API for simulating template composition with or without an index template. It looks like: ``` POST /_index_template/_simulate/my-template ``` To simulate a template named `my-template` that already exists, or, to simulate a template that does not already exist: ``` POST /_index_template/_simulate { "index_patterns": ["my-index"] "composed_of": ["ct1", "ct2"], } ``` This is related to elastic#55686, which adds an API to simulate composition based on an index name (hence the `_simulate_index` vs `_simulate`). This commit also adds reference documentation for both simulation APIs. Relates to elastic#53101 Resolves elastic#56390 Resolves elastic#56255
This adds an API for simulating template composition with or without an index template.
It looks like:
To simulate a template named
my-template
that already exists, or, to simulate a template that doesnot already exist:
This is related to #55686, which adds an API to simulate composition based on an index name (hence
the
_simulate_index
vs_simulate
).This commit also adds reference documentation for both simulation APIs.
Relates to #53101
Resolves #56390
Resolves #56255