Example #1
0
 def cpu_usage(self, request, project_id, cluster_id):
     data = self.get_validated_data(request)
     result = prometheus.get_node_cpu_usage_range(cluster_id,
                                                  data["res_id"],
                                                  data["start_at"],
                                                  data["end_at"])
     return response.Response(result)
Example #2
0
 def cpu_usage(self, request, project_id, cluster_id):
     slz = serializers.MetricSLZ(data=request.GET)
     slz.is_valid(raise_exception=True)
     data = slz.validated_data
     result = prometheus.get_node_cpu_usage_range(cluster_id,
                                                  data['res_id'],
                                                  data['start_at'],
                                                  data['end_at'])
     return response.Response(result)