add hook for osapi
This commit is contained in:
@@ -537,6 +537,7 @@ class CloudController(object):
|
|||||||
instance_id=instance_id)
|
instance_id=instance_id)
|
||||||
|
|
||||||
def get_vnc_console(self, context, instance_id, **kwargs):
|
def get_vnc_console(self, context, instance_id, **kwargs):
|
||||||
|
"""Returns vnc browser url to the dashboard."""
|
||||||
ec2_id = instance_id
|
ec2_id = instance_id
|
||||||
instance_id = ec2utils.ec2_id_to_id(ec2_id)
|
instance_id = ec2utils.ec2_id_to_id(ec2_id)
|
||||||
return self.compute_api.get_vnc_console(context,
|
return self.compute_api.get_vnc_console(context,
|
||||||
|
|||||||
@@ -481,6 +481,16 @@ class Controller(wsgi.Controller):
|
|||||||
return faults.Fault(exc.HTTPNotFound())
|
return faults.Fault(exc.HTTPNotFound())
|
||||||
return exc.HTTPAccepted()
|
return exc.HTTPAccepted()
|
||||||
|
|
||||||
|
@scheduler_api.redirect_handler
|
||||||
|
def get_vnc_console(self, req, id):
|
||||||
|
""" Returns a url to an instance's ajaxterm console. """
|
||||||
|
try:
|
||||||
|
self.compute_api.get_vnc_console(req.environ['nova.context'],
|
||||||
|
int(id))
|
||||||
|
except exception.NotFound:
|
||||||
|
return faults.Fault(exc.HTTPNotFound())
|
||||||
|
return exc.HTTPAccepted()
|
||||||
|
|
||||||
@scheduler_api.redirect_handler
|
@scheduler_api.redirect_handler
|
||||||
def diagnostics(self, req, id):
|
def diagnostics(self, req, id):
|
||||||
"""Permit Admins to retrieve server diagnostics."""
|
"""Permit Admins to retrieve server diagnostics."""
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class NovaAuthMiddleware(object):
|
|||||||
middleware = self
|
middleware = self
|
||||||
middleware.tokens = {}
|
middleware.tokens = {}
|
||||||
|
|
||||||
class Proxy():
|
class TopicProxy():
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def authorize_vnc_console(context, **kwargs):
|
def authorize_vnc_console(context, **kwargs):
|
||||||
data = kwargs
|
data = kwargs
|
||||||
@@ -92,7 +92,7 @@ class NovaAuthMiddleware(object):
|
|||||||
conn = rpc.Connection.instance(new=True)
|
conn = rpc.Connection.instance(new=True)
|
||||||
consumer = rpc.TopicAdapterConsumer(
|
consumer = rpc.TopicAdapterConsumer(
|
||||||
connection=conn,
|
connection=conn,
|
||||||
proxy=Proxy,
|
proxy=TopicProxy,
|
||||||
topic=FLAGS.vnc_console_proxy_topic)
|
topic=FLAGS.vnc_console_proxy_topic)
|
||||||
|
|
||||||
utils.LoopingCall(consumer.fetch,
|
utils.LoopingCall(consumer.fetch,
|
||||||
|
|||||||
Reference in New Issue
Block a user