Use API to set content view and environment for a single host
by DEvans
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.
8 years, 5 months