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:
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. ***