Skip to content

Fix simulating index templates without specified index#56295

Closed
dakrone wants to merge 1 commit intoelastic:masterfrom
dakrone:itv2-simulate-without-index
Closed

Fix simulating index templates without specified index#56295
dakrone wants to merge 1 commit intoelastic:masterfrom
dakrone:itv2-simulate-without-index

Conversation

@dakrone
Copy link
Copy Markdown
Member

@dakrone dakrone commented May 6, 2020

When simulating index template composition, we should not require an index name if a body is
specified, instead if no index is specified we should assume the provided template matches.

Relates to #53101
Resolves #56255

When simulating index template composition, we should not require an index name if a body is
specified, instead if no index is specified we should assume the provided template matches.

Relates to elastic#53101
Resolves elastic#56255
@dakrone dakrone added >bug :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. v8.0.0 v7.8.0 labels May 6, 2020
@dakrone dakrone requested review from andreidan and probakowski May 6, 2020 18:08
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label May 6, 2020
Copy link
Copy Markdown
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dakrone thanks for working on this. I think the code looks good, if we decide to go forward with this.

edit: after looking at #56255 I noticed you already proposed using the same index name as the templated index pattern (sorry jumped at the code initially)

I believe the drawbacks of maintaining an exceptional case and changing the user-defined index pattern when building the request as opposed to the user filling in an index name that matches the pattern are not worth us supporting this.

I think we should keep this endpoint as is, always requiring an index name, and expand the new API we proposed on #53101 to include a body and simulate index template composition

Add simulate API for a template ie. /_index_template/{template-name}/_simulate, without any body. It will return the final resolved version of the template (merging the component templates)

What do you think?

@dakrone
Copy link
Copy Markdown
Member Author

dakrone commented May 7, 2020

@andreidan and I discussed this and decided that rather than change the simulation API like this (which is meant for simulating an index), we're going to add a separate API under POST /_index_template/_simulate/{optional-template} that will allow simulating without specifying an index. For now I'm going to close this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.8.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API endpoint for previewing composed result of an index template v2

4 participants