Bug #20574
closedAPI call of GET /katello/api/host_collections says organization_id optional, but doesn't accept without organization id
Description
Description of problem: `organization_id` parameter is mentioned as optional for `host_collections` API. Without the `organization_id` parameter, API is unable to list all the host collections rather throws below error.
====================
curl -s -X GET -k -u admin:<password> 'https://fqdn/katello/api/v2/host_collections'
{"displayMessage":"undefined method `id' for nil:NilClass","errors":["undefined method `id' for nil:NilClass"]}
====================
The desired output is obtained when the below command is used with `organization_id` parameter.
====================- curl -s -X GET -k -u admin:<password> 'https://fqdn/api/v2/hosts?organization_id=<organization_id> ====================
Version-Release number of selected component (if applicable): Satellite 6.2.10
How reproducible: Always
Steps to Reproduce:
1. # curl -s -X GET -k -u admin:<password> 'https://fqdn/katello/api/v2/host_collections'
2.
3.
Actual results:
====================
curl -s -X GET -k -u admin:<password> 'https://fqdn/katello/api/v2/host_collections'
{"displayMessage":"undefined method `id' for nil:NilClass","errors":["undefined method `id' for nil:NilClass"]}
====================
Expected results: Should list all the host collections.