Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

We document that GET /_index_template/... accepts a comma-separated
list of template names but in fact today this API accepts only a single
name or pattern. We expect folks sometimes to have enough templates to
want to be able to request a list of them, so this commit generalises
the API to accept a list as per the docs.

It also adjusts GET /_cat/templates to use this new feature to filter
the list of composable templates on the master rather than on the
coordinating node.

@DaveCTurner DaveCTurner added >bug :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0 v7.16.0 labels Oct 8, 2021
@DaveCTurner DaveCTurner force-pushed the 2021-10-08-get-multi-composable-template-by-name branch from 5ee39ac to 4aed797 Compare October 8, 2021 16:41
We document that `GET /_index_template/...` accepts a comma-separated
list of template names but in fact today this API accepts only a single
name or pattern. We expect folks sometimes to have enough templates to
want to be able to request a list of them, so this commit generalises
the API to accept a list as per the docs.

It also adjusts `GET /_cat/templates` to use this new feature to filter
the list of composable templates on the master rather than on the
coordinating node.
@DaveCTurner DaveCTurner force-pushed the 2021-10-08-get-multi-composable-template-by-name branch from 4aed797 to 46f956a Compare October 8, 2021 16:48
@DaveCTurner DaveCTurner requested a review from dakrone October 11, 2021 08:36
@DaveCTurner DaveCTurner marked this pull request as ready for review October 11, 2021 08:36
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Oct 11, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@dakrone
Copy link
Member

dakrone commented Oct 11, 2021

@DaveCTurner we actually discussed this in the past and decided against adding functionality like this. The reason, if I recall, relates to the way we should handle partial failure of the request with and without wildcards. If the docs say we support that we should fix those so that they are correct.

For example, here we explicitly removed docs for comma-separated list of names for deletion: #70649

@DaveCTurner
Copy link
Contributor Author

WDYT about keeping this functionality in the transport action and just blocking it in the REST action? GET _cat/templates doesn't have the same concerns about partial failures, but it is pretty inefficient to get all the composable templates from the master and filter them on the coordinating node.

@dakrone
Copy link
Member

dakrone commented Oct 11, 2021

@DaveCTurner that works for me I think

@DaveCTurner DaveCTurner marked this pull request as draft October 12, 2021 07:34
@DaveCTurner
Copy link
Contributor Author

Actually on reflection the change to GET _cat/templates to support multiple patterns as per the docs is also new in 7.16 (see #78829). In this branch I've reverted both APIs back to the old single-pattern behaviour and fixed the docs to match. I will use this PR to check I didn't miss anything in CI and then close this and open a fresh PR with a corrected description.

@DaveCTurner
Copy link
Contributor Author

Closing this in favour of #78989

@DaveCTurner DaveCTurner deleted the 2021-10-08-get-multi-composable-template-by-name branch October 12, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team v7.16.0 v8.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants