> I'm trying to populate the comment field while adding a host into Foreman
> via a POST to the API (using API v2 and the python-foreman client).
>
> This POST data works fine:
>
> data = {'operatingsystem_id': 4, 'environment_id': 4, 'ptable_id': 1,
> 'medium_id': 3, 'subnet_id': 1, 'ip': '1.1.1.1', 'hostgroup_id': 10, 'mac':
> u'00:00:00:00:00:00', 'architecture_id': 1, 'domain_id': 2, 'name':
> u'testforeman-1'}
>
> However, when I try to add the comments field in:
>
> data = {'operatingsystem_id': 4, 'environment_id': 4, 'ptable_id': 1,
> 'medium_id': 3, 'subnet_id': 1, 'ip': '1.1.1.1', 'hostgroup_id': 10, 'mac':
> u'00:00:00:00:00:00', 'architecture_id': 1, 'domain_id': 2, 'name':
> u'testforeman-1', 'comments': 'mycomment'}
>
try 'comment' (singular)
Ohad
···
On Tue, Feb 17, 2015 at 10:47 PM, Kyle Flavin wrote:The host still gets created in foreman, but the comment isn’t saved.
In reading over the API, it doesn’t mention “comment” being an allowed
field:
http://theforeman.org/api/apidoc/v2/hosts/create.htmlIt seems strange that I wouldn’t be able to populate it though. Am I
looking in the wrong place?–
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.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.