-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Only allow retrieving a single index or component template #54694
Conversation
This changes the Index Template v2 APIs to only allow retrieving a single "named" entity, where the named entity can be nothing (return everything), a wildcard (return the ones that match), or the name of a template. Relates to elastic#53101
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left a question regarding if querying for a specific template and that template doesn't exist.
} | ||
} else if (allTemplates.containsKey(name)) { | ||
results.put(name, allTemplates.get(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in case when the template is missing here (when asking for a specific template by name) we want to throw a resource not found exception. Like was done here: https://github.com/elastic/elasticsearch/pull/54530/files#diff-e753c14c84c5edb785bc197306e5a24fR180
} | ||
} else if (allTemplates.containsKey(name)) { | ||
results.put(name, allTemplates.get(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw a resource not found exception if template does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I agree with @martijnvg though, that we should throw exception when template is not found
@elasticmachine update branch |
@elasticmachine run elasticsearch-ci/2 |
(Opened #54759 for the unrelated PR CI failure) @elasticmachine run elasticsearch-ci/2 |
@elasticmachine update branch |
…4694) * Only allow retrieving a single index or component template This changes the Index Template v2 APIs to only allow retrieving a single "named" entity, where the named entity can be nothing (return everything), a wildcard (return the ones that match), or the name of a template. Relates to elastic#53101 * Throw exception when resource is not found Co-authored-by: Elastic Machine <[email protected]>
This changes the Index Template v2 APIs to only allow retrieving a single "named" entity, where the
named entity can be nothing (return everything), a wildcard (return the ones that match), or the
name of a template.
Relates to #53101