What is the Satellite 6 API to get the hosts from specific host_collection

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.4

Issue

  • Need an API to get the hosts from a specific host_collection.

Resolution

  • Below endpoint can be used to fetch all the hosts from the given host_collection.
$ curl -k -X GET -u admin:<admin-pwd> 'https://<satellite-fqdn>/api/hosts?search=host_collection_id%3D<host-collection-id>' -H 'content-type: application/json'

Note: To get the host collection list, https://<satellite-fqdn>/apidoc/v2/host_collections/index.html can be referred.

For more KB articles/solutions related to Red Hat Satellite 6.x API Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x API Issues

SBR
Product(s)

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.