Limit enforcement library to assist with quota calculation.
Go to file
Dan Smith 1175b0f7c1 Add Enforcer.calculate_usage()
In multiple situations, it is necessary to be able to probe the limits
set for a project without actually enforcing. Examples:

1. Exposing a usage API where we want to not only report the current
   usage, but the limit as well. Otherwise clients have to do their
   own calls to keystone and correlation to get a single integer
   limit value, which we should be able to expose for them.
2. When checking quota as part of a long-running process of consuming
   an unbounded data stream, we need to be able to determine how much
   quota remains so that we can stop the transfer if we exceed the
   limit. Without this, we have to periodically call to keystone
   during the transfer, which is expensive and could fail.

This patch adds a calculate_usage() method to the Enforcer which
calculates the usage using the enforcement model and returns a
mapping of resource names to namedtuples that contain limit and usage
information.

Change-Id: Ic0632cc5ec52aefb85a04f879651963bfa54dcbe
2021-06-07 08:47:38 -07:00
doc Add Enforcer.calculate_usage() 2021-06-07 08:47:38 -07:00
oslo_limit Add Enforcer.calculate_usage() 2021-06-07 08:47:38 -07:00
releasenotes Merge "remove unicode from code" 2021-04-16 10:43:42 +00:00
.coveragerc Init repo 2018-05-17 18:06:06 +08:00
.gitignore ignore reno generated artifacts 2020-03-03 14:52:45 +01:00
.gitreview OpenDev Migration Patch 2019-04-19 19:29:49 +00:00
.mailmap Init repo 2018-05-17 18:06:06 +08:00
.pre-commit-config.yaml Upgrade the pre-commit-hooks version 2021-05-18 11:11:24 +08:00
.stestr.conf Init repo 2018-05-17 18:06:06 +08:00
.zuul.yaml Add Python3 xena unit tests 2021-04-15 18:18:02 +01:00
CONTRIBUTING.rst Align contributing doc with oslo's policy 2020-05-04 18:24:13 +02:00
HACKING.rst Update url in HACKING.rst 2018-06-21 21:39:22 +08:00
LICENSE Init repo 2018-05-17 18:06:06 +08:00
README.rst Replace git.openstack.org URLs with opendev.org URLs 2019-04-23 06:30:33 +00:00
requirements.txt drop use of six 2020-03-02 14:58:28 +01:00
setup.cfg add py38 matedata 2020-12-02 13:17:44 +08:00
setup.py remove outdated header 2020-02-11 18:53:20 +01:00
test-requirements.txt Fix hacking min version to 3.0.1 2020-10-16 01:19:54 +00:00
tox.ini Merge "Use TOX_CONSTRAINTS_FILE" 2021-04-16 13:10:56 +00:00

README.rst

Team and repository tags

image

oslo.limit

Latest Version

Downloads

Oslo.limit is the limit enforcement library to assist with quota calculation. It aims to provide support for quota enforcement across all OpenStack services.