Expand description
§solti-api
Public task transports for a Solti agent.
HTTP uses the model-owned CRD JSON representation.
gRPC uses versioned protobuf messages.
Both transports delegate domain operations to one ApiHandler.
This crate does not store or execute tasks.
§Start Here
Use ApiHandler to define the transport-independent backend.
Use SupervisorApiAdapter to connect that boundary to solti-core.
Use HttpApi to build a standalone axum router or mount documented routes
into an application router.
Use GrpcApi to build a tonic service.
§Flow
HTTP CRD JSON ── parse and validate ──┐
▼
ApiHandler
▲
gRPC v1 DTO ── convert and validate ──┘
└──► custom backend or solti-coreThe transports own wire validation, authentication, metrics, and error mapping. The handler owns task operations.
§Desired State
The bundled adapter commits desired state before reconciliation finishes.
A successful create or apply does not mean that execution has started.
Clients observe reconciliation through status.conditions[type=Reconciled].
Apply is an upsert without write preconditions.
Apply and delete can check uid and resourceVersion.
§Collections and Streams
Lists use opaque continuation tokens. The bundled adapter provides snapshot-consistent pagination. Watches can resume from a retained resource version.
Task output is live-only and lossy.
It is not persisted or replayed.
A slow subscriber receives a Lagged event.
§Workload Boundary
The built-in Embedded workload is available only through the in-process SDK.
HTTP and gRPC reject it.
Extension workloads remain visible.
§Feature Flags
| Feature | Capability |
|---|---|
core-adapter | SupervisorApiAdapter for solti-core |
grpc | tonic gRPC service and generated current client |
grpc-tls | solti-tls adapter for tonic; implies grpc |
http | axum HTTP/JSON router |
No feature is enabled by default.
§Main Types
| Area | Types |
|---|---|
| Handler | ApiHandler, ApiError |
| Streams | TaskWatchEventStream, OutputEventStream |
| Metrics | ApiMetricsBackend, ApiMetricsHandle, Transport |
| HTTP | HttpApi, HttpApiParts |
| gRPC | GrpcApi, grpc::wire |
| Core adapter | SupervisorApiAdapter |
§Quick Start
Build both transports from one handler:
let handler = Arc::new(SupervisorApiAdapter::new(supervisor));
let grpc = GrpcApi::new(handler.clone()).server();
let http = HttpApi::new(handler).build();Re-exports§
Modules§
- grpc
- gRPC Transport
Structs§
- ApiConflict
- Structured optimistic concurrency conflict.
- ApiError
Cause - One machine-readable cause of an API conflict.
- HttpApi
- Builder for the axum task API.
- Http
ApiParts - Standalone runtime router and its generated OpenAPI contract.
- NoOp
ApiMetrics - Metrics backend that ignores every update.
- Supervisor
ApiAdapter ApiHandlerimplementation backed bySupervisorApi.
Enums§
- ApiError
- Error returned by the handler or a transport boundary.
- Transport
- Transport that served an API request.
Constants§
- API_
VERSION - Current public API major version.
- API_
VERSION_ NAME - Current public API version name.
- GRPC_
API_ PACKAGE - Current gRPC package exposed by the agent.
- GRPC_
API_ SERVICE - Current gRPC service exposed by the agent.
- HTTP_
API_ ROOT - Root path of the HTTP Kubernetes API group.
- MAX_
REQUEST_ BYTES - Maximum HTTP request body and gRPC message size.
Traits§
- ApiHandler
- Transport-independent task API.
- ApiMetrics
Backend - Receives API request lifecycle metrics.
Functions§
- noop_
api_ metrics - Creates a shared no-op metrics backend.
- to_
tonic_ server_ tls - Converts Solti server TLS settings into tonic settings.
Type Aliases§
- ApiMetrics
Handle - Shared metrics backend handle.
- Output
Event Stream - Boxed live stream of task output events.
- Task
Watch Event Stream - Boxed stream of task resource changes.