Skip to content

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

Merged
andreidan merged 3 commits intoelastic:7.xfrom
andreidan:backport/7x-itv2-simulate-api
Apr 29, 2020
Merged

[7.x] Add simulate template composition API _index_template/_simulate_index/{name} (#55686)#55922
andreidan merged 3 commits intoelastic:7.xfrom
andreidan:backport/7x-itv2-simulate-api

Conversation

@andreidan
Copy link
Copy Markdown
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 DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. backport v7.8.0 labels Apr 29, 2020
@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 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 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants