Project

General

Profile

Bug #20574

API call of GET /katello/api/host_collections says organization_id optional, but doesn't accept without organization id

Added by Anand Agrawal almost 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

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.

====================
  1. 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.


Related issues

Related to Katello - Bug #21150: host collection index now requires organization_idClosed2017-09-28
Related to Katello - Bug #21435: hammer host-collection list requires organization parameter with host-id providedClosed2017-10-23

Associated revisions

Revision 6f77b2e3 (diff)
Added by aagrawal almost 5 years ago

Fixes #20574 - changed organization-id to required

History

#1 Updated by Anand Agrawal almost 5 years ago

  • Bugzilla link set to 1480508

#2 Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6905 added

#3 Updated by Eric Helms almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 286

#4 Updated by Anonymous almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Eric Helms almost 5 years ago

  • Legacy Backlogs Release (now unused) changed from 286 to 295

#6 Updated by Andrew Kofink almost 5 years ago

  • Related to Bug #21150: host collection index now requires organization_id added

#7 Updated by Andrew Kofink over 4 years ago

  • Related to Bug #21435: hammer host-collection list requires organization parameter with host-id provided added

Also available in: Atom PDF