Skip to content
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

Merged
merged 4 commits into from
Apr 7, 2020

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Apr 2, 2020

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

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
@dakrone dakrone added :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0 v7.8.0 labels Apr 2, 2020
@dakrone dakrone requested review from martijnvg and probakowski April 2, 2020 23:17
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

Copy link
Member

@martijnvg martijnvg left a 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));
Copy link
Member

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));
Copy link
Member

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?

Copy link
Contributor

@probakowski probakowski left a 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

@martijnvg martijnvg mentioned this pull request Apr 3, 2020
39 tasks
@dakrone
Copy link
Member Author

dakrone commented Apr 3, 2020

@elasticmachine update branch

@dakrone
Copy link
Member Author

dakrone commented Apr 3, 2020

@elasticmachine run elasticsearch-ci/2

@dakrone
Copy link
Member Author

dakrone commented Apr 3, 2020

(Opened #54759 for the unrelated PR CI failure)

@elasticmachine run elasticsearch-ci/2

@dakrone
Copy link
Member Author

dakrone commented Apr 7, 2020

@elasticmachine update branch

@dakrone dakrone merged commit 6ae2d5e into elastic:master Apr 7, 2020
@dakrone dakrone deleted the itv2-only-get-single-item branch April 7, 2020 14:04
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Apr 7, 2020
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >non-issue v7.8.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants