Bug 1476869 - inconsistent response when deleting nonexistent authentication using API
inconsistent response when deleting nonexistent authentication using API
Status: ON_QA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API (Show other bugs)
Unspecified Unspecified
medium Severity medium
: GA
: 5.9.0
Assigned To: Jillian Tullo
Martin Kourim
Depends On:
  Show dependency treegraph
Reported: 2017-07-31 12:30 EDT by Martin Kourim
Modified: 2017-10-05 21:46 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Martin Kourim 2017-07-31 12:30:37 EDT
Description of problem:
When deleting nonexistent /api/authentication/:id using POST, the response is
    "success": false,
    "message": "Couldn't find Authentication with 'id'=:id"
and the HTTP status is 200 (success)

When deleting nonexistent authentication using the DELETE HTTP method, the response is empty and and the HTTP status is 204 (success).

The responses are inconsistent with responses from other collections where the "ActiveRecord::RecordNotFound" error is returned and the HTTP status is 404 (not found).

E.g. deleting nonexistent VM:
    "error": {
        "kind": "not_found",
        "message": "Couldn't find Vm with 'id'=199999 ...",
        "klass": "ActiveRecord::RecordNotFound"
HTTP status 404

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
POST https://<ip_address>/api/authentications/2222
{"action": "delete"}
DELETE https://<ip_address>/api/authentications/2222

Expected results:
"ActiveRecord::RecordNotFound", HTTP status 404
Comment 2 Jillian Tullo 2017-08-04 14:54:56 EDT
PR: https://github.com/ManageIQ/manageiq/pull/15736
Comment 3 Satoe Imaishi 2017-09-28 14:09:27 EDT
PR: https://github.com/ManageIQ/manageiq-api/pull/17

Note You need to log in before you can comment on or make changes to this bug.