oslo.limit/doc
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
..
source Add Enforcer.calculate_usage() 2021-06-07 08:47:38 -07:00
requirements.txt Switch to newer openstackdocstheme and reno versions 2020-05-21 13:42:35 +00:00