Nova-specific rate-limit class for turnstile
Project description
This package provides the nova_limits Python module, which contains the nova_preprocess() preprocessor, the nova_postprocess() postprocessor, the NovaClassLimit limit class, and the nova_formatter() replacement delay formatter, all for use with Turnstile. These pieces work together to provide class-based rate limiting integration with nova. To use, you must configure the Turnstile middleware with the following configuration:
[filter:turnstile] use = egg:turnstile#turnstile enable = nova_limits formatter = nova_limits redis.host = <your Redis database host>
Then, simply use the nova_limits rate limit class in your limits configuration.
Using NovaClassLimit
In addition to the other attributes provided by turnstile.limits:Limit, the NovaClassLimit limit class provides one additional required argument: the rate_class. Each tenant is associated with a given rate-limit class through the Redis database. (If no such association is present, the rate-limit class for a tenant is default.) Setting rate_class on NovaClassLimit restricts the limiting action to only those tenants in the given rate-limit class.
Also note that, for nova, the URIs used in configuring rate limiting must include the version identifier, i.e., “/v2/{tenant}/servers/detail”.
Quota Classes
If the discovered nova context supports quota classes–that is, if the context object has the quota_class attribute–the quota class for the context will be set to be the same as the selected rate limit class.
Mapping Tenants to Rate Limit Classes
A limit_class command is provided to control the mapping of the tenant ID to the rate limit class. A usage summary follows:
usage: limit_class [-h] [--debug] [--class KLASS] config tenant_id
Set up or query limit classes associated with tenants.
positional arguments:
config Name of the configuration file, for connecting to the
Redis database.
tenant_id ID of the tenant.
optional arguments:
-h, --help show this help message and exit
--debug, -d Run the tool in debug mode.
--class KLASS, -c KLASS
If specified, sets the class associated with the given
tenant ID.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file nova_limits-0.7.0b1.tar.gz.
File metadata
- Download URL: nova_limits-0.7.0b1.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d05702fd7c30645a1125b174cc12f92d0da0d4ba3ca8970822cf3327e1269ae0
|
|
| MD5 |
d6f67eec86290a737de87386d9ce3511
|
|
| BLAKE2b-256 |
148366ee42cb84be77832071327f426505c2c4690dcc76c54c52087db6a1a5c5
|