How to change the lifecycle environment of a host registered to Red Hat Satellite 6 server using the API?

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.14

Issue

  • How to change the lifecycle environment of a host registered to Red Hat Satellite 6 server using the API?

Resolution

  • Use the following API call:

    # curl --header "Accept:application/json" --header "Content-Type:application/json" --request PUT --user user:pwd --insecure --data '{"host": {"content_facet_attributes": {"lifecycle_environment_id": NEW_LE_ID, "content_view_id": NEW_CV_ID} } }' https://satellite.example.com/api/hosts/HOST_ID | python3 -m json.tool
    

    where:

    • NEW_LE_ID is the ID of the target lifecycle environment.
    • NEW_CV_ID is the ID of the target conetent-view.
    • HOST_ID is the ID of the host for which the target lifecycle environment needs to be assigned.

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

Root Cause

  • In Satellite 6.14, it is not allowed to refer the target lifecycle environment only in the API call for a given host. Rather, you have to specify both a target lifecycle environment and a target content view which has been promoted to the target lifecycle environment.
SBR
Product(s)
Components
Category

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.