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

Add template simulation API for simulating template composition #56842

Merged
merged 6 commits into from
May 18, 2020

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented 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 #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

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 dakrone added :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0 v7.9.0 labels May 15, 2020
@dakrone dakrone requested a review from andreidan May 15, 2020 19:18
@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 15, 2020
Comment on lines -120 to -122
.startObject()
.field(MapperService.SINGLE_MAPPING_NAME, mappings)
.endObject());
Copy link
Member Author

Choose a reason for hiding this comment

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

@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

@dakrone dakrone added the :ES-UI label May 15, 2020
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Deployment Management Meta label for Management Experience - Deployment Management team label May 15, 2020
@dakrone
Copy link
Member Author

dakrone commented May 15, 2020

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.

@dakrone
Copy link
Member Author

dakrone commented May 15, 2020

@elasticmachine test this please

Copy link
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.

Thanks for adding support for this Lee

This LGTM, left a couple of minor suggestions, but this looks great already

dakrone and others added 2 commits May 18, 2020 12:18
@dakrone
Copy link
Member Author

dakrone commented May 18, 2020

@elasticmachine update branch

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

I just reviewed the docs and had one comment. Thanks for adding this!

@dakrone dakrone merged commit d3ccada into elastic:master May 18, 2020
@dakrone dakrone deleted the itv2-add-simulate-template branch May 18, 2020 21:11
dakrone added a commit to dakrone/elasticsearch that referenced this pull request 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
@jakelandis jakelandis removed the v8.0.0 label Jul 26, 2021
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 >enhancement Team:Data Management Meta label for data/management team Team:Deployment Management Meta label for Management Experience - Deployment Management team v7.9.0 v8.0.0-alpha1
Projects
None yet
6 participants