Skip to content

Commit

Permalink
Add RHCloud.advisor_engine_config API
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapaioa committed Feb 11, 2025
1 parent c6af40e commit e17d665
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -7630,7 +7630,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)

Expand All @@ -7644,6 +7644,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."""
Expand Down
2 changes: 2 additions & 0 deletions tests/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,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'),
):
Expand Down Expand Up @@ -2222,6 +2223,7 @@ def setUpClass(cls):
'post',
{'organization_id': 1, 'location_id': 2},
),
(entities.RHCloud().advisor_engine_config, 'get', {}),
(entities.Snapshot(**snapshot).revert, 'put', {}),
)

Expand Down

0 comments on commit e17d665

Please sign in to comment.