Red Hat Bugzilla – Bug 1192045
Hostgroup - need additional attributes for Katello
Last modified: 2017-02-23 15:32:02 EST
In Katello, we have added a few additional attributes to the hostgroup model to support content source, lifecycle environment and content view. These are currently exposed via the UI (which is based upon UI controllers); however, also need access to set/change them via the API.
Created from redmine issue http://projects.theforeman.org/issues/9218
In [1]: from nailgun import client In [2]: response = client.post('https://qe-blade-16.idmqe.lab.eng.bos.redhat.com/api/v2/hostgroups', auth=('admin', 'changeme'), verify=False, data={'hostgroup': {'name': 'a random name 1', 'lifecycle_environment_id': 1, 'content_view_id': 5, 'environment_id': 10, 'organization_ids': [1]}}) In [3]: response.status_code Out[3]: 200 In [4]: response.json() Out[4]: {u'all_puppetclasses': [], u'ancestry': None, u'architecture_id': None, u'architecture_name': None, u'compute_profile_id': None, u'compute_profile_name': None, u'config_groups': [], u'created_at': u'2015-03-06T19:17:54Z', u'domain_id': None, u'domain_name': None, u'environment_id': 10, u'environment_name': u'KT_Default_Organization_Library_RHEL_70_x86_64_5', u'id': 2, u'locations': [], u'medium_id': None, u'medium_name': None, u'name': u'a random name 1', u'operatingsystem_id': None, u'operatingsystem_name': None, u'organizations': [{u'id': 1, u'name': u'Default Organization', u'title': u'Default Organization'}], u'parameters': [], u'ptable_id': None, u'ptable_name': None, u'puppet_ca_proxy_id': None, u'puppet_proxy_id': None, u'puppetclasses': [], u'realm_id': None, u'realm_name': None, u'subnet_id': None, u'subnet_name': None, u'template_combinations': [], u'title': u'a random name 1', u'updated_at': u'2015-03-06T19:17:54Z'} In [5]: response = client.get('https://qe-blade-16.idmqe.lab.eng.bos.redhat.com/api/v2/hostgroups/2', auth=('admin', 'changeme'), verify=False) In [6]: response.json() Out[6]: {u'all_puppetclasses': [], u'ancestry': None, u'architecture_id': None, u'architecture_name': None, u'compute_profile_id': None, u'compute_profile_name': None, u'config_groups': [], u'created_at': u'2015-03-06T19:17:54Z', u'domain_id': None, u'domain_name': None, u'environment_id': 10, u'environment_name': u'KT_Default_Organization_Library_RHEL_70_x86_64_5', u'id': 2, u'locations': [], u'medium_id': None, u'medium_name': None, u'name': u'a random name 1', u'operatingsystem_id': None, u'operatingsystem_name': None, u'organizations': [{u'id': 1, u'name': u'Default Organization', u'title': u'Default Organization'}], u'parameters': [], u'ptable_id': None, u'ptable_name': None, u'puppet_ca_proxy_id': None, u'puppet_proxy_id': None, u'puppetclasses': [], u'realm_id': None, u'realm_name': None, u'subnet_id': None, u'subnet_name': None, u'template_combinations': [], u'title': u'a random name 1', u'updated_at': u'2015-03-06T19:17:54Z'}
Verified on Satellite-6.1.0-RHEL-6-20150303.0
This bug is slated to be released with Satellite 6.1.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2015:1592