1175b0f7c1
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 |
||
---|---|---|
doc | ||
oslo_limit | ||
releasenotes | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.pre-commit-config.yaml | ||
.stestr.conf | ||
.zuul.yaml | ||
CONTRIBUTING.rst | ||
HACKING.rst | ||
LICENSE | ||
README.rst | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
README.rst
Team and repository tags
oslo.limit
Oslo.limit is the limit enforcement library to assist with quota calculation. It aims to provide support for quota enforcement across all OpenStack services.
- Free software: Apache license
- Documentation: https://docs.openstack.org/oslo.limit/latest/
- Source: http://opendev.org/openstack/oslo.limit
- Bugs: http://bugs.launchpad.net/oslo.limit