Bug 962855 - deleting operation history returns 204 when invalid id is specified
deleting operation history returns 204 when invalid id is specified
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: REST (Show other bugs)
4.7
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.8
Assigned To: Heiko W. Rupp
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-14 11:14 EDT by Libor Zoubek
Modified: 2015-11-01 19:43 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-11 05:51:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Libor Zoubek 2013-05-14 11:14:15 EDT
Description of problem:


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

How reproducible:always


Steps to Reproduce:
1. do DELETE /operation/history/foo

  
Actual results: server returns 204


Expected results: server should return 404 or 406


Additional info:
Comment 1 Heiko W. Rupp 2013-05-22 03:27:15 EDT
I think the current behavior is correct in the REST sense as 
operations are supposed to be idempotent - you should be able to run them multiple times with the same result (POST is the exception).

The reasoning is that REST is not reduced to REST over http, but could be applied over other transports that are less safe and which may drop packets.

Of course if the parameter is not an integer, an error should be thrown (I think RestEasy may automatically do that anyway).
Comment 2 Heiko W. Rupp 2013-06-07 03:39:43 EDT
Delete operations are by default idempotent and should return a 204 code no matter if the entity existed or not.

I will introduce a 'validate' parameter, that checks for existence and which can then return a 404 code
Comment 3 Heiko W. Rupp 2013-06-07 09:05:14 EDT
master 998ab11
Comment 4 Heiko W. Rupp 2013-09-11 05:51:59 EDT
Bulk closing of old issues now that HRQ 4.9 is in front of the door.

If you think the issue has not been solved, then please open a new bug and mention this one in the description.

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