Bug 1326065 - [RFE] Option to have hammer and REST API call to list all applicable content hosts for a given errata
Summary: [RFE] Option to have hammer and REST API call to list all applicable content ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Errata Management
Version: 6.1.7
Hardware: All
OS: All
high
medium vote
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact:
URL:
Whiteboard:
: 1308707 (view as bug list)
Depends On:
Blocks: 1399395
TreeView+ depends on / blocked
 
Reported: 2016-04-11 17:12 UTC by Nagoor Shaik
Modified: 2020-08-13 08:26 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-13 19:28:09 UTC
Target Upstream Version:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.