]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Add quota per-tenant.
authorYong Sheng Gong <gongysh@cn.ibm.com>
Sun, 29 Jul 2012 12:59:55 +0000 (20:59 +0800)
committerYong Sheng Gong <gongysh@cn.ibm.com>
Tue, 14 Aug 2012 15:27:56 +0000 (23:27 +0800)
commit46cac19852b7879daa36962a8643727264a42ff5
tree79bf0155e91214120ce791ec041c150b0445d11c
parent0ec3ef5003e9f5bc4fb30c80c0e689de2cd17a68
Add quota per-tenant.

blueprint quantum-api-quotas

We implement it as an extension for linux bridge and ovs plugins.
We also expose the /quotas/Xx url to client to operate the quota.
We need admin role to show other tenant's quota, and to update quota data.
Any user can show its own tenant's quota. An DB table is used to save the
quota for each tenant.

To use it, we have in quantum.conf:
quota_driver = quantum.extensions._quotav2_driver.DbQuotaDriver

The default quotas for each tenant are defined in quantum.conf too.

In addition, modify extension framework to allow exposing a new resource and
its controler. The extension can check the environment, such as configuration
in global cfg.CONF to decide if it can be enabled.

Also, we can define enabled extensions for each plugin in extensions.py
New resources can be put into quota framework via quota_items in nova.conf

Change-Id: I54d6107fdb2808cdae1a40b501ed8c7f379dedee
12 files changed:
etc/quantum.conf
quantum/api/v2/base.py
quantum/common/exceptions.py
quantum/extensions/_quotav2_driver.py [new file with mode: 0644]
quantum/extensions/_quotav2_model.py [new file with mode: 0644]
quantum/extensions/extensions.py
quantum/extensions/providernet.py
quantum/extensions/quotasv2.py [new file with mode: 0644]
quantum/quota.py
quantum/tests/unit/extensions/v2attributes.py
quantum/tests/unit/test_quota_per_tenant_ext.py [new file with mode: 0644]
quantum/wsgi.py