Skip to content

Commit abf8d86

Browse files
knoppiJan Bundesmann
andauthored
[PR] Allow to query config reports (SatelliteQE#1407)
- 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. Co-authored-by: Jan Bundesmann <bundesmann@atix.de>
1 parent 3ec0922 commit abf8d86

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
@@ -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)