Example #1
0
    def index(self, req, tenant_id):
        """
        Return all absolute and rate limit information.
        """
        quotas = QUOTAS.get_all_quotas_by_tenant(tenant_id)
        abs_limits = dict((k, v['hard_limit']) for k, v in quotas.items())
        rate_limits = req.environ.get("reddwarf.limits", [])

        return wsgi.Result(views.LimitViews(abs_limits,
                                            rate_limits).data(), 200)
Example #2
0
    def index(self, req, tenant_id):
        """
        Return all absolute and rate limit information.
        """
        quotas = QUOTAS.get_all_quotas_by_tenant(tenant_id)
        abs_limits = dict((k, v['hard_limit']) for k, v in quotas.items())
        rate_limits = req.environ.get("reddwarf.limits", [])

        return wsgi.Result(
            views.LimitViews(abs_limits, rate_limits).data(), 200)
Example #3
0
 def show(self, req, tenant_id, id):
     """Return all quotas for this tenant."""
     LOG.info(_("req : '%s'\n\n") % req)
     LOG.info(_("Indexing quota info for tenant '%s'") % id)
     quotas = quota_engine.get_all_quotas_by_tenant(id)
     return wsgi.Result(views.QuotaView(quotas).data(), 200)