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

/v1/actions/*: return 404 if no objects found #7958

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Apr 2, 2020

... and not 500.

fixes #7956

@Al2Klimov Al2Klimov added bug Something isn't working area/api REST API labels Apr 2, 2020
@Al2Klimov Al2Klimov added this to the 2.13.0 milestone Apr 2, 2020
@Al2Klimov Al2Klimov requested a review from yhabteab June 18, 2020 10:34
@yhabteab
Copy link
Member

yhabteab commented Jun 18, 2020

Before:

Command: # curl -k -v -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/add-comment' -d '{ "type": "Host", "filter": "host.name==\"test\"", "author": "user", "comment": "Some comments here"}'

POST /v1/actions/add-comment HTTP/1.1
Host: localhost:5665
Authorization: Basic cm9vdDppY2luZ2E=
User-Agent: curl/7.58.0
Accept: application/json
Content-Length: 102
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 102 out of 102 bytes
HTTP/1.1 500 Internal Server Error

After:

POST /v1/actions/add-comment HTTP/1.1
Host: localhost:5665
Authorization: Basic cm9vdDppY2luZ2E=
User-Agent: curl/7.58.0
Accept: application/json
Content-Length: 102
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 102 out of 102 bytes
HTTP/1.1 404 Not Found

@Al2Klimov Al2Klimov modified the milestones: 2.13.0, 2.14.0 Jun 2, 2021
@Al2Klimov
Copy link
Member Author

@cla-bot check

@cla-bot cla-bot bot added the cla/signed label Aug 4, 2021
@julianbrost julianbrost merged commit 5fea15e into master Jan 24, 2023
@icinga-probot icinga-probot bot deleted the bugfix/api-500-404-7956 branch January 24, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"500 Internal Server Error" instead of "404 Not Found" on non-matching filter in API request
3 participants