diff --git a/nailgun/entities.py b/nailgun/entities.py index 45688dfb..c659ea43 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -7669,7 +7669,7 @@ def __init__(self, server_config=None, **kwargs): def path(self, which=None): """Extend ``nailgun.entity_mixins.Entity.path``.""" - if which in ("enable_connector",): + if which in ("enable_connector", "advisor_engine_config"): return f'{super().path(which="base")}/{which}' return super().path(which) @@ -7683,6 +7683,13 @@ def enable_connector(self, synchronous=True, timeout=None, **kwargs): response = client.post(self.path('enable_connector'), **kwargs) return _handle_response(response, self._server_config, synchronous, timeout) + def advisor_engine_config(self, synchronous=True, timeout=None, **kwargs): + """Get advisor engine configuration information.""" + kwargs = kwargs.copy() + kwargs.update(self._server_config.get_client_kwargs()) + response = client.get(self.path('advisor_engine_config'), **kwargs) + return _handle_response(response, self._server_config, synchronous, timeout) + class RoleLDAPGroups(Entity): """A representation of a Role LDAP Groups entity.""" diff --git a/tests/test_entities.py b/tests/test_entities.py index ea965310..ccb81238 100644 --- a/tests/test_entities.py +++ b/tests/test_entities.py @@ -395,6 +395,7 @@ def test_noid_and_which(self): (entities.ForemanTask, 'bulk_search'), (entities.ForemanTask, 'summary'), (entities.RHCloud, 'enable_connector'), + (entities.RHCloud, 'advisor_engine_config'), (entities.Template, 'imports'), (entities.Template, 'exports'), ): @@ -2225,6 +2226,7 @@ def setUpClass(cls): 'post', {'organization_id': 1, 'location_id': 2}, ), + (entities.RHCloud(**plain_taxonomy).advisor_engine_config, 'get', {}), (entities.Snapshot(**snapshot).revert, 'put', {}), )