oslo.limit/doc/source
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
..
contributor Init repo 2018-05-17 18:06:06 +08:00
install fix doc gate 2018-08-14 11:50:08 -04:00
reference Render API reference documentation 2018-09-24 13:23:00 +00:00
user Add Enforcer.calculate_usage() 2021-06-07 08:47:38 -07:00
conf.py remove unicode from code 2021-01-03 16:06:59 +08:00
index.rst Add release notes links to doc index 2020-04-16 17:22:36 +02:00