Merge "Use plain routes list for os-instance-usage-audit-log endpoint instead of stevedore"

This commit is contained in:
Jenkins 2017-05-05 06:37:15 +00:00 committed by Gerrit Code Review
commit 4957a1b4ca
4 changed files with 14 additions and 18 deletions

View File

@ -229,6 +229,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'},

View File

@ -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 []

View File

@ -44,6 +44,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
@ -146,6 +147,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,
[
@ -296,6 +301,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']

View File

@ -88,7 +88,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