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

Snapshot Lifecycle Policy API return empty object instead 404 when policy not exist #47664

Closed
disaster37 opened this issue Oct 7, 2019 · 1 comment · Fixed by #47679
Closed
Assignees
Labels
>bug :Data Management/ILM+SLM Index and Snapshot lifecycle management

Comments

@disaster37
Copy link

Elasticsearch version (bin/elasticsearch --version): 7.4.0

Plugins installed: []

JVM version (java -version):

OS version (uname -a if on a Unix-like system):

Description of the problem including expected versus actual behavior:

Actual:
When get Snapshot lifecycle api with policy not exist, it wil return empty Object {}
-> GET /_slm/policy/policy-not-exist
-> it return {} with status 200

Expected:
-> It return status 404

Steps to reproduce:

curl -XGET http://127.0.0.1:9200/_slm/policy/policy-not-exist
@dakrone dakrone added :Data Management/ILM+SLM Index and Snapshot lifecycle management >bug labels Oct 7, 2019
@elasticmachine
Copy link
Collaborator

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

@dakrone dakrone self-assigned this Oct 7, 2019
dakrone added a commit to dakrone/elasticsearch that referenced this issue Oct 7, 2019
Previously when retrieving an SLM policy it would always return a 200
with `{}` in the body, even if the policy did not exist. This changes
that behavior to throw an error (similar to our other APIs) if a
policy doesn't exist.

This also adds a basic CRUD yml test for the behavior.

Resolves elastic#47664
dakrone added a commit that referenced this issue Oct 8, 2019
Previously when retrieving an SLM policy it would always return a 200
with `{}` in the body, even if the policy did not exist. This changes
that behavior to throw an error (similar to our other APIs) if a
policy doesn't exist.

This also adds a basic CRUD yml test for the behavior.

Resolves #47664
dakrone added a commit that referenced this issue Oct 8, 2019
Previously when retrieving an SLM policy it would always return a 200
with `{}` in the body, even if the policy did not exist. This changes
that behavior to throw an error (similar to our other APIs) if a
policy doesn't exist.

This also adds a basic CRUD yml test for the behavior.

Resolves #47664
dakrone added a commit that referenced this issue Oct 8, 2019
Previously when retrieving an SLM policy it would always return a 200
with `{}` in the body, even if the policy did not exist. This changes
that behavior to throw an error (similar to our other APIs) if a
policy doesn't exist.

This also adds a basic CRUD yml test for the behavior.

Resolves #47664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/ILM+SLM Index and Snapshot lifecycle management
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants