API: Efficient way to get host collections and its hosts
Issue
-
The api seems to be really inefficient to query. The only way I found was to do the following.
Request /katello/api/v2/organizations/1/host_collections -
This gives me a list of host_collections.
For each host collection!! I need to get a list of host ids!
/katello/api/v2/host_collections/$o->{id}
-
With 53 host collections you already have 53 requests to just get the host_ids but not the host names.
Now this gets really silly. For each host_id I need to either do another request to get the hostname or grab all the hosts first and match the host_ids.. -
So ideally the first request should already return the host_ids and hostnames. At least it should return the host_ids.
- Maybe I was missing something. The documentation shows an argument called "full_results" but that does not seem to do anything.
Environment
- Satellite 6.2
- api
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.