mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
HostMetric review,migration,permissions
This commit is contained in:
committed by
John Westcott IV
parent
f919178734
commit
e6050804f9
@@ -1556,6 +1556,9 @@ class HostMetricList(ListAPIView):
|
||||
permission_classes = (IsSystemAdminOrAuditor,)
|
||||
search_fields = ('hostname', 'deleted')
|
||||
|
||||
def get_queryset(self):
|
||||
return self.model.objects.all()
|
||||
|
||||
|
||||
class HostMetricDetail(RetrieveDestroyAPIView):
|
||||
name = _("Host Metric Detail")
|
||||
@@ -1572,13 +1575,13 @@ class HostMetricDetail(RetrieveDestroyAPIView):
|
||||
class HostMetricSummaryMonthlyList(ListAPIView):
|
||||
name = _("Host Metrics Summary Monthly")
|
||||
model = models.HostMetricSummaryMonthly
|
||||
permission_classes = (IsSystemAdminOrAuditor,)
|
||||
serializer_class = serializers.HostMetricSummaryMonthlySerializer
|
||||
permission_classes = (IsSystemAdminOrAuditor,)
|
||||
search_fields = ('date',)
|
||||
filter_backends = [HostMetricSummaryMonthlyFieldLookupBackend]
|
||||
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
queryset = self.model.objects.all()
|
||||
past_months = self.request.query_params.get('past_months', None)
|
||||
date_from = self._get_date_from(past_months)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user