User report on a content hosts list with consumed subscriptions?

Hi,

Apologies if this is not a new question. I have searched this topic on
several sources but could not find a suitable answer.

What is the recommended way of generating a report with the list of content
host and the subscriptions they consume?

Is this already possible? If not, should I explore:

  1. Direct DB access,
  2. REST API, or
  3. Hammer CLI?

I tried hammer without success.

Any help is appreciated.

Thank you
Best regards,
Rui

Rui,

Nothing I can think of except creating a script using hammer or the API
(please share if you do). I could be missing something though, maybe other
developers or users have a way of doing this.

-John

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

··· On Mon, May 23, 2016 at 7:19 AM, Rui Gouveia wrote:

Hi,

Apologies if this is not a new question. I have searched this topic on
several sources but could not find a suitable answer.

What is the recommended way of generating a report with the list of
content host and the subscriptions they consume?

Is this already possible? If not, should I explore:

  1. Direct DB access,
  2. REST API, or
  3. Hammer CLI?

I tried hammer without success.

Any help is appreciated.

Thank you
Best regards,
Rui


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi John,

Thank you for your reply.

I've found the following already created script:
https://github.com/rgouveia-syone/sat6Inventory

This script helped me realize that the APIs have a complex construct beyond
the first level. For example:

First level:
url = "https://" + satellite + "/katello/api/v2/systems?full=true&page=" +
str(page)

More details:
detailedurl = "https://" + satellite + "/katello/api/v2/systems/" +
system["uuid"] + "/subscriptions"

I've read the REST API Red Hat documentation, and found no reference for
this kind of detail. Where or how can I find documentation on this? Maybe
in the code?

Thank you
Best regards,
Rui

··· On Monday, May 23, 2016 at 12:20:20 PM UTC+1, Rui Gouveia wrote: > > > Hi, > > Apologies if this is not a new question. I have searched this topic on > several sources but could not find a suitable answer. > > What is the recommended way of generating a report with the list of > content host and the subscriptions they consume? > > Is this already possible? If not, should I explore: > > 1. Direct DB access, > 2. REST API, or > 3. Hammer CLI? > > I tried hammer without success. > > Any help is appreciated. > > > Thank you > Best regards, > Rui >

Hello,

sorry for digging up this old question, but it is basically the same thing i was wondering about.
Is there any new solution to this?

But even worse I did not manage to find a button/function in foreman, hammer or an appropriate table in the postgres database to see an output which shows hosts that got a specific subscription.
So I’m not able to check for misconfigured hosts in an efficient way (in terms of wrong product subscriptions). Am I missing something?

Greetings
Known1

How about using report templates engine? See the demo for introduction.
Based on your needs, the existing Subscriptions report may or may not be sufficient, see the definition for the template definition, it’s quite easy to figure what data the report provides. Also registered host report may be handy

1 Like

Thanks Marek!

I wasn’t aware of that function, but in my case i need to write my own Report Template.
Also the current update fixed a few issues for me, so I’m happy.

Greetings
Known1