But I'm got getting the expected result, here's the log output.
Started PUT "/api/hosts/server123.example.com" for 10.120.134.134 at Wed
Jan 09 18:37:51 -0500 2013
Processing by Api::V1::HostsController#update as JSON
Parameters: {"id"=>"server123.example.com"}
Missing parameter host (Apipie::ParamMissing)
Rendered api/v1/errors/param_error.json.rabl (1.5ms)
Completed 400 Bad Request in 27ms (Views: 2.7ms | ActiveRecord: 8.4ms)
> I need help with updating a host with a new parameter, so far I have this:
>
> curl -s -H "Accept:application/json" -H "Content-Type: application/json"
> -k -u $USER:$PASS -X PUT
>
> '{"host":{"host_parameters_attributes":[{"name":"ntp_server"},{"value":"
> server.example.com"}]}}'
> $FOREMAN_URL/api/hosts/$NAME
>
> But I'm got getting the expected result, here's the log output.
>
> Started PUT "/api/hosts/server123.example.com" for 10.120.134.134 at Wed
> Jan 09 18:37:51 -0500 2013
> Processing by Api::V1::HostsController#update as JSON
> Parameters: {"id"=>"server123.example.com"}
> Missing parameter host (Apipie::ParamMissing)
> Rendered api/v1/errors/param_error.json.rabl (1.5ms)
> Completed 400 Bad Request in 27ms (Views: 2.7ms | ActiveRecord: 8.4ms)
>
>
see https://groups.google.com/group/foreman-users/browse_thread/thread/2dbfdfb0d7502c3b/1a6f10a18f22e5ed?lnk=gst&q=api#1a6f10a18f22e5ed
as a side note, I'm now working on mergeing the new api v2 name space for
parameters, which would make simple crud such as
When is version two of the api expected? I'm using 1.1RC1 and have
generated the API doc.
···
On Thursday, January 10, 2013 3:33:31 AM UTC-5, ohad wrote:
>
>
>
>
> On Thu, Jan 10, 2013 at 1:41 AM, Rodrique Heron <swy...@gmail.com > > wrote:
>
>> I need help with updating a host with a new parameter, so far I have this:
>>
>> curl -s -H "Accept:application/json" -H "Content-Type: application/json" \
>> -k -u $USER:$PASS -X PUT \
>>
>> '{"host":{"host_parameters_attributes":[{"name":"ntp_server"},{"value":"
>> server.example.com"}]}}' \
>> $FOREMAN_URL/api/hosts/$NAME
>>
>> But I'm got getting the expected result, here's the log output.
>>
>> Started PUT "/api/hosts/server123.example.com" for 10.120.134.134 at Wed
>> Jan 09 18:37:51 -0500 2013
>> Processing by Api::V1::HostsController#update as JSON
>> Parameters: {"id"=>"server123.example.com"}
>> Missing parameter host (Apipie::ParamMissing)
>> Rendered api/v1/errors/param_error.json.rabl (1.5ms)
>> Completed 400 Bad Request in 27ms (Views: 2.7ms | ActiveRecord: 8.4ms)
>>
>>
> see
> https://groups.google.com/group/foreman-users/browse_thread/thread/2dbfdfb0d7502c3b/1a6f10a18f22e5ed?lnk=gst&q=api#1a6f10a18f22e5ed
>
> as a side note, I'm now working on mergeing the new api v2 name space for
> parameters, which would make simple crud such as
>
> /host/server123.example.com/parameters
>
> Ohad
>
>> thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Foreman users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/foreman-users/-/1JklmMn1PJ0J.
>> To post to this group, send email to forema...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to
>> foreman-user...@googlegroups.com .
>> For more options, visit this group at
>> http://groups.google.com/group/foreman-users?hl=en.
>>
>
>
The next step is to add similar functionality to the API v2 for nested puppetclasses and lookup_keys
Regards,
Joseph
···
----- Original Message -----
From: "Rodrique Heron"
To: foreman-users@googlegroups.com
Sent: Thursday, January 10, 2013 3:35:34 PM
Subject: Re: [foreman-users] Passing an array to host_parameters_attributes api
Thanks for the Ruby script.
When is version two of the api expected? I’m using 1.1RC1 and have
generated the API doc.
On Thursday, January 10, 2013 3:33:31 AM UTC-5, ohad wrote:
On Thu, Jan 10, 2013 at 1:41 AM, Rodrique Heron <swy...@gmail.com<javascript:> > > wrote:
I need help with updating a host with a new parameter, so far I have this:
But I’m got getting the expected result, here’s the log output.
Started PUT “/api/hosts/server123.example.com” for 10.120.134.134 at Wed
Jan 09 18:37:51 -0500 2013
Processing by Api::V1::HostsController#update as JSON
Parameters: {“id”=>“server123.example.com”}
Missing parameter host (Apipie::ParamMissing)
Rendered api/v1/errors/param_error.json.rabl (1.5ms)
Completed 400 Bad Request in 27ms (Views: 2.7ms | ActiveRecord: 8.4ms)