summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorChris Yeoh <cyeoh@au1.ibm.com>2013-06-07 12:57:30 +0930
committerChris Yeoh <cyeoh@au1.ibm.com>2013-06-07 12:57:30 +0930
commit6c2c9bee8c43ac557c627bae62dfb902a5e3ca71 (patch)
treeba87438721774285313f45d1de95ba6224a01040 /nova/api
parent37cf3b63b4fc4bb9a5951a500cbebfbf9e238676 (diff)
downloadnova-6c2c9bee8c43ac557c627bae62dfb902a5e3ca71.tar.gz
nova-6c2c9bee8c43ac557c627bae62dfb902a5e3ca71.tar.xz
nova-6c2c9bee8c43ac557c627bae62dfb902a5e3ca71.zip
Port evacuate API to v3 Part 2
This patch contains the changes required to adapt the evacuate extension and the corresponding unittest to the v3 framework Partially implements blueprint nova-v3-api Change-Id: Id9ca6a7a92a087cb063fe265af1ad6a626c63510
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/plugins/v3/evacuate.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/nova/api/openstack/compute/plugins/v3/evacuate.py b/nova/api/openstack/compute/plugins/v3/evacuate.py
index 7eee99ed1..86e90e03e 100644
--- a/nova/api/openstack/compute/plugins/v3/evacuate.py
+++ b/nova/api/openstack/compute/plugins/v3/evacuate.py
@@ -25,12 +25,13 @@ from nova.openstack.common import strutils
from nova import utils
LOG = logging.getLogger(__name__)
-authorize = extensions.extension_authorizer('compute', 'evacuate')
+ALIAS = "os-evacuate"
+authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
-class Controller(wsgi.Controller):
+class EvacuateController(wsgi.Controller):
def __init__(self, *args, **kwargs):
- super(Controller, self).__init__(*args, **kwargs)
+ super(EvacuateController, self).__init__(*args, **kwargs)
self.compute_api = compute.API()
@wsgi.action('evacuate')
@@ -83,15 +84,18 @@ class Controller(wsgi.Controller):
return {'adminPass': password}
-class Evacuate(extensions.ExtensionDescriptor):
+class Evacuate(extensions.V3APIExtensionBase):
"""Enables server evacuation."""
name = "Evacuate"
- alias = "os-evacuate"
- namespace = "http://docs.openstack.org/compute/ext/evacuate/api/v2"
- updated = "2013-01-06T00:00:00+00:00"
+ alias = ALIAS
+ namespace = "http://docs.openstack.org/compute/ext/evacuate/api/v3"
+ version = 1
+
+ def get_resources(self):
+ return []
def get_controller_extensions(self):
- controller = Controller()
+ controller = EvacuateController()
extension = extensions.ControllerExtension(self, 'servers', controller)
return [extension]