Project

General

Profile

Actions

Bug #20574

closed

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

Added by Anand Agrawal over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 2 (0 open2 closed)

Related to Katello - Bug #21150: host collection index now requires organization_idClosedAndrew Kofink09/28/2017Actions
Related to Katello - Bug #21435: hammer host-collection list requires organization parameter with host-id providedClosedAndrew Kofink10/23/2017Actions
Actions

Also available in: Atom PDF