-
Notifications
You must be signed in to change notification settings - Fork 3
Modules
- Table Of Contents
- AddChannelsToGraphOutput
- Initialize
- LogChannels
- Mirror
- MountAPIKeyMiddleware
- MountChannelsGraph
- MountControls
- MountFieldRestRoutes
- MountOutputsFolder
- MountPerspectiveTables
- MountRestRoutes
- MountWebSocketRoutes
- PrintChannels
- PublishDatadog
- PublishOpsGenie
- PublishSQLA
- PublishSymphony
- ReplayEngineJSON
- ReplayEngineKafka
Documentation coming soon!
Documentation coming soon!
LogChannels
is a simple GatewayModule
to log channel ticks to a logger.
log_channels:
_target_: csp_gateway.LogChannels
selection:
include:
- channel_one
- channel_two
log_states: false
log_level: DEBUG
log_name: MyCoolLogger
Tip
You can instantiate multiple different instances.
Documentation coming soon!
MountAPIKeyMiddleware
is a GatewayModule
to add API Key based authentication to the Gateway
REST API, Websocket API, and UI.
modules:
mount_api_key_middleware:
_target_: csp_gateway.MountAPIKeyMiddleware
api_key_timeout: 60:00:00 # Cookie timeout
unauthorized_status_message: unauthorized
When you instantiate your Gateway
, ensure that the GatewaySettings
instance has authenticate=True
. By default, a unique token will be generated and displayed in the logging output, similar to how Jupyter
works by default. To customize, change the GatewaySettings
instance's api_key
to whatever you like:
E.g. in configuration:
gateway:
settings:
AUTHENTICATE: True
API_KEY: my-secret-api-key
Or from the CLI
csp-gateway-start <your arguments> ++gateway.settings.AUTHENTICATE=True ++gateway.settings.API_KEY=my-secret-api-key
For REST and Websocket APIs, append the token
query parameter for all requests to authenticate.
When instantiating your Python client, pass in the same arguments as the server:
config = GatewayClientConfig(
host="localhost",
port=8000,
authenticate=True,
api_key="my-secret-api-key"
)
client = GatewayClient(config)
The client will automatically include the API Key on all requests.
MountChannelsGraph
adds a small UI for visualizing your csp-gateway
graph, available by default at /channels_graph
.
modules:
mount_channels_graph:
_target_: csp_gateway.MountChannelsGraph
MountControls
adds additional REST utilities for various application-oriented functionality.
modules:
mount_outputs:
_target_: csp_gateway.MountOutputsFolder
This adds an additional top-level REST API group controls
. By default, it contains 3 subroutes:
-
heartbeat
: check if thecsp
graph is still alive and running -
stats
: collect some host information including cpu usage, memory usage, csp time, wall time, active threads, username, etc -
shutdown
: initiate a shutdown of the running server, used in the "Big Red Button"
Documentation coming soon!
MountOutputsFolder
adds a small UI for visualizing your log outputs and your hydra configuration graph, available by default at /outputs
.
modules:
mount_outputs:
_target_: csp_gateway.MountOutputsFolder
MountPerspectiveTables
enables Perspective in the UI.
modules:
mount_perspective_tables:
_target_: csp_gateway.MountPerspectiveTables
layouts:
Server Defined Layout: "<a custom layout JSON>"
update_interval: 00:00:02
Additional configuration is available:
-
limits (
Dict[str, int] = {}
): configuration of Perspective table limits -
indexes (
Dict[str, str] = {}
): configuration of Perspective table indexes -
update_interval (
timedelta = Field(default=timedelta(seconds=2)
): default perspective table update interval -
default_index (
Optional[str]
): default index on all perspective tables, e.g.id
-
perspective_field (
str
): Optional field to allow aperspective.Server
to be mounted on aGatewayChannels
instance, to allowGatewayModules
to interact with Perspective independent of this module
MountRestRoutes
enables the REST API.
Note
The REST API is launched when starting the Gateway
instance with rest=True
modules:
mount_rest_routes:
_target_: csp_gateway.MountRestRoutes
force_mount_all: True
Warning
force_mount_all: True
force mounts all channels as read/write.
This is convenient for debugging, but might not be ideal in production.
API endpoints can also be configured individually:
-
mount_last (
ChannelSelection
): channels to include in last routes -
mount_next (
ChannelSelection
): channels to include in next routes -
mount_send (
ChannelSelection
): channels to include in send routes -
mount_state (
ChannelSelection
): channels to include in state routes -
mount_lookup (
ChannelSelection
): channels to include in lookup routes
Important
send
is only available if a GatewayModule
has called add_send_channel
or force_mount_all
is True
.
MountWebSocketRoutes
enables the Websocket API.
Note
The REST API is launched when starting the Gateway
instance with rest=True
modules:
mount_websocket_routes:
_target_: csp_gateway.MountRestRoutes
It has a few additional configuration options:
-
readonly (
bool=False
): disallow sending in data back to theGateway
-
ping_time_s (
int=1
): configure the default websocket ping (keepalive) interval in seconds
PrintChannels
is a simple GatewayModule
to print channel ticks to stdout.
print_channels:
_target_: csp_gateway.PrintChannels
selection:
include:
- channel_one
- channel_two
Documentation coming soon!
Documentation coming soon!
Documentation coming soon!
Documentation coming soon!
Documentation coming soon!
Documentation coming soon!
This wiki is autogenerated. To made updates, open a PR against the original source file in docs/wiki
.
Get Started
Key Components
For Developers
Modules
- API/UI Modules
- Logging Modules
- Replay Engine Modules
- Utility Modules
For Contributors