Skip to content

Commit 12f9258

Browse files
Satellite-QEknoppiJan Bundesmann
authored
[PR] Allow to query config reports (#1407) (#1411)
- 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. (cherry picked from commit abf8d86) Co-authored-by: Jan Bundesmann <github@knofafo.de> Co-authored-by: Jan Bundesmann <bundesmann@atix.de>
1 parent 4936557 commit 12f9258

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
@@ -1291,6 +1291,19 @@ def associate(self, synchronous=True, timeout=None, **kwargs):
12911291
return _handle_response(response, self._server_config, synchronous, timeout)
12921292

12931293

1294+
class ConfigReport(Entity, EntityDeleteMixin, EntityReadMixin, EntitySearchMixin):
1295+
"""A representation of a Report entity."""
1296+
1297+
def __init__(self, server_config=None, **kwargs):
1298+
self._fields = {
1299+
'host_name': entity_fields.StringField(required=True),
1300+
'logs': entity_fields.ListField(),
1301+
'reported_at': entity_fields.DateTimeField(required=True),
1302+
}
1303+
self._meta = {'api_path': 'api/v2/config_reports'}
1304+
super().__init__(server_config=server_config, **kwargs)
1305+
1306+
12941307
class DiscoveredHost(
12951308
Entity,
12961309
EntityCreateMixin,

0 commit comments

Comments
 (0)