Bug 745142

Summary: 405 method not allowed on attempt to delete a filter
Product: [Retired] Pulp Reporter: Dmitri Dolguikh <dmitri>
Component: documentationAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: cperry, peter.meier, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 753145    

Description Dmitri Dolguikh 2011-10-11 13:57:53 UTC
I'm getting "405 Method Not Allowed None" when I attempt to delete a filter via pulp REST api. To reproduce:

curl -k -u admin:admin -X DELETE https://localhost/pulp/api/filters/:id/

Comment 1 Sayli Karmarkar 2011-12-14 19:56:54 UTC
*** Bug 761126 has been marked as a duplicate of this bug. ***

Comment 2 Sayli Karmarkar 2011-12-14 19:58:40 UTC
This is more of a documentation bug. Delete filter is a POST operation on api/filters/delete_filter.

Comment 3 Peter Meier 2011-12-14 20:31:28 UTC
Is there any reason, why it is like that? Because most other parts of the API support the DELETE http verb and this is also how common REST-APIs work.

If there is not really a reason that it is a POST operation, I would prefer to have consistency amongst the different parts of the pulp REST-API and being in line with how common REST-APIs work.

Comment 4 Sayli Karmarkar 2011-12-14 21:06:14 UTC
The reason was ability to pass 'force' flag to remove associations with repositories if any, which by default it set to 'false'. However, we are thinking of removing that functionality and remove all associations by default when deleting a filter. If we decide to go that route, we will change it to more restful approach with DELETE. 

(In reply to comment #3)
> Is there any reason, why it is like that? Because most other parts of the API
> support the DELETE http verb and this is also how common REST-APIs work.
> 
> If there is not really a reason that it is a POST operation, I would prefer to
> have consistency amongst the different parts of the pulp REST-API and being in
> line with how common REST-APIs work.

Comment 5 Sayli Karmarkar 2011-12-14 22:00:09 UTC
As per comment #4, I have updated api and cli to DELETE operation on /filters/id/ instead of POST on /filters/id/delete_filter/ with 'force' option. Please note that filter delete now removes repo associations without warning. api and cli docs are updated for this change as well. 

commit 3c90992c5b00c618d07428fd71abf00166dc2d3a
Author: Sayli Karmarkar <skarmark>
Date:   Wed Dec 14 13:59:24 2011 -0800

    745142 - changing delete filter api to more restful DELETE on /filters/filter_id and removing 'force' delete option

Comment 6 Jeff Ortel 2011-12-15 20:18:21 UTC
build: 0.255

Comment 7 Preethi Thomas 2011-12-19 20:12:39 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.255-1.fc15.noarch


[root@preethi ~]# curl -k -u admin:admin -X GET https://localhost/pulp/api/filters/
[{"description": "blacklist", "_ns": "filters", "package_list": [], "_id": "blacklist", "type": "blacklist", "id": "blacklist"}][root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]#  curl -k -u admin:admin -X DELETE https://localhost/pulp/api/filters/blacklist/
true[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# curl -k -u admin:admin -X GET https://localhost/pulp/api/filters/
[][root@preethi ~]#

Comment 8 Preethi Thomas 2012-02-24 20:17:11 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 9 Preethi Thomas 2012-02-24 20:18:13 UTC
Pulp v1.0 is released.