Skip to content

[7.x] Add simulate template composition API _index_template/_simulate_index/{name} (#55686) #55922

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

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

andreidan
Copy link
Contributor

This adds a new api to simulate matching the given index name against the
index templates in the system.

The syntax for the new API takes the following form:

POST _index_template/_simulate_index/{index_name}
{
"index_patterns": ["logs-*"],
"priority": 15,
"template": {
"settings": {
"number_of_shards": 3
}
...
}
}

Where the body is optional, but we support the entire body used by the
PUT _index_template/{name} api. When the body is specified we'll simulate
matching the given index against a system that'd have the given index
template together with the index templates that exist in the system.

The response, in both cases, will return the matching template's resolved
settings, mappings and aliases, together with a special field that'll print any
overlapping templates and their corresponding index patterns.

(cherry picked from commit 1a5845e)
Signed-off-by: Andrei Dan andrei.dan@elastic.co

Backport of #55686

…/{name} (elastic#55686)

This adds a new api to simulate matching the given index name against the
 index templates in the system.

The syntax for the new API takes the following form:

POST _index_template/_simulate_index/{index_name}
{
  "index_patterns": ["logs-*"],
  "priority": 15,
  "template": {
	"settings": {
		"number_of_shards": 3
	}
       ...
   }
}

Where the body is optional, but we support the entire body used by the
PUT _index_template/{name} api. When the body is specified we'll simulate
matching the given index against a system that'd have the given index
template together with the index templates that exist in the system.

The response, in both cases, will return the matching template's resolved
settings, mappings and aliases, together with a special field that'll print any
overlapping templates and their corresponding index patterns.

(cherry picked from commit 1a5845e)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
@andreidan andreidan added :Data Management/Indices APIs APIs to create and manage indices and templates backport v7.8.0 labels Apr 29, 2020
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Apr 29, 2020
@andreidan andreidan merged commit 6b886b0 into elastic:7.x Apr 29, 2020
@andreidan andreidan deleted the backport/7x-itv2-simulate-api branch April 29, 2020 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team v7.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants