Skip to content

Get-templates APIs don't support lists#79049

Merged
elasticsearchmachine merged 1 commit intoelastic:7.xfrom
DaveCTurner:2021-10-13-get-templates-lists-7x
Oct 13, 2021
Merged

Get-templates APIs don't support lists#79049
elasticsearchmachine merged 1 commit intoelastic:7.xfrom
DaveCTurner:2021-10-13-get-templates-lists-7x

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

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. Likewise GET /_cat/templates/... (at least it didn't
until #78829 but that's not released yet). This commit fixes the docs to
indicate these APIs accept only a single template name and also adds
some extra validation to reject requests containing a , since such a
request cannot match any actual templates.

It also adjusts GET /_cat/templates to use the filtering built into
TransportGetComposableIndexTemplateAction rather than retrieving all
templates and then filtering them on the coordinating node.

Backport of #78989

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. Likewise `GET /_cat/templates/...` (at least it didn't
until elastic#78829 but that's not released yet). This commit fixes the docs to
indicate these APIs accept only a single template name and also adds
some extra validation to reject requests containing a `,` since such a
request cannot match any actual templates.

It also adjusts `GET /_cat/templates` to use the filtering built into
`TransportGetComposableIndexTemplateAction` rather than retrieving all
templates and then filtering them on the coordinating node.

Backport of elastic#78989
@DaveCTurner DaveCTurner added >bug :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Oct 13, 2021
@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Oct 13, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

@elasticsearchmachine elasticsearchmachine merged commit 6e9cec2 into elastic:7.x Oct 13, 2021
@DaveCTurner DaveCTurner deleted the 2021-10-13-get-templates-lists-7x branch November 4, 2021 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :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.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants