Bug 1437201

Summary: attributes selection in query ignored for some collections
Product: Red Hat CloudForms Management Engine Reporter: Martin Kourim <mkourim>
Component: APIAssignee: Jillian Tullo <jtullo>
Status: CLOSED ERRATA QA Contact: Martin Kourim <mkourim>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: cpelland, jhardy, jtullo, mkourim, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: api:rest
Fixed In Version: 5.9.0.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-01 13:11: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:
Embargoed:

Description Martin Kourim 2017-03-29 18:00:05 UTC
Description of problem:
Selection of attributes to return is ignored in case of "results", "service_catalogs", "automate", "categories" and "roles" collections.

For /api/<collection>?expand=resources&attributes=id query, these attributes are returned in addition to "href" and "id":
- "result_set" for "results" collection
- "service_templates" for "service_catalogs" collection
- "fqname" for "automate" collection
- "name" for "categories" collection
- "features" for "roles" collection


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


How reproducible:
Very


Steps to Reproduce:
1. for collection in "service_catalogs", "automate", "categories", "roles" do
   GET /api/<collection>?expand=resources&attributes=id


Actual results:
Attributes other than id and href are returned


Expected results:
Just id and href attributes are returned

Comment 2 Jillian Tullo 2017-04-12 13:13:08 UTC
PR: https://github.com/ManageIQ/manageiq/pull/14734

Comment 3 Martin Kourim 2017-10-23 14:29:27 UTC
It's now failing on all collections due to https://github.com/ManageIQ/manageiq/issues/15754

Comment 4 Jillian Tullo 2017-10-25 19:05:36 UTC
PR https://github.com/ManageIQ/manageiq-api/pull/144

Comment 5 Martin Kourim 2017-11-08 09:39:22 UTC
In case of automate collection the "fqname" attribute is still returned in addition to "href" and "id" when
GET /api/automate?expand=resources&attributes=id

Comment 6 Jillian Tullo 2017-11-08 20:28:52 UTC
Hi Martin-

Right now, the reason why fqname is left there is because it is an identifier and is more so the ID than the actual 'id' attribute for the /api/automate case. Let me know if that makes sense.

Comment 7 Martin Kourim 2017-11-09 00:42:51 UTC
Thanks for clarification Jillian. Changing status to verified.

Comment 10 errata-xmlrpc 2018-03-01 13:11: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/RHSA-2018:0380