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.
Updated by The Foreman Bot over 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/6905 added
Updated by Eric Helms over 7 years ago
- Translation missing: en.field_release set to 286
Updated by Anonymous over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|6f77b2e34a88eff02043298ccd062b7ee94b828e.
Updated by Eric Helms over 7 years ago
- Translation missing: en.field_release changed from 286 to 295
Updated by Andrew Kofink over 7 years ago
- Related to Bug #21150: host collection index now requires organization_id added
Updated by Andrew Kofink about 7 years ago
- Related to Bug #21435: hammer host-collection list requires organization parameter with host-id provided added