Only allow retrieving a single index or component template#54694
Only allow retrieving a single index or component template#54694dakrone merged 4 commits intoelastic:masterfrom
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) |
martijnvg
left a comment
There was a problem hiding this comment.
Looks good, left a question regarding if querying for a specific template and that template doesn't exist.
| results.put(name, allTemplates.get(name)); | ||
| } | ||
| } else if (allTemplates.containsKey(name)) { | ||
| results.put(name, allTemplates.get(name)); |
There was a problem hiding this comment.
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
| results.put(name, allTemplates.get(name)); | ||
| } | ||
| } else if (allTemplates.containsKey(name)) { | ||
| results.put(name, allTemplates.get(name)); |
There was a problem hiding this comment.
Throw a resource not found exception if template does not exist?
probakowski
left a comment
There was a problem hiding this comment.
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 <elasticmachine@users.noreply.github.com>
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