summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-24 16:21:59 +0000
committerGerrit Code Review <review@openstack.org>2013-06-24 16:21:59 +0000
commitc91d73074aa204b9ff20649ce5a499c87099009f (patch)
tree221eeb6da2f24df0bcbbe5814ba7e91d7d15f294 /nova/api
parentf24f1f9b95747b6ac992e88a3d432f9bd505b8be (diff)
parent6c2c9bee8c43ac557c627bae62dfb902a5e3ca71 (diff)
downloadnova-c91d73074aa204b9ff20649ce5a499c87099009f.tar.gz
nova-c91d73074aa204b9ff20649ce5a499c87099009f.tar.xz
nova-c91d73074aa204b9ff20649ce5a499c87099009f.zip
Merge "Port evacuate API to v3 Part 2"
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]