Services

class Services(dockerClient: DockerClient)

Manager operations. HTTP failures return Result errors; transport failures and cancellation throw.

Constructors

Link copied to clipboard
constructor(dockerClient: DockerClient)

Functions

Link copied to clipboard
suspend fun create(spec: ServiceSpec, registryAuth: String? = null): Result<ServiceCreateResponse, ErrorResponse>

Creates a service; success does not mean tasks are ready. Auth is already Base64url encoded.

Link copied to clipboard
suspend fun getInfo(id: String, insertDefaults: Boolean = false): Result<Service, ErrorResponse>

Inspects a resource by ID or name.

Link copied to clipboard
suspend fun getList(filters: Map<String, List<String>>? = null, status: Boolean = false): Result<List<Service>, ErrorResponse>

Lists resources using Docker's JSON filter map.

Link copied to clipboard
suspend fun getLogs(id: String, parameters: SwarmLogsParameters = SwarmLogsParameters()): Result<Flow<LogLine>, ErrorResponse>

Inspects TTY framing now, then returns a cold log flow. Collection opens the log request. Collection HTTP errors throw DockerApiException; cancellation/completion closes the request. Docker requires a supported logging driver. No retry or ordering across tasks is added.

Link copied to clipboard
suspend fun remove(id: String): Result<Unit, ErrorResponse>

Removes the resource. Docker asynchronously removes its tasks.

Link copied to clipboard
suspend fun update(id: String, version: ULong, spec: ServiceSpec, registryAuth: String? = null, registryAuthFrom: String? = null, rollback: String? = null): Result<ServiceUpdateResponse, ErrorResponse>

Replaces the spec using its inspected version. No merge, retry or readiness wait is performed. Set rollback to "previous" for server-side rollback. Pass a complete valid spec even for rollback. registryAuthFrom selects "spec" or "previous-spec" when registryAuth is absent.