def get(self, request, format=None):
        self._check_user(request)

        auth_url = request.query_params.get('auth_url')
        # TODO: auth_url should be coming as a reference to NodeConductor object. Consider introducing this concept.
        if auth_url is None:
            return Response(
                {'detail': 'GET parameter "auth_url" has to be defined'},
                status=status.HTTP_400_BAD_REQUEST,
            )

        cloud = models.Cloud.objects.filter(auth_url=auth_url).first()

        if cloud is None:
            return Response(
                {'detail': 'No clouds with auth url: %s' % auth_url},
                status=status.HTTP_400_BAD_REQUEST,
            )

        memberships = models.CloudProjectMembership.objects.filter(cloud__auth_url=auth_url)
        quota_values = models.CloudProjectMembership.get_sum_of_quotas_as_dict(
            memberships, ('vcpu', 'ram', 'storage'), fields=['limit'])
        # for backward compatibility we need to use this names:
        quota_stats = {
            'vcpu_quota': quota_values['vcpu'],
            'storage_quota': quota_values['storage'],
            'memory_quota': quota_values['ram'],
        }

        stats = cloud.get_statistics()
        stats.update(quota_stats)

        return Response(sort_dict(stats), status=status.HTTP_200_OK)
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/iaas/views.py/ResourceStatsView.get/original