diff options
author | Oleksii Baranov <olebaran@redhat.com> | 2023-03-29 19:22:49 +0200 |
---|---|---|
committer | Oleksii Baranov <oleksii.baranov.dev@gmail.com> | 2023-03-30 08:46:17 +0200 |
commit | 598f9e2a5538acce99587551b9adf2440fb9ca2d (patch) | |
tree | aed600a707e9207e6a2f628d3cd523bfdb599fdd /awxkit | |
parent | Merge pull request #13603 from jjwatt/jjwatt-fix-clean-languages (diff) | |
download | awx-598f9e2a5538acce99587551b9adf2440fb9ca2d.tar.xz awx-598f9e2a5538acce99587551b9adf2440fb9ca2d.zip |
Add host_metrics page to the awxkit
Diffstat (limited to 'awxkit')
-rw-r--r-- | awxkit/awxkit/api/pages/__init__.py | 1 | ||||
-rw-r--r-- | awxkit/awxkit/api/pages/host_metrics.py | 18 | ||||
-rw-r--r-- | awxkit/awxkit/api/resources.py | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/awxkit/awxkit/api/pages/__init__.py b/awxkit/awxkit/api/pages/__init__.py index f5587fc211..7fbdbcdb0d 100644 --- a/awxkit/awxkit/api/pages/__init__.py +++ b/awxkit/awxkit/api/pages/__init__.py @@ -42,3 +42,4 @@ from .credential_input_sources import * # NOQA from .metrics import * # NOQA from .subscriptions import * # NOQA from .workflow_approval_templates import * # NOQA +from .host_metrics import * # NOQA diff --git a/awxkit/awxkit/api/pages/host_metrics.py b/awxkit/awxkit/api/pages/host_metrics.py new file mode 100644 index 0000000000..8ff8d9c39b --- /dev/null +++ b/awxkit/awxkit/api/pages/host_metrics.py @@ -0,0 +1,18 @@ +from awxkit.api.resources import resources +from . import base +from . import page + + +class HostMetric(base.Base): + def get(self, **query_parameters): + request = self.connection.get(self.endpoint, query_parameters, headers={'Accept': 'application/json'}) + return self.page_identity(request) + + +class HostMetrics(page.PageList, HostMetric): + pass + + +page.register_page([resources.host_metric], HostMetric) + +page.register_page([resources.host_metrics], HostMetrics) diff --git a/awxkit/awxkit/api/resources.py b/awxkit/awxkit/api/resources.py index 813f4104ee..d453ff4f75 100644 --- a/awxkit/awxkit/api/resources.py +++ b/awxkit/awxkit/api/resources.py @@ -44,6 +44,8 @@ class Resources(object): _groups = 'groups/' _host = r'hosts/\d+/' _host_groups = r'hosts/\d+/groups/' + _host_metrics = 'host_metrics/' + _host_metric = r'host_metrics/\d+/' _host_insights = r'hosts/\d+/insights/' _host_related_ad_hoc_commands = r'hosts/\d+/ad_hoc_commands/' _host_related_fact_version = r'hosts/\d+/fact_versions/\d+/' |