Forman API: How to get "Reported at"

Hi,
Using foreman api, I am trying to list all facts with field "Reported
at" as Foreman UI is displaying.
e.g. call to "https://foreman.com/api/fact_values?search=fact_name" deosn't
return "Reported at" as it is display in foreman UI.

Any help/suggestion would be greatly appreciated.

Thanks,

Chetan

Hi,
it seems the API does not return the "Reported at" field for facts. Feel
free to file a feature request at [1].

Sorry I couldn't be more of a help,
O.

[1] Issues - Foreman

··· On Wed, Nov 8, 2017 at 10:43 PM, wrote:

Hi,
Using foreman api, I am trying to list all facts with field “Reported
at” as Foreman UI is displaying.
e.g. call to “https://foreman.com/api/fact_values?search=fact_name
deosn’t return “Reported at” as it is display in foreman UI.

Any help/suggestion would be greatly appreciated.

Thanks,

Chetan


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.

To follow up on that, the Reported At field is a property of the host in
Foreman, it's not a fact. It's the time Foreman last received a report
from Puppet (or Chef, Ansible, etc) about this host.

You can get the last report for a given host using something like:

$ curl -k -u user:pass
'https://topaz/api/v2/hosts/<host id>/reports/last'
>json_pp | grep "reported_at"

Hope that helps.

Greg