Skip to content

Commit 35145c2

Browse files
Satellite-QEknoppiJan Bundesmann
authored
[PR] Allow to query config reports (#1407) (#1410)
- 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 80db4f0 commit 35145c2

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

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)