Use plain routes list for os-volumes instead of stevedore
This patch adds os-volumes related routes by a plain list, instead of using stevedore. After all the Nova API endpoints moves to the plain routes list, the usage of stevedore for API loading will be removed from Nova. Partial-implement-blueprint api-no-more-extensions-pike Change-Id: Ie76ef6c78cf1d97629cdfa3ffc314a21cd4ddb69
This commit is contained in:
@@ -91,6 +91,7 @@ from nova.api.openstack.compute import suspend_server
|
||||
from nova.api.openstack.compute import tenant_networks
|
||||
from nova.api.openstack.compute import used_limits
|
||||
from nova.api.openstack.compute import virtual_interfaces
|
||||
from nova.api.openstack.compute import volumes
|
||||
from nova.api.openstack import wsgi
|
||||
import nova.conf
|
||||
|
||||
@@ -365,6 +366,10 @@ virtual_interfaces_controller = functools.partial(_create_controller,
|
||||
virtual_interfaces.ServerVirtualInterfaceController, [], [])
|
||||
|
||||
|
||||
volumes_controller = functools.partial(_create_controller,
|
||||
volumes.VolumeController, [], [])
|
||||
|
||||
|
||||
# NOTE(alex_xu): This is structure of this route list as below:
|
||||
# (
|
||||
# ('Route path': {
|
||||
@@ -696,6 +701,17 @@ ROUTE_LIST = (
|
||||
'GET': [tenant_networks_controller, 'show'],
|
||||
'DELETE': [tenant_networks_controller, 'delete']
|
||||
}),
|
||||
('/os-volumes', {
|
||||
'GET': [volumes_controller, 'index'],
|
||||
'POST': [volumes_controller, 'create'],
|
||||
}),
|
||||
('/os-volumes/detail', {
|
||||
'GET': [volumes_controller, 'detail'],
|
||||
}),
|
||||
('/os-volumes/{id}', {
|
||||
'GET': [volumes_controller, 'show'],
|
||||
'DELETE': [volumes_controller, 'delete']
|
||||
}),
|
||||
('/os-volumes_boot', {
|
||||
'GET': [server_controller, 'index'],
|
||||
'POST': [server_controller, 'create']
|
||||
|
||||
@@ -602,10 +602,6 @@ class Volumes(extensions.V21APIExtensionBase):
|
||||
def get_resources(self):
|
||||
resources = []
|
||||
|
||||
res = extensions.ResourceExtension(
|
||||
ALIAS, VolumeController(), collection_actions={'detail': 'GET'})
|
||||
resources.append(res)
|
||||
|
||||
res = extensions.ResourceExtension('os-volume_attachments',
|
||||
VolumeAttachmentController(),
|
||||
parent=dict(
|
||||
|
||||
Reference in New Issue
Block a user