Add template simulation API for simulating template composition#56842
Add template simulation API for simulating template composition#56842dakrone merged 6 commits intoelastic:masterfrom
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.
@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 |
andreidan
left a comment
There was a problem hiding this comment.
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 <andrei.dan@elastic.co>
|
@elasticmachine update branch |
cjcenizal
left a comment
There was a problem hiding this comment.
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-templatethat 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_indexvs_simulate).This commit also adds reference documentation for both simulation APIs.
Relates to #53101
Resolves #56390
Resolves #56255