Use plain routes list for os-certificates endpoint instead of stevedore

This patch adds os-certificates 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: I5ea28983bddbc615cb5e8613d25367341cdef0de
This commit is contained in:
jichenjc
2017-04-27 19:24:12 +08:00
committed by He Jie Xu
parent 99bd33402e
commit 50a9d305c8
3 changed files with 11 additions and 21 deletions
@@ -17,8 +17,6 @@ import webob.exc
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
ALIAS = "os-certificates"
class CertificatesController(wsgi.Controller):
"""The x509 Certificates API controller for the OpenStack API."""
@@ -32,21 +30,3 @@ class CertificatesController(wsgi.Controller):
def create(self, req, body=None):
"""Create a certificate."""
raise webob.exc.HTTPGone()
class Certificates(extensions.V21APIExtensionBase):
"""Certificates support."""
name = "Certificates"
alias = ALIAS
version = 1
def get_resources(self):
resources = [
extensions.ResourceExtension(ALIAS,
CertificatesController(),
member_actions={})]
return resources
def get_controller_extensions(self):
return []
+11
View File
@@ -23,6 +23,7 @@ from nova.api.openstack.compute import agents
from nova.api.openstack.compute import aggregates
from nova.api.openstack.compute import assisted_volume_snapshots
from nova.api.openstack.compute import availability_zone
from nova.api.openstack.compute import certificates
from nova.api.openstack.compute import config_drive
from nova.api.openstack.compute import console_output
from nova.api.openstack.compute import create_backup
@@ -100,6 +101,10 @@ availability_zone_controller = functools.partial(
_create_controller, availability_zone.AvailabilityZoneController, [], [])
certificates_controller = functools.partial(
_create_controller, certificates.CertificatesController, [], [])
keypairs_controller = functools.partial(
_create_controller, keypairs.KeypairController, [], [])
@@ -318,6 +323,12 @@ ROUTE_LIST = (
('/os-instance_usage_audit_log/{id}', {
'GET': [instance_usage_audit_log_controller, 'show']
}),
('/os-certificates', {
'POST': [certificates_controller, 'create']
}),
('/os-certificates/{id}', {
'GET': [certificates_controller, 'show']
}),
('/os-keypairs', {
'GET': [keypairs_controller, 'index'],
'POST': [keypairs_controller, 'create']
-1
View File
@@ -76,7 +76,6 @@ nova.api.v21.extensions =
baremetal_nodes = nova.api.openstack.compute.baremetal_nodes:BareMetalNodes
block_device_mapping = nova.api.openstack.compute.block_device_mapping:BlockDeviceMapping
cells = nova.api.openstack.compute.cells:Cells
certificates = nova.api.openstack.compute.certificates:Certificates
cloudpipe = nova.api.openstack.compute.cloudpipe:Cloudpipe
console_auth_tokens = nova.api.openstack.compute.console_auth_tokens:ConsoleAuthTokens
consoles = nova.api.openstack.compute.consoles:Consoles