Foreman api

Is there anyway to return the hosts that are in a hostgroup from the
foreman api?

You will want to use the search function for this task.

For example:

http://192.168.211.218/hosts?search=+hostgroup+%3D++test3groups&format=json

where the name of my host group is test3groups

If you go to the webui and use the search function just add a " &format=json" to the end of the url to see the json results.

Corey Osman

··· On Aug 4, 2011, at 4:27 PM, Luke Baker wrote:

Is there anyway to return the hosts that are in a hostgroup from the
foreman api?


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

Awesome, thanks!

··· On Aug 4, 7:06 pm, Corey Osman wrote: > You will want to use the search function for this task. > > For example: > > http://192.168.211.218/hosts?search=+hostgroup+%3D++test3groups&forma... > > where the name of my host group is test3groups > > If you go to the webui and use the search function just add a " &format=json" to the end of the url to see the json results. > > Corey Osman > > On Aug 4, 2011, at 4:27 PM, Luke Baker wrote: > > > > > > > > > Is there anyway to return the hosts that are in a hostgroup from the > > foreman api? > > > -- > > You received this message because you are subscribed to the Google Groups "Foreman users" group. > > To post to this group, send email to foreman-users@googlegroups.com. > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.