dataflow.server_management.protocols¶

Protocol definitions for server management interfaces.

This module defines the protocols (interfaces) that server managers should implement, enabling type checking and ensuring consistent API across implementations.

Classes¶

ConfigLoaderProtocol

Protocol for configuration loading capabilities.

HealthMonitorProtocol

Protocol for health monitoring capabilities.

MetricsProtocol

Protocol for metrics collection capabilities.

ServerDiscoveryProtocol

Protocol for server discovery capabilities.

ServerManagerProtocol

Protocol defining the server manager interface.

Module Contents¶

class dataflow.server_management.protocols.ConfigLoaderProtocol¶

Bases: Protocol

Protocol for configuration loading capabilities.

async load_configs_from_file(path: str) Dict[str, dataflow.server_management.models.BaseServerConfig]¶

Load server configurations from a file.

async save_configs_to_file(path: str) None¶

Save current configurations to a file.

class dataflow.server_management.protocols.HealthMonitorProtocol¶

Bases: Protocol

Protocol for health monitoring capabilities.

async start_health_monitoring(name: str) None¶

Start health monitoring for a server.

async stop_health_monitoring(name: str) None¶

Stop health monitoring for a server.

class dataflow.server_management.protocols.MetricsProtocol¶

Bases: Protocol

Protocol for metrics collection capabilities.

async export_metrics(exporter: str) None¶

Export metrics to external system.

get_aggregate_metrics() Dict[str, float]¶

Get aggregated metrics for all servers.

get_server_metrics(name: str) Dict[str, float]¶

Get metrics for a specific server.

class dataflow.server_management.protocols.ServerDiscoveryProtocol¶

Bases: Protocol

Protocol for server discovery capabilities.

async adopt_server(server_info: dataflow.server_management.models.BaseServerInfo) bool¶

Adopt an externally started server.

async discover_servers() List[dataflow.server_management.models.BaseServerInfo]¶

Discover running servers not managed by this instance.

class dataflow.server_management.protocols.ServerManagerProtocol¶

Bases: Protocol

Protocol defining the server manager interface.

This protocol ensures all server managers implement the required methods for managing server lifecycles, regardless of the specific server type.

add_config(name: str, config: dataflow.server_management.models.BaseServerConfig | Dict[str, Any]) dataflow.server_management.models.BaseServerConfig¶

Add or update a server configuration.

async cleanup() None¶

Clean up resources and stop all servers.

get_config(name: str) dataflow.server_management.models.BaseServerConfig | None¶

Get server configuration by name.

get_server_info(name: str) dataflow.server_management.models.BaseServerInfo | None¶

Get runtime information for a server.

get_stats() Dict[str, Any]¶

Get server manager statistics.

abstractmethod health_check(name: str) bool¶
Async:

Check if server is healthy.

is_running(name: str) bool¶

Check if server is running.

list_servers(status: dataflow.server_management.models.ServerStatus | None = None) List[str]¶

List servers by status.

remove_config(name: str) bool¶

Remove a server configuration.

abstractmethod restart_server(name: str) dataflow.server_management.models.BaseServerInfo¶
Async:

Restart a server.

abstractmethod start_server(name: str, config: dataflow.server_management.models.BaseServerConfig | None = None) dataflow.server_management.models.BaseServerInfo¶
Async:

Start a server with given configuration.

abstractmethod stop_server(name: str, force: bool = False) bool¶
Async:

Stop a running server.

available_configs: Dict[str, dataflow.server_management.models.BaseServerConfig]¶
servers: Dict[str, dataflow.server_management.models.BaseServerInfo]¶