Use plain routes list for os-instance-usage-audit-log endpoint instead of stevedore
This patch adds os-instance-usage-audit-log 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: I0877f221954374bd3d8ff2f3d91163d450433dbc
This commit is contained in:
@@ -210,6 +210,9 @@ hardcoded_extensions = [
|
||||
{'name': 'FloatingIpsBulk',
|
||||
'description': 'Bulk handling of Floating IPs.',
|
||||
'alias': 'os-floating-ips-bulk'},
|
||||
{'name': 'OSInstanceUsageAuditLog',
|
||||
'description': 'Admin-only Task Log Monitoring.',
|
||||
'alias': 'os-instance-usage-audit-log'},
|
||||
{'name': 'Keypairs',
|
||||
'description': 'Keypair Support.',
|
||||
'alias': 'os-keypairs'},
|
||||
|
||||
@@ -28,8 +28,6 @@ from nova import utils
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
ALIAS = 'os-instance-usage-audit-log'
|
||||
|
||||
|
||||
class InstanceUsageAuditLogController(wsgi.Controller):
|
||||
def __init__(self):
|
||||
@@ -111,18 +109,3 @@ class InstanceUsageAuditLogController(wsgi.Controller):
|
||||
total_errors=total_errors,
|
||||
overall_status=overall_status,
|
||||
log=log)
|
||||
|
||||
|
||||
class InstanceUsageAuditLog(extensions.V21APIExtensionBase):
|
||||
"""Admin-only Task Log Monitoring."""
|
||||
name = "OSInstanceUsageAuditLog"
|
||||
alias = ALIAS
|
||||
version = 1
|
||||
|
||||
def get_resources(self):
|
||||
ext = extensions.ResourceExtension('os-instance_usage_audit_log',
|
||||
InstanceUsageAuditLogController())
|
||||
return [ext]
|
||||
|
||||
def get_controller_extensions(self):
|
||||
return []
|
||||
|
||||
@@ -39,6 +39,7 @@ from nova.api.openstack.compute import floating_ip_pools
|
||||
from nova.api.openstack.compute import floating_ips
|
||||
from nova.api.openstack.compute import floating_ips_bulk
|
||||
from nova.api.openstack.compute import hide_server_addresses
|
||||
from nova.api.openstack.compute import instance_usage_audit_log
|
||||
from nova.api.openstack.compute import keypairs
|
||||
from nova.api.openstack.compute import lock_server
|
||||
from nova.api.openstack.compute import migrate_server
|
||||
@@ -116,6 +117,10 @@ floating_ips_bulk_controller = functools.partial(_create_controller,
|
||||
floating_ips_bulk.FloatingIPBulkController, [], [])
|
||||
|
||||
|
||||
instance_usage_audit_log_controller = functools.partial(_create_controller,
|
||||
instance_usage_audit_log.InstanceUsageAuditLogController, [], [])
|
||||
|
||||
|
||||
server_controller = functools.partial(_create_controller,
|
||||
servers.ServersController,
|
||||
[
|
||||
@@ -228,6 +233,12 @@ ROUTE_LIST = (
|
||||
'GET': [floating_ips_bulk_controller, 'show'],
|
||||
'PUT': [floating_ips_bulk_controller, 'update']
|
||||
}),
|
||||
('/os-instance_usage_audit_log', {
|
||||
'GET': [instance_usage_audit_log_controller, 'index']
|
||||
}),
|
||||
('/os-instance_usage_audit_log/{id}', {
|
||||
'GET': [instance_usage_audit_log_controller, 'show']
|
||||
}),
|
||||
('/os-keypairs', {
|
||||
'GET': [keypairs_controller, 'index'],
|
||||
'POST': [keypairs_controller, 'create']
|
||||
|
||||
@@ -93,7 +93,6 @@ nova.api.v21.extensions =
|
||||
image_metadata = nova.api.openstack.compute.image_metadata:ImageMetadata
|
||||
image_size = nova.api.openstack.compute.image_size:ImageSize
|
||||
instance_actions = nova.api.openstack.compute.instance_actions:InstanceActions
|
||||
instance_usage_audit_log = nova.api.openstack.compute.instance_usage_audit_log:InstanceUsageAuditLog
|
||||
ips = nova.api.openstack.compute.ips:IPs
|
||||
limits = nova.api.openstack.compute.limits:Limits
|
||||
migrations = nova.api.openstack.compute.migrations:Migrations
|
||||
|
||||
Reference in New Issue
Block a user