def check_quota(username, identity_id, esh_size, resuming=False): (over_quota, resource, requested, used, allowed) = check_over_quota( username, identity_id, esh_size, resuming=resuming ) if over_quota: raise OverQuotaError(resource, requested, used, allowed) (over_allocation, time_diff) = check_over_allocation(username, identity_id, time_period=settings.FIXED_WINDOW) if over_allocation and not settings.DEBUG: raise OverAllocationError(time_diff)
def check_quota(username, identity_uuid, esh_size, resuming=False): (over_quota, resource, requested, used, allowed) = check_over_quota(username, identity_uuid, esh_size, resuming=resuming) if over_quota and settings.ENFORCING: raise OverQuotaError(resource, requested, used, allowed) (over_allocation, time_diff) =\ check_over_allocation(username, identity_uuid) if over_allocation and settings.ENFORCING: raise OverAllocationError(time_diff)
def check_quota(username, identity_id, esh_size, resuming=False): (over_quota, resource, requested, used, allowed) = check_over_quota(username, identity_id, esh_size, resuming=resuming) if over_quota: raise OverQuotaError(resource, requested, used, allowed) (over_allocation, time_diff) = check_over_allocation(username, identity_id) if over_allocation: raise OverAllocationError(time_diff)
def check_quota(username, identity_id, esh_size, resuming=False): (over_quota, resource, requested, used, allowed) = check_over_quota(username, identity_id, esh_size, resuming=resuming) if over_quota: raise OverQuotaError(resource, requested, used, allowed) (over_allocation, time_diff) =\ check_over_allocation(username, identity_id, time_period=relativedelta(day=1, months=1)) if over_allocation and not settings.DEBUG: raise OverAllocationError(time_diff)
def check_quota(username, identity_id, esh_size, resuming=False): (over_quota, resource, requested, used, allowed) = check_over_quota(username, identity_id, esh_size, resuming=resuming) if over_quota: raise OverQuotaError(resource, requested, used, allowed) (over_allocation, time_diff) =\ check_over_allocation(username, identity_id, time_period=settings.FIXED_WINDOW) if over_allocation and not settings.DEBUG: raise OverAllocationError(time_diff)
def check_quota(username, identity_uuid, esh_size, resuming=False): from service.monitoring import check_over_allocation from service.quota import check_over_quota (over_quota, resource, requested, used, allowed) = check_over_quota(username, identity_uuid, esh_size, resuming=resuming) if over_quota and settings.ENFORCING: raise OverQuotaError(resource, requested, used, allowed) (over_allocation, time_diff) =\ check_over_allocation(username, identity_uuid) if over_allocation and settings.ENFORCING: raise OverAllocationError(time_diff)