summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-06-25 16:07:23 +0800
committerHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-06-26 12:54:40 +0800
commit7696c3c11f0de855cbc53cc04ee7d2be07ae3b9c (patch)
treea76b6ebdeff79120fa77026d4e2e9303ac56cb17 /nova/api
parenta4f3d0b58356f734bca8629007c6662368f453bc (diff)
Port quota API into v3 part2
This patch contains the changes required to adapt the service extension and the corresponding unittest to the v3 framework Partially implements bp v3-api-extension-versioning Change-Id: If5438d5bef5da1832e81c0b80523f9f419d5e3d5
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/plugins/v3/quota_sets.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/nova/api/openstack/compute/plugins/v3/quota_sets.py b/nova/api/openstack/compute/plugins/v3/quota_sets.py
index a0740ebe5..67af5d127 100644
--- a/nova/api/openstack/compute/plugins/v3/quota_sets.py
+++ b/nova/api/openstack/compute/plugins/v3/quota_sets.py
@@ -28,14 +28,18 @@ from nova.openstack.common import strutils
from nova import quota
+ALIAS = "os-quota-sets"
QUOTAS = quota.QUOTAS
LOG = logging.getLogger(__name__)
NON_QUOTA_KEYS = ['tenant_id', 'id', 'force']
-authorize_update = extensions.extension_authorizer('compute', 'quotas:update')
-authorize_show = extensions.extension_authorizer('compute', 'quotas:show')
-authorize_delete = extensions.extension_authorizer('compute', 'quotas:delete')
+authorize_update = extensions.extension_authorizer('compute',
+ 'v3:%s:update' % ALIAS)
+authorize_show = extensions.extension_authorizer('compute',
+ 'v3:%s:show' % ALIAS)
+authorize_delete = extensions.extension_authorizer('compute',
+ 'v3:%s:delete' % ALIAS)
class QuotaTemplate(xmlutil.TemplateBuilder):
@@ -188,20 +192,23 @@ class QuotaSetsController(object):
raise webob.exc.HTTPNotFound()
-class Quotas(extensions.ExtensionDescriptor):
+class QuotaSets(extensions.V3APIExtensionBase):
"""Quotas management support."""
name = "Quotas"
- alias = "os-quota-sets"
- namespace = "http://docs.openstack.org/compute/ext/quotas-sets/api/v1.1"
- updated = "2011-08-08T00:00:00+00:00"
+ alias = ALIAS
+ namespace = "http://docs.openstack.org/compute/ext/os-quotas-sets/api/v3"
+ version = 1
def get_resources(self):
resources = []
- res = extensions.ResourceExtension('os-quota-sets',
+ res = extensions.ResourceExtension(ALIAS,
QuotaSetsController(self.ext_mgr),
member_actions={'defaults': 'GET'})
resources.append(res)
return resources
+
+ def get_controller_extensions(self):
+ return []