Configs

class Configs(dockerClient: DockerClient)

Docker Swarm config operations. Requires a Swarm manager; this API never initializes Swarm. HTTP errors return the original SDK Result. Transport/decoding failures and cancellation throw. The caller owns the client. Operations are never retried automatically.

Constructors

Link copied to clipboard
constructor(dockerClient: DockerClient)

Functions

Link copied to clipboard
suspend fun create(spec: ConfigSpec): Result<SwarmCreateResponse, ErrorResponse>

Creates a config. Data in spec must already be Base64 encoded; no encoding is performed here. Docker validates payload size, names and driver options. Treat specs and responses as sensitive.

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

Inspects a config by ID or name. Config data may be returned; it is not a secret store.

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

Lists config metadata. Filters accept id, name, names and label, encoded as JSON.

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

Deletes a config by ID or name. Docker rejects removal while a service references it.

Link copied to clipboard
suspend fun update(id: String, version: ULong, spec: ConfigSpec): Result<Unit, ErrorResponse>

Updates labels using the version index from the latest inspect response. Copy the inspected spec and change only labels; other fields must remain unchanged. Stale versions are reported as Docker errors. No re-inspection, merging or retry is performed.