How to "translate" Foreman UI operations into API calls?

Hello all!

Is there a way to see the API equivalent of operations performed through
Foreman UI? Some products (not Foreman-related, but in general) out there
allow users to see that to help with automation efforts, one just has to
enable such functionality with a check box or a flag of some sort. That I
can't find in Foreman as of now :frowning:

I'm not talking about simple things like host search - there are plenty of
examples around, but things like registering a newly provisioned baremetal
as new compute resource (say, "libvirt" type) and then another API call to
register an image on that compute resource with subsequent call to create a
VM with that image. Well, you get the picture, I hope.

If there's a list of such (or other Foreman API calls) examples out there
that I just missed - please let me know.

Thanks in advance!
Konstantin.

Hello,
although there has been some discussions on that topic, we don't have
such feature in the UI yet.

There is our online api documentation that contains some examples and
could help you [1].

Regards
Tomas

[1] http://www.theforeman.org/api_v2.html

··· On 01/15/2015 02:49 AM, 'Konstantin Orekhov' via Foreman users wrote: > Hello all! > > Is there a way to see the API equivalent of operations performed through > Foreman UI? Some products (not Foreman-related, but in general) out > there allow users to see that to help with automation efforts, one just > has to enable such functionality with a check box or a flag of some > sort. That I can't find in Foreman as of now :( > > I'm not talking about simple things like host search - there are plenty > of examples around, but things like registering a newly provisioned > baremetal as new compute resource (say, "libvirt" type) and then another > API call to register an image on that compute resource with subsequent > call to create a VM with that image. Well, you get the picture, I hope. > > If there's a list of such (or other Foreman API calls) examples out > there that I just missed - please let me know. > > Thanks in advance! > Konstantin. >

For the record, 2 things I ended up doing to get more or less complete data
to make my API calls:

  1. run hammer with debug flag on
  2. /var/log/foreman/production.log has a lot of data and responses, but
    it is still great place for seeing all the params Foreman sends through API.