OptionalsystemName: stringReadonlyapiAPI call handler
ReadonlyauthenticatorAuthentication manager
ReadonlyconnectionWebSocket connection manager
Protected ReadonlyenabledInitial connection gate, forwarded to the connection. The app flips it later
via connection.setEnabled() (mapping its SystemState.Active -> true).
Protected ReadonlyhostnamesSystem hostnames (primary and fallback)
Protected ReadonlyloggerLogger forwarded to the connection (defaults to a no-op).
ReadonlyopsVersion-agnostic operation mappings
Provides a unified interface for operations that differ between API versions. Each version-specific client implements these operations using its own endpoints.
Usage:
truenas.ops.containerQuery().subscribe(containers => ...);
truenas.ops.containerStart(id).subscribe(jobId => ...);
Protected ReadonlysystemSystem name (optional)
Protected ReadonlyuuidSystem UUID
ReadonlyversionAPI version information for this client
Get current authentication status.
true if authenticated with the system
Get current connection status.
true if WebSocket is connected
Close the WebSocket connection. Connection will automatically retry if retry is enabled.
ProtectedcreateFactory method to create the API handler. Override in subclasses to provide version-specific API implementations.
ProtectedcreateFactory method to create the authenticator. Override in subclasses to provide version-specific authentication.
ProtectedcreateFactory method to create the WebSocket connection. Override in subclasses to provide version-specific connection handling.
ProtectedcreateCreate v25.10-specific operation mappings
virt.instance.* APIs return boolean (true) but emit job events via websocket. We use callAndGetJobId to capture the job ID, then track the job. All operations emit Job updates until the operation completes.
API client for TrueNAS API v25.10.x
Protocol: JSON-RPC 2.0 WebSocket Path: /api/v25.10.{patch}
Container operations use virt.instance.* APIs: