Skip to content

Commit 48cd98e

Browse files
author
Jan Bundesmann
committed
[PR] Allow to query config reports
- New class for reading API endpoint config_reports - Entities are deletable, readable and searchable Note: The JSON response contains host_name unlike host in the response of the legacy reports API.
1 parent b557cfc commit 48cd98e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

nailgun/entities.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,19 @@ def associate(self, synchronous=True, timeout=None, **kwargs):
13571357
return _handle_response(response, self._server_config, synchronous, timeout)
13581358

13591359

1360+
class ConfigReport(Entity, EntityDeleteMixin, EntityReadMixin, EntitySearchMixin):
1361+
"""A representation of a Report entity."""
1362+
1363+
def __init__(self, server_config=None, **kwargs):
1364+
self._fields = {
1365+
'host_name': entity_fields.StringField(required=True),
1366+
'logs': entity_fields.ListField(),
1367+
'reported_at': entity_fields.DateTimeField(required=True),
1368+
}
1369+
self._meta = {'api_path': 'api/v2/config_reports'}
1370+
super().__init__(server_config=server_config, **kwargs)
1371+
1372+
13601373
class DiscoveredHost(
13611374
Entity,
13621375
EntityCreateMixin,

0 commit comments

Comments
 (0)