Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1326065

Summary: [RFE] Option to have hammer and REST API call to list all applicable content hosts for a given errata
Product: Red Hat Satellite Reporter: Nagoor Shaik <nshaik>
Component: Errata ManagementAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 6.1.7CC: bbuckingham, bkearney, daniele, jsherril, kmurugad, mmccune, nshaik, sthirugn, xdmoon
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-13 19:28:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1399395    

Comment 1 Bryan Kearney 2016-07-08 20:40:33 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 3 Justin Sherrill 2016-08-09 15:53:16 UTC
You can do this already in Satellite 6.2 via the search param

hammer -u admin -p changeme host list --search="applicable_errata = RHBA-2016:1503"

Comment 4 Justin Sherrill 2016-08-09 15:57:44 UTC
Also to clarify, you could achieve this via the api:

curl -u admin:changeme https://hostname.example.com/api/v2/hosts?search='applicable_errata=RHBA-2016:1503'

Proposing we close this bz

Comment 5 Brad Buckingham 2016-08-09 16:02:39 UTC
Hi Nagoor, does the capability mentioned in comment 3 and 4 address the customer's request?

Comment 6 Justin Sherrill 2016-08-09 16:06:58 UTC
Same example for searching by installed packages:

hammer -u admin -p changeme host list --search="installed_package = basesystem-10.0-7.el7.noarch"

curl -u admin:changeme https://`hostname`/api/v2/hosts?search='installed_package=basesystem-10.0-7.el7.noarch

Comment 7 Fred van Zwieten 2016-08-16 19:55:15 UTC
As a (temp) alternative, would this script maybe help?

https://github.com/RedHatSatellite/satellite-host-cve

Comment 8 Bryan Kearney 2016-08-17 13:06:51 UTC
Justin, Two questoins:

1) How would that be done via hammer?
2) Related to 1, how would I get this into CSV output?

Comment 9 Justin Sherrill 2016-08-17 13:13:14 UTC
Bryan:

1) See the hammer examples in comment #6 and #3
2) as with any hammer command, simply adding --csv right after 'hammer' will provide results in csv format:

hammer --csv -u admin -p changeme host list --search="installed_package = basesystem-10.0-7.el7.noarch"

Comment 12 Justin Sherrill 2016-09-13 19:28:36 UTC
*** Bug 1308707 has been marked as a duplicate of this bug. ***