created a new model 'HostMetrics' which will contain the first timestamp and the most recent timestamp of any automation on a given object and Added a new 'awx-manage' command. command : awx-manage host_metrics --since <datetime> --until <datetime>

This commit is contained in:
fedora
2021-04-13 19:42:23 -04:00
parent fb7c827bff
commit c1ea489043
6 changed files with 123 additions and 1 deletions

View File

@@ -803,6 +803,12 @@ class Group(CommonModelNameNotUnique, RelatedJobsMixin):
return UnifiedJob.objects.non_polymorphic().filter(Q(job__inventory=self.inventory) | Q(inventoryupdate__inventory_source__groups=self))
class HostMetric(models.Model):
hostname = models.CharField(primary_key=True, max_length=512)
first_automation = models.DateTimeField(auto_now_add=True, null=False, db_index=True, help_text=_('When the host was first automated against'))
last_automation = models.DateTimeField(db_index=True, help_text=_('When the host was last automated against'))
class InventorySourceOptions(BaseModel):
"""
Common fields for InventorySource and InventoryUpdate.