Use plain routes list for os-snapshots instead of stevedore
This patch adds os-snapshots 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: If2f073066fc4df533138409eec6c8ac0dd44d00a
This commit is contained in:
@@ -362,6 +362,10 @@ simple_tenant_usage_controller = functools.partial(_create_controller,
|
||||
simple_tenant_usage.SimpleTenantUsageController, [], [])
|
||||
|
||||
|
||||
snapshots_controller = functools.partial(_create_controller,
|
||||
volumes.SnapshotController, [], [])
|
||||
|
||||
|
||||
tenant_networks_controller = functools.partial(_create_controller,
|
||||
tenant_networks.TenantNetworkController, [], [])
|
||||
|
||||
@@ -697,6 +701,17 @@ ROUTE_LIST = (
|
||||
('/os-simple-tenant-usage/{id}', {
|
||||
'GET': [simple_tenant_usage_controller, 'show']
|
||||
}),
|
||||
('/os-snapshots', {
|
||||
'GET': [snapshots_controller, 'index'],
|
||||
'POST': [snapshots_controller, 'create']
|
||||
}),
|
||||
('/os-snapshots/detail', {
|
||||
'GET': [snapshots_controller, 'detail']
|
||||
}),
|
||||
('/os-snapshots/{id}', {
|
||||
'GET': [snapshots_controller, 'show'],
|
||||
'DELETE': [snapshots_controller, 'delete']
|
||||
}),
|
||||
('/os-tenant-networks', {
|
||||
'GET': [tenant_networks_controller, 'index'],
|
||||
'POST': [tenant_networks_controller, 'create']
|
||||
|
||||
@@ -590,24 +590,3 @@ class SnapshotController(wsgi.Controller):
|
||||
|
||||
retval = _translate_snapshot_detail_view(context, new_snapshot)
|
||||
return {'snapshot': retval}
|
||||
|
||||
|
||||
class Volumes(extensions.V21APIExtensionBase):
|
||||
"""Volumes support."""
|
||||
|
||||
name = "Volumes"
|
||||
alias = ALIAS
|
||||
version = 1
|
||||
|
||||
def get_resources(self):
|
||||
resources = []
|
||||
|
||||
res = extensions.ResourceExtension(
|
||||
'os-snapshots', SnapshotController(),
|
||||
collection_actions={'detail': 'GET'})
|
||||
resources.append(res)
|
||||
|
||||
return resources
|
||||
|
||||
def get_controller_extensions(self):
|
||||
return []
|
||||
|
||||
@@ -74,7 +74,6 @@ wsgi_scripts =
|
||||
nova.api.v21.extensions =
|
||||
extension_info = nova.api.openstack.compute.extension_info:ExtensionInfo
|
||||
versions = nova.api.openstack.compute.versionsV21:Versions
|
||||
volumes = nova.api.openstack.compute.volumes:Volumes
|
||||
|
||||
nova.api.v21.test_extensions =
|
||||
basic = nova.tests.unit.api.openstack.compute.basic:Basic
|
||||
|
||||
Reference in New Issue
Block a user