Aleph
Gateway RPCMethods Reference

services.*

Internal service management RPC methods

services.* controls the lifecycle of Aleph's internal services. The handlers are registered in HandlerRegistry::new() (src/gateway/handlers/mod.rs:329-332) and require no external dependencies to invoke.

Methods

MethodDescription
services.listList every registered service
services.startStart a service
services.stopStop a service
services.statusRead a single service's runtime state

services.restart is not an RPC; to restart a service, call stop followed by start.

services.list

List every internal service.

Request:

{ "jsonrpc": "2.0", "id": 1, "method": "services.list", "params": {} }

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "services": [
      { "id": "dreaming", "name": "Dreaming", "status": "running", "healthy": true },
      { "id": "metrics", "name": "Metrics", "status": "running", "healthy": true }
    ]
  }
}

services.status

Read a single service's runtime state (via services::handle_status).

Request:

{ "jsonrpc": "2.0", "id": 2, "method": "services.status", "params": { "service_id": "dreaming" } }

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "id": "dreaming",
    "name": "Dreaming",
    "status": "running",
    "healthy": true,
    "uptime_seconds": 3600
  }
}

Parameter: service_id (required).

services.start

Start a stopped service.

Request:

{ "jsonrpc": "2.0", "id": 3, "method": "services.start", "params": { "service_id": "dreaming" } }

Response:

{ "jsonrpc": "2.0", "id": 3, "result": { "started": "dreaming" } }

Parameter: service_id (required).

services.stop

Stop a running service.

Request:

{ "jsonrpc": "2.0", "id": 4, "method": "services.stop", "params": { "service_id": "dreaming" } }

Response:

{ "jsonrpc": "2.0", "id": 4, "result": { "stopped": "dreaming" } }

Parameter: service_id (required).

Service Status Values

StatusDescription
runningService is running
stoppedService is stopped
startingService is starting
stoppingService is stopping
degradedRunning but the last health check failed

See Also

On this page