dxlconsole.console module¶
-
class
dxlconsole.console.
ConsoleRequestHandler
(application, request, **kwargs)¶ Bases:
dxlconsole.handlers.BaseRequestHandler
Handler that returns the content for the console
-
data_received
(chunk)¶ Invoked when streamed request data is received
Param: chunk The next chuck of data
-
get
(*args, **kwargs)¶ HTTP GET
-
-
class
dxlconsole.console.
ConsoleStaticFileRequestHandler
(application, request, **kwargs)¶ Bases:
tornado.web.StaticFileHandler
Class that is used to serve up static content in the console
-
data_received
(chunk)¶ Invoked when streamed request data is received
Parameters: chunk -- The next chuck of data
-
classmethod
get_absolute_path
(root, path)¶ Returns the absolute location of
path
relative toroot
.Parameters: - root -- The root path
- path -- The path specified
Returns: The absolute location of
path
relative toroot
.
-
validate_absolute_path
(root, absolute_path)¶ Validate and return the absolute path.
Parameters: - root -- The root path
- absolute_path -- The absolute path
-
-
class
dxlconsole.console.
ConsoleWebSocketHandler
(application, request, module)¶ Bases:
tornado.websocket.WebSocketHandler
Handles the WebSocket connection used to notify the client of updates in real time
-
data_received
(chunk)¶ Implement this method to handle streamed request data.
Requires the .stream_request_body decorator.
-
get_current_user
()¶ Override to determine the current user from, e.g., a cookie.
This method may not be a coroutine.
-
on_close
()¶ Invoked when the WebSocket is closed.
If the connection was closed cleanly and a status code or reason phrase was supplied, these values will be available as the attributes
self.close_code
andself.close_reason
.Changed in version 4.0: Added
close_code
andclose_reason
attributes.
-
on_message
(message)¶ Handle incoming messages on the WebSocket
This method must be overridden.
Changed in version 4.5:
on_message
can be a coroutine.
-
open
(*args, **kwargs)¶ Invoked when a new WebSocket is opened.
The arguments to open are extracted from the tornado.web.URLSpec regular expression, just like the arguments to tornado.web.RequestHandler.get.
-
-
class
dxlconsole.console.
LoginHandler
(application, request, **kwargs)¶ Bases:
tornado.web.RequestHandler
Handler for logging into the console
-
data_received
(chunk)¶ Invoked when streamed request data is received
Param: chunk The next chuck of data
-
get
(*args, **kwargs)¶ If used from the browser the login page is displayed. From an OpenDXL client
provisionconfig
CLI, this will be handled by the certificate module
-
post
(*args, **kwargs)¶ HTTP Post
-
-
class
dxlconsole.console.
LogoutHandler
(application, request, **kwargs)¶ Bases:
tornado.web.RequestHandler
Handler for logging out of the console
-
data_received
(chunk)¶ Invoked when streamed request data is received
Param: chunk The next chuck of data
-
get
(*args, **kwargs)¶ HTTP GET
-
-
class
dxlconsole.console.
WebConsole
(app)¶ Bases:
tornado.web.Application
The web console application
Constructor parameters:
Parameters: app -- The OpenDXL bootstrap application that the console is a part of -
add_web_socket
(client_id, web_socket)¶ Stores a web socket associated with the given client id
Parameters: - client_id -- the client id key the web socket to
- web_socket -- the web socket to store
-
add_web_socket_event_handler
(handler)¶ Adds a new handler for web socket events. Expects a WebSocketEventHandler
Parameters: handler -- a WebSocketEventHandler to handle events
-
bootstrap_app
¶ Returns the OpenDXL bootstrap application that the console is a part of
Returns: The OpenDXL bootstrap application that the console is a part of
-
dxl_service_client
¶ Returns the general purpose DXL client for modules
Returns: the general purpose DXL client for modules
-
io_loop
¶ Returns the Tornado IOLoop that the web console uses
Returns: The Tornado IOLoop instance
-
modules
¶ Returns the Tornado modules that are a part of the console
Returns: The Tornado modules that are a part of the console
-
on_web_socket_message
(client_id, message)¶ Called when a new web socket message is received. Notifies all listeners of the message and client
Parameters: - client_id -- The client owning the web socket
- message -- the message received
-
remove_web_socket
(client_id, web_socket)¶ Removes any web socket associated with the given client_id
Parameters: - web_socket -- The web socket to remove
- client_id -- The client ID
-
send_all_web_socket_message
(message)¶ Sends a message to all active web sockets
Parameters: message -- the message to send
-
send_web_socket_message
(client_id, message)¶ Sends a message to the specified web socket
Parameters: - client_id -- the client ID owning the desired web socket
- message -- the message to send
-
start
()¶ Starts the web console
-