Bug 2219700 - [RFE] Hammer Command to get the all registered hosts UUID details
Summary: [RFE] Hammer Command to get the all registered hosts UUID details
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.12.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-04 20:46 UTC by Amit Agarwal
Modified: 2023-08-16 17:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Amit Agarwal 2023-07-04 20:46:53 UTC
Description of problem:

There does not seem to have a single command which can give details of all registered hosts UUID at a time. 

hammer host info --id will give the UUID info for individual host.  


Steps to Reproduce:
CSV file that we generate from Web UI under Host -> All host or even Hosts -> Content Hosts does not show the UUIDs of the hosts


Actual results:
There does not seem to have a single command which can give details of all registered hosts UUID details at a time.

Expected results:
Hammer Command to get the all registered hosts UUID details

Comment 1 Marek Hulan 2023-08-03 13:40:05 UTC
The best way to achieve this is to create a report template and then render it from hammer. Attaching an example report template and the hammer commands needed to import and use it.

hammer report-template import --file /root/host_uuids.erb --name 'Host - UUIDs' --organization 'Default Organization' --location 'Default Location'
hammer report-template generate --name 'Host - UUIDs'

Example output as CSV

> Name,UUID
> foreman-nuc2.example.com,588766ef-60a1-446b-8db2-7460a6ae1b74
> tony-sloane.example.com,afd308ce-71f1-4e0d-abc2-1ab2f47cfa27
> clark-dirksen.example.com,3b1766f7-3fc2-4ca8-991c-88e181fb173f
> mqtt.example.com,e69c179e-176d-44db-914d-ca46f7e93a13

I don't think we'll be adding option to customize columns for host list hammer command.

Comment 3 Amit Agarwal 2023-08-11 14:55:55 UTC
Query from customer

"What is expected entries in  /root/host_uuids.erb   ?
Do I need to create this file ? "

Comment 4 Amit Agarwal 2023-08-11 14:56:08 UTC
Query from customer

"What is expected entries in  /root/host_uuids.erb   ?
Do I need to create this file ? "

Comment 6 Amit Agarwal 2023-08-16 17:57:31 UTC
Thanks for the input.

Customer is facing below issue while attempting the last command? Please advise

hammer report-template generate --name 'Host - UUIDs'
Generating Report template failed for: undefined method '#uuid' for Host::Managed::Jail (Host::Managed).


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