Hello folks, I'm working on an API script for foreman 1.1 which will add
additional interfaces for a host.
per Ohad's direction I was roughly following this:
I get it to add an interface but the only attribute I can set successfully
is the MAC
I've been searching around the codebase for the proper param names for
name, domain_id etc but my return value for my api call shows mostly nil
values:
> Hello folks, I'm working on an API script for foreman 1.1 which will add
> additional interfaces for a host.
>
> per Ohad's direction I was roughly following this:
> https://gist.github.com/ohadlevy/4147992
>
> I get it to add an interface but the only attribute I can set successfully
> is the MAC
>
> I've been searching around the codebase for the proper param names for
> name, domain_id etc but my return value for my api call shows mostly nil
> values:
>
> [{"subnet_id"=>nil, "updated_at"=>"2013-04-28T01:26:02Z",
> "host_id"=>10406, "mac"=>"06:54:9e:00:0a:d9", "name"=>nil, "attrs"=>nil,
> "id"=>19, "ip"=>nil, "created_at"=>"2013-04-28T01:26:02Z",
> "domain_id"=>nil}]
>
> my code: http://pastie.org/7731241
>
> any suggestions?
>
what do you see in foreman logs?
Ohad
···
On Sun, Apr 28, 2013 at 4:32 AM, Brian Galura wrote:
Started PUT "/hosts/bgtest4..com" for 10.22.6.154 at Sun Apr 28 12:58:34
-0700 2013
Processing by HostsController#update as JSON
Parameters:
{"host"=>{"interfaces_attributes"=>{"1"=>{"domain_id"=>"2688",
"subnet_id"=>"1", "nested"=>"true", "name"=>"bgtest-1-1.cs..com",
"mac"=>"06:54:9e:00:0a:d9", "ip"=>"10.229.69.80", "domain"=>"cs."}}},
"id"=>"bgtest4.cs..com"}
Authorized user apiuser(api user)
Completed 200 OK in 416ms (Views: 5.0ms | ActiveRecord: 121.8ms)
Started GET "/hosts/bgtest4..com" for 10.22.6.154 at Sun Apr 28 12:58:34
-0700 2013
Processing by HostsController#show as JSON
Parameters: {"id"=>"bgtest4.cs..com"}
Authorized user apiuser(api user)
···
On Sun, Apr 28, 2013 at 12:50 PM, Ohad Levy wrote:
On Sun, Apr 28, 2013 at 4:32 AM, Brian Galura bgalura@gmail.com wrote:
Hello folks, I’m working on an API script for foreman 1.1 which will add
additional interfaces for a host.
I get it to add an interface but the only attribute I can set
successfully is the MAC
I’ve been searching around the codebase for the proper param names for
name, domain_id etc but my return value for my api call shows mostly nil
values:
–
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
···
On Sunday, April 28, 2013 10:00:30 PM UTC+2, Brian Galura wrote:
>
> Started PUT "/hosts/bgtest4.*.com" for 10.22.6.154 at Sun Apr 28 12:58:34
> -0700 2013
> Processing by HostsController#update as JSON
> Parameters:
> {"host"=>{"interfaces_attributes"=>{"1"=>{"domain_id"=>"2688",
> "subnet_id"=>"1", "nested"=>"true", "name"=>"bgtest-1-1.cs.*.com",
> "mac"=>"06:54:9e:00:0a:d9", "ip"=>"10.229.69.80", "domain"=>"cs.*"}}},
> "id"=>"bgtest4.cs.*.com"}
> Authorized user apiuser(api user)
> Completed 200 OK in 416ms (Views: 5.0ms | ActiveRecord: 121.8ms)
>
>
> Started GET "/hosts/bgtest4.*.com" for 10.22.6.154 at Sun Apr 28 12:58:34
> -0700 2013
> Processing by HostsController#show as JSON
> Parameters: {"id"=>"bgtest4.cs.*.com"}
> Authorized user apiuser(api user)
>
>
>
> On Sun, Apr 28, 2013 at 12:50 PM, Ohad Levy <ohad...@gmail.com > > wrote:
>
>>
>>
>> On Sun, Apr 28, 2013 at 4:32 AM, Brian Galura <bga...@gmail.com >> > wrote:
>>
>>> Hello folks, I'm working on an API script for foreman 1.1 which will add
>>> additional interfaces for a host.
>>>
>>> per Ohad's direction I was roughly following this:
>>> https://gist.github.com/ohadlevy/4147992
>>>
>>> I get it to add an interface but the only attribute I can set
>>> successfully is the MAC
>>>
>>> I've been searching around the codebase for the proper param names for
>>> name, domain_id etc but my return value for my api call shows mostly nil
>>> values:
>>>
>>> [{"subnet_id"=>nil, "updated_at"=>"2013-04-28T01:26:02Z",
>>> "host_id"=>10406, "mac"=>"06:54:9e:00:0a:d9", "name"=>nil, "attrs"=>nil,
>>> "id"=>19, "ip"=>nil, "created_at"=>"2013-04-28T01:26:02Z",
>>> "domain_id"=>nil}]
>>>
>>> my code: http://pastie.org/7731241
>>>
>>> any suggestions?
>>>
>> what do you see in foreman logs?
>>
>> Ohad
>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Foreman users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to foreman-user...@googlegroups.com .
>>>
>>> To post to this group, send email to forema...@googlegroups.com
>>> .
>>> Visit this group at http://groups.google.com/group/foreman-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Foreman users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/foreman-users/ZQ9ogBDfYvU/unsubscribe?hl=en
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> foreman-user...@googlegroups.com .
>> To post to this group, send email to forema...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/foreman-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
On Sunday, April 28, 2013 10:00:30 PM UTC+2, Brian Galura wrote:
Started PUT “/hosts/bgtest4..com" for 10.22.6.154 at Sun Apr 28 12:58:34
-0700 2013
Processing by HostsController#update as JSON
Parameters: {“host”=>{“interfaces_**attributes”=>{“1”=>{“domain_**id”=>“2688”,
“subnet_id”=>“1”, “nested”=>“true”, “name”=>"bgtest-1-1.cs..com”,
“mac”=>“06:54:9e:00:0a:d9”, “ip”=>“10.229.69.80”, “domain”=>“cs."}}},
“id”=>"bgtest4.cs..com”}
Authorized user apiuser(api user)
Completed 200 OK in 416ms (Views: 5.0ms | ActiveRecord: 121.8ms)
Started GET “/hosts/bgtest4..com" for 10.22.6.154 at Sun Apr 28 12:58:34
-0700 2013
Processing by HostsController#show as JSON
Parameters: {“id”=>"bgtest4.cs..com”}
Authorized user apiuser(api user)
On Sun, Apr 28, 2013 at 12:50 PM, Ohad Levy ohad...@gmail.com wrote:
On Sun, Apr 28, 2013 at 4:32 AM, Brian Galura bga...@gmail.com wrote:
Hello folks, I’m working on an API script for foreman 1.1 which will
add additional interfaces for a host.
I get it to add an interface but the only attribute I can set
successfully is the MAC
I’ve been searching around the codebase for the proper param names for
name, domain_id etc but my return value for my api call shows mostly nil
values:
–
You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user…@**googlegroups.com.