Class TsakApiClient
HTTP implementation of the Tsak runtime API client.
public sealed class TsakApiClient : ITsakApiClient, IDisposable
Inheritance
Implements
Methods
AnalyzeStorageAsync(string?, string?, string?, string?, CancellationToken)
Refreshes the planner statistics of one table, or of the whole database when no table is named (admin).
public Task<RedbAnalyzeResult> AnalyzeStorageAsync(string? instance = null, string? context = null, string? table = null, string? schema = null, CancellationToken ct = default)
CordonNodeAsync(string, CancellationToken)
Cordon a node (take on no new work; drain to peers) for planned maintenance.
public Task<ClusterCordonResponse> CordonNodeAsync(string nodeId, CancellationToken ct = default)
CreateApiKeyAsync(string, string[]?, string?, DateTime?, CancellationToken)
Create a new API key.
public Task<ApiKeyCreatedResponse> CreateApiKeyAsync(string name, string[]? roles = null, string? userId = null, DateTime? expiresAt = null, CancellationToken ct = default)
CreateUserAsync(TsakCreateUserRequest, CancellationToken)
Create a new user.
public Task<TsakUserInfo> CreateUserAsync(TsakCreateUserRequest request, CancellationToken ct = default)
DeleteUserAsync(string, CancellationToken)
Delete a user.
public Task<TsakUserActionResponse> DeleteUserAsync(string login, CancellationToken ct = default)
DisableWatchdogAsync(CancellationToken)
Disable watchdog monitoring.
public Task DisableWatchdogAsync(CancellationToken ct = default)
DiscardExchangeAsync(string, CancellationToken)
Discard a dead-lettered exchange.
public Task<ExchangeReplayResult> DiscardExchangeAsync(string entryId, CancellationToken ct = default)
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
DownloadLogFileAsync(string, CancellationToken)
Download a log file as ZIP bytes.
public Task<byte[]> DownloadLogFileAsync(string filename, CancellationToken ct = default)
EnableWatchdogAsync(CancellationToken)
Enable watchdog monitoring.
public Task EnableWatchdogAsync(CancellationToken ct = default)
FireJobAsync(string, CancellationToken)
Fire a scheduled job immediately (out of schedule).
public Task<SchedulerActionResponse> FireJobAsync(string jobKey, CancellationToken ct = default)
FireJobAsync(string, string?, CancellationToken)
Fire a job of the scheduler of context immediately (out of schedule).
public Task<SchedulerActionResponse> FireJobAsync(string jobKey, string? context, CancellationToken ct = default)
ForceStopRouteAsync(string, string, CancellationToken)
Force-stop a route immediately (no drain).
public Task<RouteActionResponse> ForceStopRouteAsync(string contextName, string routeId, CancellationToken ct = default)
GetAlertStatusAsync(CancellationToken)
Alert-delivery status: whether delivery is active and which channels are enabled.
public Task<AlertDeliveryStatus> GetAlertStatusAsync(CancellationToken ct = default)
GetAssembliesAsync(CancellationToken)
GET /api/system/assemblies — assemblies actually loaded on the node (Admin only).
public Task<AssembliesResponse> GetAssembliesAsync(CancellationToken ct = default)
GetAuditAsync(string?, string?, string?, DateTimeOffset?, DateTimeOffset?, int?, int?, CancellationToken)
Query the persistent admin-action audit trail, newest-first. All filters are optional;
public Task<AuditQueryResult> GetAuditAsync(string? actor = null, string? action = null, string? target = null, DateTimeOffset? since = null, DateTimeOffset? until = null, int? limit = null, int? offset = null, CancellationToken ct = default)
GetClusterDeployAdviceAsync(CancellationToken)
GET /api/health/deploy/cluster: the same advice for every alive node of the cluster.
public Task<ClusterDeployAdviceResponse> GetClusterDeployAdviceAsync(CancellationToken ct = default)
GetClusterStatusAsync(CancellationToken)
Get cluster status.
public Task<ClusterStatusResponse> GetClusterStatusAsync(CancellationToken ct = default)
GetConfigAsync(CancellationToken)
Get the effective (merged, redacted) configuration of this node (admin).
public Task<EffectiveConfigResult> GetConfigAsync(CancellationToken ct = default)
GetContextAsync(string, CancellationToken)
Get details of a specific context.
public Task<ContextDetail> GetContextAsync(string name, CancellationToken ct = default)
GetContextInflightAsync(string, CancellationToken)
Browse all in-flight exchanges across all routes in a context.
public Task<InflightExchangeDto[]> GetContextInflightAsync(string contextName, CancellationToken ct = default)
GetDashboardAsync(CancellationToken)
Get aggregated dashboard snapshot.
public Task<DashboardSnapshot> GetDashboardAsync(CancellationToken ct = default)
GetDeployAdviceAsync(CancellationToken)
GET /api/health/deploy: hot swap a new package into this node, or deploy it cold. The 409 of a cold deploy is an
public Task<DeployAdviceResponse> GetDeployAdviceAsync(CancellationToken ct = default)
GetDiagnosticDumpAsync(CancellationToken)
Get full system diagnostic dump.
public Task<DiagnosticDump> GetDiagnosticDumpAsync(CancellationToken ct = default)
GetFailedExchangesAsync(string?, string?, string?, DateTimeOffset?, DateTimeOffset?, int?, int?, CancellationToken)
Query dead-lettered exchanges (failed at a route checkpoint), newest-first, paged.
public Task<FailedExchangeQueryResult> GetFailedExchangesAsync(string? context = null, string? route = null, string? status = null, DateTimeOffset? since = null, DateTimeOffset? until = null, int? limit = null, int? offset = null, CancellationToken ct = default)
GetHealthAsync(CancellationToken)
Get system health status.
public Task<HealthCheckResult> GetHealthAsync(CancellationToken ct = default)
GetInfoAsync(CancellationToken)
Get system information.
public Task<SystemInfoResponse> GetInfoAsync(CancellationToken ct = default)
GetLifecycleEventsAsync(string?, string?, string?, DateTime?, int?, CancellationToken)
Get lifecycle events with optional filters.
public Task<LifecycleEvent[]> GetLifecycleEventsAsync(string? context = null, string? route = null, string? type = null, DateTime? since = null, int? limit = null, CancellationToken ct = default)
GetLogFilesAsync(CancellationToken)
List available log files on the worker node.
public Task<LogFilesResponse> GetLogFilesAsync(CancellationToken ct = default)
GetLogsAsync(long?, int?, string?, CancellationToken)
Get buffered log entries. Supports incremental fetch via afterId.
public Task<LogsResponse> GetLogsAsync(long? afterId = null, int? limit = null, string? level = null, CancellationToken ct = default)
GetLogsBeforeAsync(long, int?, string?, CancellationToken)
Get the buffered log entries older than beforeId, newest first: the page before the oldest
public Task<LogsResponse> GetLogsBeforeAsync(long beforeId, int? limit = null, string? level = null, CancellationToken ct = default)
GetMetricsAsync(CancellationToken)
Get system metrics.
public Task<MetricsResponse> GetMetricsAsync(CancellationToken ct = default)
GetMetricsHistoryAsync(int, CancellationToken)
Get metrics history over a time window.
public Task<MetricsHistoryResponse> GetMetricsHistoryAsync(int minutes = 5, CancellationToken ct = default)
GetModuleAsync(string, CancellationToken)
Get details of a specific module.
public Task<ModuleInfo> GetModuleAsync(string name, CancellationToken ct = default)
GetRouteAsync(string, string, CancellationToken)
Get detailed info for a specific route.
public Task<RouteDetail> GetRouteAsync(string contextName, string routeId, CancellationToken ct = default)
GetRouteDiagnosticsAsync(string, string, CancellationToken)
Get diagnostic dump for a specific route.
public Task<RouteDiagnosticDump> GetRouteDiagnosticsAsync(string contextName, string routeId, CancellationToken ct = default)
GetRouteInflightAsync(string, string, CancellationToken)
Browse in-flight exchanges for a specific route.
public Task<InflightExchangeDto[]> GetRouteInflightAsync(string contextName, string routeId, CancellationToken ct = default)
GetRouteMetricsAsync(string, string, CancellationToken)
Get per-route metrics summary.
public Task<RouteMetricsSummary> GetRouteMetricsAsync(string contextName, string routeId, CancellationToken ct = default)
GetSchedulerStatusAsync(CancellationToken)
Get scheduler status.
public Task<SchedulerStatusResponse> GetSchedulerStatusAsync(CancellationToken ct = default)
GetStorageStatsAsync(string?, string?, CancellationToken)
Index and table statistics of one instance plus the window its usage counters cover (operator).
public Task<RedbStorageStats> GetStorageStatsAsync(string? instance = null, string? context = null, CancellationToken ct = default)
GetUserAsync(string, CancellationToken)
Get user by login.
public Task<TsakUserInfo> GetUserAsync(string login, CancellationToken ct = default)
GetWatchdogAlertsAsync(CancellationToken)
Get active watchdog alerts.
public Task<WatchdogAlert[]> GetWatchdogAlertsAsync(CancellationToken ct = default)
GetWatchdogStatusAsync(CancellationToken)
Get watchdog status and state.
public Task<WatchdogState> GetWatchdogStatusAsync(CancellationToken ct = default)
ListApiKeysAsync(CancellationToken)
List all API keys.
public Task<ApiKeyInfo[]> ListApiKeysAsync(CancellationToken ct = default)
ListClusterNodesAsync(CancellationToken)
List cluster nodes.
public Task<ClusterNodesResponse> ListClusterNodesAsync(CancellationToken ct = default)
ListContextsAsync(CancellationToken)
List all route contexts.
public Task<ContextSummary[]> ListContextsAsync(CancellationToken ct = default)
ListEndpointsAsync(string, CancellationToken)
List endpoints for a context.
public Task<TsakEndpointInfo[]> ListEndpointsAsync(string contextName, CancellationToken ct = default)
ListModulesAsync(CancellationToken)
List all modules.
public Task<ModuleInfo[]> ListModulesAsync(CancellationToken ct = default)
ListRedbInstancesAsync(CancellationToken)
Lists the redb instances of this node: the host's own storage and every named one (operator).
public Task<RedbInstanceInfo[]> ListRedbInstancesAsync(CancellationToken ct = default)
ListRoutesAsync(string, CancellationToken)
List all routes in a context.
public Task<TsakRouteInfo[]> ListRoutesAsync(string contextName, CancellationToken ct = default)
ListRunningJobsAsync(CancellationToken)
List currently running jobs.
public Task<RunningJobsResponse> ListRunningJobsAsync(CancellationToken ct = default)
ListScheduledJobsAsync(CancellationToken)
List scheduled jobs.
public Task<ScheduledJobsResponse> ListScheduledJobsAsync(CancellationToken ct = default)
ListUsersAsync(CancellationToken)
List all users.
public Task<TsakUserInfo[]> ListUsersAsync(CancellationToken ct = default)
PauseJobAsync(string, CancellationToken)
Pause a specific job.
public Task<SchedulerActionResponse> PauseJobAsync(string jobKey, CancellationToken ct = default)
PauseJobAsync(string, string?, CancellationToken)
Pause a job of the scheduler of context.
public Task<SchedulerActionResponse> PauseJobAsync(string jobKey, string? context, CancellationToken ct = default)
RebalanceClusterAsync(CancellationToken)
Trigger cluster rebalance.
public Task<ClusterRebalanceResponse> RebalanceClusterAsync(CancellationToken ct = default)
RemoveClusterNodeAsync(string, CancellationToken)
Remove a dead/offline cluster node.
public Task<ClusterNodeRemovedResponse> RemoveClusterNodeAsync(string nodeId, CancellationToken ct = default)
RemoveContextAsync(string, CancellationToken)
Remove a context.
public Task<ContextActionResponse> RemoveContextAsync(string name, CancellationToken ct = default)
RemoveModuleAsync(string, CancellationToken)
Remove a module.
public Task<ModuleRemovedResponse> RemoveModuleAsync(string name, CancellationToken ct = default)
ReplayExchangeAsync(string, CancellationToken)
Replay a dead-lettered exchange: re-run its route tail from the captured snapshot.
public Task<ExchangeReplayResult> ReplayExchangeAsync(string entryId, CancellationToken ct = default)
ResetRouteStatesAsync(string, CancellationToken)
Reset persisted route states and restart a context.
public Task<ContextActionResponse> ResetRouteStatesAsync(string name, CancellationToken ct = default)
RestartContextAsync(string, CancellationToken)
Restart a context.
public Task<ContextActionResponse> RestartContextAsync(string name, CancellationToken ct = default)
ResumeJobAsync(string, CancellationToken)
Resume a specific job.
public Task<SchedulerActionResponse> ResumeJobAsync(string jobKey, CancellationToken ct = default)
ResumeJobAsync(string, string?, CancellationToken)
Resume a job of the scheduler of context.
public Task<SchedulerActionResponse> ResumeJobAsync(string jobKey, string? context, CancellationToken ct = default)
RevokeApiKeyAsync(string, CancellationToken)
Revoke an API key by ID.
public Task<ApiKeyRevokedResponse> RevokeApiKeyAsync(string id, CancellationToken ct = default)
RollbackModuleAsync(string, CancellationToken)
Roll a module back to its previous on-disk version.
public Task<ModuleDeployResponse> RollbackModuleAsync(string name, CancellationToken ct = default)
StandbySchedulerAsync(CancellationToken)
Put scheduler in standby mode.
public Task<SchedulerActionResponse> StandbySchedulerAsync(CancellationToken ct = default)
StandbySchedulerAsync(string?, CancellationToken)
Put the scheduler of context in standby; all when null.
public Task<SchedulerActionResponse> StandbySchedulerAsync(string? context, CancellationToken ct = default)
StartContextAsync(string, CancellationToken)
Start a context.
public Task<ContextActionResponse> StartContextAsync(string name, CancellationToken ct = default)
StartRouteAsync(string, string, CancellationToken)
Start a route.
public Task<RouteActionResponse> StartRouteAsync(string contextName, string routeId, CancellationToken ct = default)
StartSchedulerAsync(CancellationToken)
Start the scheduler.
public Task<SchedulerActionResponse> StartSchedulerAsync(CancellationToken ct = default)
StartSchedulerAsync(string?, CancellationToken)
Start (or resume from standby) the scheduler of context; all when null.
public Task<SchedulerActionResponse> StartSchedulerAsync(string? context, CancellationToken ct = default)
StopContextAsync(string, CancellationToken)
Stop a context.
public Task<ContextActionResponse> StopContextAsync(string name, CancellationToken ct = default)
StopRouteAsync(string, string, int?, CancellationToken)
Stop a route with optional timeout.
public Task<RouteActionResponse> StopRouteAsync(string contextName, string routeId, int? timeoutSeconds = null, CancellationToken ct = default)
TestAlertAsync(CancellationToken)
Send a synthetic alert through every enabled channel; returns the per-channel outcome.
public Task<AlertTestResult> TestAlertAsync(CancellationToken ct = default)
UncordonNodeAsync(string, CancellationToken)
Uncordon a node — it starts taking on work again.
public Task<ClusterCordonResponse> UncordonNodeAsync(string nodeId, CancellationToken ct = default)
UpdateUserAsync(string, TsakUpdateUserRequest, CancellationToken)
Update an existing user.
public Task<TsakUserInfo> UpdateUserAsync(string login, TsakUpdateUserRequest request, CancellationToken ct = default)
UploadModuleAsync(byte[], string?, CancellationToken)
Upload a .tpkg package for deployment. signatureBase64 is the
public Task<ModuleDeployResponse> UploadModuleAsync(byte[] packageBytes, string? signatureBase64 = null, CancellationToken ct = default)
ValidateModuleAsync(byte[], string?, CancellationToken)
Dry-run validate a .tpkg without installing it.
public Task<ModuleDeployResponse> ValidateModuleAsync(byte[] packageBytes, string? signatureBase64 = null, CancellationToken ct = default)
Constructors
TsakApiClient(string, string?, TimeSpan?, TimeSpan?)
Initializes a new Tsak API client.