diff --git a/nova/api/openstack/compute/certificates.py b/nova/api/openstack/compute/certificates.py index dd9cc4aa38ce..3f588f465785 100644 --- a/nova/api/openstack/compute/certificates.py +++ b/nova/api/openstack/compute/certificates.py @@ -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 [] diff --git a/nova/api/openstack/compute/routes.py b/nova/api/openstack/compute/routes.py index 9930aa0eaa70..2e1ae2a179cc 100644 --- a/nova/api/openstack/compute/routes.py +++ b/nova/api/openstack/compute/routes.py @@ -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'] diff --git a/setup.cfg b/setup.cfg index cd35a5795139..4267a3e36a0d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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