dataflow.server_management.modelsΒΆ
Base models for server management.
This module defines the fundamental Pydantic models used for server configuration and runtime information across all server types.
AttributesΒΆ
ClassesΒΆ
Base configuration all servers must have. |
|
Base runtime info all servers have. |
|
Universal server status enum. |
Module ContentsΒΆ
- class dataflow.server_management.models.BaseServerConfig(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModelBase configuration all servers must have.
This model defines the minimum configuration required for any server type. Subclasses should extend this with type-specific fields.
- nameΒΆ
Unique server identifier
- commandΒΆ
Command to execute (executable + args)
- descriptionΒΆ
Human-readable description
- working_directoryΒΆ
Optional working directory for process
- environmentΒΆ
Additional environment variables
- timeout_secondsΒΆ
Startup timeout in seconds
- auto_restartΒΆ
Whether to restart on failure
- health_check_enabledΒΆ
Whether to perform health checks
Example
Basic server configuration:
config = BaseServerConfig( name="my-server", command=["python", "-m", "server"], description="My custom server" )
- classmethod validate_command_not_empty(v: List[str]) List[str]ΒΆ
Validate command has executable and no empty strings.
- classmethod validate_environment_vars(v: Dict[str, str]) Dict[str, str]ΒΆ
Validate environment variable names and values.
- classmethod validate_working_directory(v: str | None) str | NoneΒΆ
Validate working directory if provided.
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class dataflow.server_management.models.BaseServerInfo(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModelBase runtime info all servers have.
This model represents the runtime state of a server process. It excludes the actual process handle from serialization.
- nameΒΆ
Server name
- pidΒΆ
Process ID
- statusΒΆ
Current server status
- started_atΒΆ
When the server was started
- config_snapshotΒΆ
Configuration used to start server
- error_messageΒΆ
Last error message if any
- restart_countΒΆ
Number of times server has been restarted
- last_health_checkΒΆ
Last successful health check time
- uptime_secondsΒΆ
Computed uptime in seconds
- update_status(new_status: ServerStatus, error: str | None = None) NoneΒΆ
Update server status with optional error message.
- last_health_check: datetime.datetime | None = NoneΒΆ
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- started_at: datetime.datetime = NoneΒΆ
- status: ServerStatus = NoneΒΆ
- class dataflow.server_management.models.ServerStatusΒΆ
-
Universal server status enum.
- ERROR = 'error'ΒΆ
- HEALTH_CHECK_FAILED = 'health_check_failed'ΒΆ
- RESTARTING = 'restarting'ΒΆ
- RUNNING = 'running'ΒΆ
- STARTING = 'starting'ΒΆ
- STOPPED = 'stopped'ΒΆ
- STOPPING = 'stopping'ΒΆ
- dataflow.server_management.models.loggerΒΆ