Satellite 6 API adding multiple hosts to multiple host collections

Solution Verified - Updated -

Issue

You are getting the following error from your curl string when trying to use the bulk add host collections feature of the satellite 6 API:

{"displayMessage":"No hosts have been specified.","errors":["No hosts have been specified."]}

Example curl string and error:

curl -k -s\
    -H 'Authorization: Basic EcryptedString' \
    -H "Content-Type:application/json" \
    -H "Accept-Type:application/json" \
    -X PUT https://myfqhostname/api/hosts/bulk/add_host_collections \
    -d '{"included[ids]":["21","330"],"host_collection_ids":["12","11"]}'
{"displayMessage":"No hosts have been specified.","errors":["No hosts have been specified."]}

Environment

Satellite 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content