Skip to content
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

API endpoint for previewing composed result of an index template v2 #56255

Closed
cjcenizal opened this issue May 6, 2020 · 4 comments · Fixed by #56842
Closed

API endpoint for previewing composed result of an index template v2 #56255

cjcenizal opened this issue May 6, 2020 · 4 comments · Fixed by #56842
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team Team:Deployment Management Meta label for Management Experience - Deployment Management team

Comments

@cjcenizal
Copy link
Contributor

cjcenizal commented May 6, 2020

Users will want to know what the final result of an index template will be once all of its component templates, mappings, settings, and aliases have been applied. This will be mostly useful during the creation process, so that users can have confidence that an index template they're building will behave as expected.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ui (:ES-UI)

@cjcenizal
Copy link
Contributor Author

cjcenizal commented May 6, 2020

Related to #55686. The difference between that API and the request in this issue is that I'd like to be able to test out a single index template and see how its config (including its component templates) gets resolved. I think the linked simulate API could address this by making the index_name param optional, so you could just omit it and only get back the resolved config for the provided body.

Per @dakrone a work-around from the UI side would be to simulate with an index name (e.g. some hash) and change the template to have an index pattern with the same hash so that it will be the only template to match the index name.

@cjcenizal cjcenizal added the :Data Management/Indices APIs APIs to create and manage indices and templates label May 6, 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 May 6, 2020
dakrone added a commit to dakrone/elasticsearch that referenced this issue 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 elastic#53101
Resolves elastic#56255
@dakrone
Copy link
Member

dakrone commented May 8, 2020

Relates to #56390

dakrone added a commit to dakrone/elasticsearch that referenced this issue May 14, 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 elastic#53101
Resolves elastic#56255
dakrone added a commit to dakrone/elasticsearch that referenced this issue May 15, 2020
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
dakrone added a commit that referenced this issue May 18, 2020
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 #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
dakrone added a commit to dakrone/elasticsearch that referenced this issue May 18, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team Team:Deployment Management Meta label for Management Experience - Deployment Management team
Projects
None yet
3 participants