EngineService Service
Package
Section titled “Package”pai.engine.v1
Syntax: proto3
Services
Section titled “Services”EngineService
Section titled “EngineService”EngineService provides control and monitoring capabilities for the paiOS Engine. This service handles engine lifecycle, configuration, and status queries.
RPC Methods
Section titled “RPC Methods”StartEngine
Section titled “StartEngine”StartEngine initializes and starts the paiOS Engine. Returns the engine status after startup.
rpc StartEngine(StartEngineRequest) returns (StartEngineResponse)StopEngine
Section titled “StopEngine”StopEngine gracefully shuts down the engine. Returns confirmation when shutdown is complete.
rpc StopEngine(StopEngineRequest) returns (StopEngineResponse)GetStatus
Section titled “GetStatus”GetStatus returns the current status of the engine.
rpc GetStatus(GetStatusRequest) returns (GetStatusResponse)UpdateConfig
Section titled “UpdateConfig”UpdateConfig updates the engine configuration at runtime.
rpc UpdateConfig(UpdateConfigRequest) returns (UpdateConfigResponse)Messages
Section titled “Messages”StartEngineRequest
Section titled “StartEngineRequest”StartEngineRequest contains parameters for starting the engine.
Fields
Section titled “Fields”| Field | Type | Number | Description |
|---|---|---|---|
config_path | string | 1 | Optional path to configuration file. If not provided, default configuration is used. |
debug | bool | 2 | Enable debug logging. |
StartEngineResponse
Section titled “StartEngineResponse”StartEngineResponse contains the result of the start operation.
Fields
Section titled “Fields”| Field | Type | Number | Description |
|---|---|---|---|
success | bool | 1 | Indicates whether the engine started successfully. |
message | string | 2 | Human-readable message about the start result. |
status | EngineStatus | 3 | Engine status after startup. |
StopEngineRequest
Section titled “StopEngineRequest”StopEngineRequest contains parameters for stopping the engine.
Fields
Section titled “Fields”| Field | Type | Number | Description |
|---|---|---|---|
force | bool | 1 | Force immediate shutdown (default: false, graceful shutdown). |
StopEngineResponse
Section titled “StopEngineResponse”StopEngineResponse confirms the engine has stopped.
Fields
Section titled “Fields”| Field | Type | Number | Description |
|---|---|---|---|
success | bool | 1 | Indicates whether the engine stopped successfully. |
message | string | 2 | Human-readable message about the stop result. |
GetStatusRequest
Section titled “GetStatusRequest”GetStatusRequest is an empty message for status queries.
GetStatusResponse
Section titled “GetStatusResponse”GetStatusResponse contains the current engine status.
Fields
Section titled “Fields”| Field | Type | Number | Description |
|---|---|---|---|
status | EngineStatus | 1 | Current engine status. |
UpdateConfigRequest
Section titled “UpdateConfigRequest”UpdateConfigRequest contains new configuration values.
UpdateConfigResponse
Section titled “UpdateConfigResponse”UpdateConfigResponse confirms the configuration update.
Fields
Section titled “Fields”| Field | Type | Number | Description |
|---|---|---|---|
success | bool | 1 | Indicates whether the configuration was updated successfully. |
message | string | 2 | Human-readable message about the update result. |
EngineStatus
Section titled “EngineStatus”EngineStatus represents the current state of the engine.
Fields
Section titled “Fields”| Field | Type | Number | Description |
|---|---|---|---|
state | EngineState | 1 | Current engine state. |
uptime_seconds | uint64 | 2 | Uptime in seconds since engine started. |
version | string | 3 | Version string of the running engine. |
active_subsystems | repeated string | 4 | Active subsystems. |
EngineState
Section titled “EngineState”EngineState represents the possible states of the engine.
| Value | Number | Description |
|---|---|---|
ENGINE_STATE_UNSPECIFIED | 0 | Engine is not running. |
ENGINE_STATE_INITIALIZING | 1 | Engine is initializing. |
ENGINE_STATE_RUNNING | 2 | Engine is running normally. |
ENGINE_STATE_SHUTTING_DOWN | 3 | Engine is shutting down. |
ENGINE_STATE_ERROR | 4 | Engine encountered an error. |