Swarm

class Swarm(dockerClient: DockerClient)

Swarm resource APIs. Accessing this group does not initialize or join a swarm. Resource operations require a manager. No operation closes the supplied client. HTTP errors return Result errors; transport/decoding failures and cancellation throw. No automatic retries.

Constructors

Link copied to clipboard
constructor(dockerClient: DockerClient)

Properties

Link copied to clipboard

Config data, metadata and lifecycle operations.

Link copied to clipboard

Cluster nodes.

Link copied to clipboard

Secret metadata and lifecycle operations.

Link copied to clipboard

Service specifications and logs.

Link copied to clipboard

Scheduled tasks and logs.

Functions

Link copied to clipboard
suspend fun getInfo(): Result<Swarm, ErrorResponse>

Inspects the cluster, including sensitive join tokens. Requires a manager.

Link copied to clipboard
suspend fun getUnlockKey(): Result<UnlockKeyResponse, ErrorResponse>

Returns the sensitive manager unlock key. Requires a manager.

Link copied to clipboard
suspend fun init(request: SwarmInitRequest): Result<String, ErrorResponse>

Explicitly initializes a cluster on this daemon; returns its node ID. Supply a listen address.

Link copied to clipboard
suspend fun join(request: SwarmJoinRequest): Result<Unit, ErrorResponse>

Explicitly joins this daemon using a sensitive join token.

Link copied to clipboard
suspend fun leave(force: Boolean = false): Result<Unit, ErrorResponse>

Leaves the swarm. Force can break manager quorum and is never enabled implicitly.

Link copied to clipboard
suspend fun unlock(request: SwarmUnlockRequest): Result<Unit, ErrorResponse>

Unlocks a locked manager using its key.

Link copied to clipboard
suspend fun update(version: ULong, spec: SwarmSpec, rotateWorkerToken: Boolean = false, rotateManagerToken: Boolean = false, rotateManagerUnlockKey: Boolean = false): Result<Unit, ErrorResponse>

Replaces the cluster spec at its inspected version, optionally rotating credentials.