How to list Errata and Packages for a particular Content View using hammer CLI in Red Hat Satellite 6?
Environment
- Red Hat Satellite 6.
Issue
- Hammer command to list Errata and Packages for a particular Content View in Red Hat Satellite 6.
- List errata and packages for a Content View in CSV format.
Resolution
-
hammer
command to fetch Erratum for a particular Content View:# hammer -u admin -p password erratum list --content-view-id <cv_id> --content-view-version <v_no> -- organization-id <o_id> > /tmp/erraata.csv
-
hammer
command to fetch Packages for a particular Content View:Replace
cv_id
with the content-view id , v_no with version number and o_id with Organization id that needs to
be queried.# hammer -u admin -p password package list --content-view-id <cv_id> --content-view-version <v_no> -- organization-id <o_id> > /tmp/package.csv
-
Detailed information regarding the erratas can also be fetched using REST API:
Replace
content_view_version_id
with the desired ID fromhammer content-view version list
command.# curl -k -s -u admin 'https://satellite.lab.example.com/katello/api/v2/errata? content_view_version_id=5&per_page=10000&search=&sort_by=issued&sort_order=DESC' | python -mjson.tool
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.
Comments