I think most of the discussions have moved to foreman-users+subscribe(a)googlegroups.com
I too would be interested in knowing the answer. I know the hammer cli using -D (or -d
can't remember) supports showing what the json code would look like. And as you said
documentation is sparse which I think is because it's the 'opensource' version
of Satellite 6 which RedHat would like you to buy.
-----Original Message-----
From: katello-bounces(a)lists.fedorahosted.org
[mailto:katello-bounces@lists.fedorahosted.org] On Behalf Of DEvans
Sent: Tuesday, November 10, 2015 10:49 AM
To: katello(a)lists.fedorahosted.org
Subject: Use API to set content view and environment for a single host
Hi,
Can anyone tell me how to set the content view and environment for a single host? I
can't see a way to do it here -
http://www.katello.org/docs/api/apidoc.html.
As a work around I have been trying this -
http://www.katello.org/docs/api/apidoc/systems_bulk_actions/environment_c...,
but that seems like a sledge hammer. If that is the best way of acomplishing the goal
then I have a problem with my code, which looks like
this:
data = {'organization_id': org_id,
'included': {'ids': host_ids},
'content_view_id': cv_id,
'environment_id': lce_id}
json_print(data)
result = json_put('%ssystems/bulk/environment_content_view' % (katello_url),
json.dumps(data))
json_print(result)
And gives this:
{
"content_view_id": 4,
"environment_id": 2,
"included": {
"ids": [
"2"
]
},
"organization_id": 3
}
{
"displayMessage": "Action unauthorized to be performed on selected
systems.",
"errors": [
"Action unauthorized to be performed on selected systems."
]
}
I know my account has permissions to set the cv & env of a single host. Is there
something relating to bulk actions my account might not be enabled for?
Thanks in advance for any assistance.
Regards,
David
--
View this message in context:
http://katello-users.1057820.n5.nabble.com/Use-API-to-set-content-view-an...
Sent from the Katello Users mailing list archive at
Nabble.com.
_______________________________________________
katello mailing list
katello(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/katello