Skip to content

Adjust /_cat/templates not to request all metadata #78819

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

Conversation

DaveCTurner
Copy link
Contributor

Today GET /_cat/templates retrieves the whole cluster metadata from
the master, which includes all sorts of unnecessary junk and consumes
significant resources. This commit reimplements these endpoints using
GetIndexTemplatesAction and GetComposableIndexTemplateAction which
are much more efficient.

The docs for this API indicate that it accepts a comma-separated list of
template names/patterns of the form GET /_cat/templates/name1,name2
but in fact today it only accepts a single name or pattern. This commit
also adds support for multiple names/patterns as the docs claim.

Backport of #78812

@DaveCTurner DaveCTurner added :Data Management/CAT APIs Text APIs behind /_cat backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v7.16.0 labels Oct 7, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Oct 7, 2021
@elasticmachine
Copy link
Collaborator

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

Today `GET /_cat/templates` retrieves the whole cluster metadata from
the master, which includes all sorts of unnecessary junk and consumes
significant resources. This commit reimplements these endpoints using
`GetIndexTemplatesAction` and `GetComposableIndexTemplateAction` which
are much more efficient.

The docs for this API indicate that it accepts a comma-separated list of
template names/patterns of the form `GET /_cat/templates/name1,name2`
but in fact today it only accepts a single name or pattern. This commit
also adds support for multiple names/patterns as the docs claim.

Backport of elastic#78812
@DaveCTurner DaveCTurner force-pushed the 2021-10-07-cat-templates-without-cluster-state-7x branch from 19ad3b8 to 37cdbb5 Compare October 7, 2021 11:23
@elasticsearchmachine elasticsearchmachine merged commit 59cc4ba into elastic:7.x Oct 7, 2021
@DaveCTurner DaveCTurner deleted the 2021-10-07-cat-templates-without-cluster-state-7x branch October 7, 2021 13:01
DaveCTurner added a commit that referenced this pull request Oct 7, 2021
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 :Data Management/CAT APIs Text APIs behind /_cat Team:Data Management Meta label for data/management team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants