Bug 1302443

Summary: "Name" parameter does not work with category Collection for querying
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: APIAssignee: Tim Wade <twade>
Status: CLOSED ERRATA QA Contact: Jeff Teehan <jteehan>
Severity: high Docs Contact:
Priority: medium    
Version: 5.5.0CC: cpelland, dajohnso, gtanzill, jhardy, jprause, mfeifer, obarenbo, pmukhedk, tlehinev, twade
Target Milestone: GAKeywords: ZStream
Target Release: 5.5.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 5.5.3.2 Doc Type: Bug Fix
Doc Text:
Previously, the REST API could not filter resources using the name parameter. This was because all filter attributes were constructed into a SQL query regardless of whether they represented column names, and thus filtering by virtual attributes would result in a database error. The code now checks for non-column attributes before making the query, and filters by these attributes in Ruby after the results are returned.
Story Points: ---
Clone Of: 1293891 Environment:
Last Closed: 2016-04-13 18:42:02 UTC Type: Bug
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: 1293891    
Bug Blocks:    

Comment 4 Jeff Teehan 2016-04-07 18:53:14 UTC
Looks good.

This query as described above:
https://10.16.6.125/api/categories?expand=resources&filter[]=name=%27location%27

Produced this result:
{"name":"categories","count":23,"subcount":1,"resources":[{"href":"https://10.16.6.125/api/categories/306000000000001","id":306000000000001,"description":"Location","read_only":false,"syntax":"string","single_value":true,"example_text":"The geographic location of the resource, such as New York, Chicago, or London.","tag_id":306000000000004,"parent_id":0,"show":true,"default":true,"name":"location","actions":[{"name":"edit","method":"post","href":"https://10.16.6.125/api/categories/306000000000001"},{"name":"delete","method":"post","href":"https://10.16.6.125/api/categories/306000000000001"},{"name":"delete","method":"delete","href":"https://10.16.6.125/api/categories/306000000000001"}]}],"actions":[{"name":"edit","method":"post","href":"https://10.16.6.125/api/categories"},{"name":"create","method":"post","href":"https://10.16.6.125/api/categories"},{"name":"delete","method":"post","href":"https://10.16.6.125/api/categories"}]}

Moving to Verified using 5.5.3.3 with appliance referenced above.

Comment 6 errata-xmlrpc 2016-04-13 18:42:02 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/RHBA-2016:0616