REST api edit host parameters

Hi,

I would like to use the API to set / edit host parameters for a node in
foreman.
I had a look at the wiki for some examples but cannot get it to work

http://theforeman.org/projects/foreman/wiki/API
http://theforeman.org/projects/smart-proxy/wiki/API

Creating a node works

curl -s -H "Accept:application/json"
-k -u $USER:$PASS
-d "host[name]=$NAME" -d "host[hostgroup_id]=$HOSTGROUP_ID"
$FOREMAN_URL/hosts

How do I set host parameters for node? Any help will be really
appreciated.

··· -- Met vriendelijke groet, Kind Regards,

Martin Willemsma

> Hi,
>
> I would like to use the API to set / edit host parameters for a node in
> foreman.
> I had a look at the wiki for some examples but cannot get it to work
>
> API - Foreman
> API - Smart Proxy - Foreman
>
> Creating a node works
>
> curl -s -H "Accept:application/json"
> -k -u $USER:$PASS
> -d "host[name]=$NAME" -d "host[hostgroup_id]=$HOSTGROUP_ID"
> $FOREMAN_URL/hosts
>
> How do I set host parameters for node? Any help will be really
> appreciated.
>

I've created a simply ruby script to implement both adding new params, and
updating existing ones at [1]

as part of the new api version (v2) we will make param, classes etc updates
much more trivial and rest friendly.

for those of you who already use this api, don't worry, as we've introduced
multiple API versioning, so you could choose which version of the API you
want to you use.

Ohad

[1] https://gist.github.com/4147992

··· On Sun, Nov 25, 2012 at 11:45 PM, Martin Willemsma wrote:


Met vriendelijke groet, Kind Regards,

Martin Willemsma


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.

Thank you, Ohad!

This gives me some ideas on were to start. I ran the script ones and it is
adding 2 params to the nodes host parameters. Just what I needed!

··· 2012/11/26 Ohad Levy

On Sun, Nov 25, 2012 at 11:45 PM, Martin Willemsma mwillemsma@gmail.comwrote:

Hi,

I would like to use the API to set / edit host parameters for a node in
foreman.
I had a look at the wiki for some examples but cannot get it to work

API - Foreman
API - Smart Proxy - Foreman

Creating a node works

curl -s -H “Accept:application/json”
-k -u $USER:$PASS
-d “host[name]=$NAME” -d “host[hostgroup_id]=$HOSTGROUP_ID”
$FOREMAN_URL/hosts

How do I set host parameters for node? Any help will be really
appreciated.

I’ve created a simply ruby script to implement both adding new params, and
updating existing ones at [1]

as part of the new api version (v2) we will make param, classes etc
updates much more trivial and rest friendly.

for those of you who already use this api, don’t worry, as we’ve
introduced multiple API versioning, so you could choose which version of
the API you want to you use.

Ohad

[1] https://gist.github.com/4147992


Met vriendelijke groet, Kind Regards,

Martin Willemsma


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.


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.


Met vriendelijke groet, Kind Regards,

Martin Willemsma