def cpu_usage(self, request, project_id, cluster_id): data = self.get_validated_data(request) result = prometheus.get_pod_cpu_usage_range(cluster_id, data["res_id_list"], data["start_at"], data["end_at"]) return response.Response(result)
def cpu_usage(self, request, project_id, cluster_id): slz = serializers.PromPodMetricSLZ(data=request.GET) slz.is_valid(raise_exception=True) data = slz.validated_data result = prometheus.get_pod_cpu_usage_range(cluster_id, data['res_id_list'], data['start_at'], data['end_at']) return response.Response(result)