Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install nova-limits

How to install nova_limits

  1. Download and install ActivePython
  2. Buy and install the Business Edition license from account.activestate.com
  3. Open Command Prompt
  4. Type pypm install nova-limits

nova_limits contains builds that are only available via PyPM when you have a current ActivePython Business Edition subscription.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.1
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
Windows (64-bit)
0.2.1
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
Mac OS X (10.5+)
0.2.1
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
Linux (32-bit)
0.2.1
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
Linux (64-bit)
0.2.1
0.2.1 Available View build log
0.2 Available View build log
0.1 Available View build log
 
License
Apache License (2.0)
Dependencies
Imports

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.

Subscribe to package updates

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.