On Nov 21, 8:29 am, Ohad Levy <ohadl...@gmail.com> wrote: > CC foreman users list. > > 2011/11/20 Poul Sørensen <poulhsoren...@gmail.com>: > > > I am trying to create a hostgroup using the Foreman API > > > > POST /hostgroups > > > > {"name":"api-created-hostgroup",...","puppetmaster":"puppet.dev.somewhere.com",...} > > > which returns a 422-error > > Failed to save: Name can't be blank or contain trailing white spaces. > > it looks like you are missing the hostgroup parameter hash, afair, if > you look at the look, all attributes are values of the key hostgroup.
Wrapping the request-body as "{ hostgroup => $body }" surely solved the problem. For some reason, I've missed it in the doc, where it actually is very clear http://theforeman.org/projects/foreman/wiki/API > btw: 0.4. has been released and has a lot of enchantments in the api > area, might worth upgrading. System upgraded earlier today... Thanks for a swift response! regards Poul -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.