Bug 1530948 - [QEDevCollab] Delete Advanced Search Filter via REST
Summary: [QEDevCollab] Delete Advanced Search Filter via REST
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: Parthvi Vala
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-04 10:01 UTC by Pete Savage
Modified: 2019-02-07 23:00 UTC (History)
3 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-07 23:00:52 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:0212 None None None 2019-02-07 23:00:59 UTC

Description Pete Savage 2018-01-04 10:01:26 UTC
Currently, we need to run this snippet of code via SSH to achieve this

"MiqSearch.where(:description => {}).first.delete"'.format(repr(filter_name)))

Could we please have this function available via REST

Comment 3 CFME Bot 2018-02-14 18:36:23 UTC
New commit detected on ManageIQ/manageiq-api/master:
https://github.com/ManageIQ/manageiq-api/commit/0de6894d8971786e8f73ed273d8b6a66dacf2b64

commit 0de6894d8971786e8f73ed273d8b6a66dacf2b64
Author:     Jillian Tullo <jtullo@redhat.com>
AuthorDate: Mon Jan 29 15:16:37 2018 -0500
Commit:     Jillian Tullo <jtullo@redhat.com>
CommitDate: Wed Feb 14 12:50:09 2018 -0500

    Allow deleting of search filters
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1530948

 app/controllers/api/search_filters_controller.rb |  4 ++
 config/api.yml                                   | 27 ++++++++
 spec/requests/collections_spec.rb                | 10 +++
 spec/requests/search_filters_spec.rb             | 84 ++++++++++++++++++++++++
 4 files changed, 125 insertions(+)
 create mode 100644 app/controllers/api/search_filters_controller.rb
 create mode 100644 spec/requests/search_filters_spec.rb

Comment 5 Parthvi Vala 2018-11-27 06:34:22 UTC
FIXED. Verified on 5.10.0.25.20181120211723_d2fd659.

Steps taken to verify:
1) Navigate to Compute > Infrastructure > Providers.
2) Create an advanced search filter.
3) Get the filter ID.
4) Send Request. Tested with 3 different requests.
    1. Request: POST /api/search_filters/:id
       Query: {"action" : "delete"}
    2. Request: DELETE /api/search_filters/:id
    3. Request: POST /api/search_filters
       Query: {
                "action": "delete",
                "resources": [
		   {"id": ":id" ,
                    "href": "https://<ip_address>/api/search_filters/:id",
                    "description": "my_filter"
		   }
                 ]
              }
Response: {
	"results": [
		{
			"success": true,
			"message": "search_filters id: :id deleting",
			"href": "https://<ip_address>/api/search_filters/:id"
		}
	]
}

Comment 6 errata-xmlrpc 2019-02-07 23:00:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:0212


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