class Docker::API::Config

This class represents the Docker API endpoints regarding configs.

@see docs.docker.com/engine/api/v1.40/#tag/Config

Configs are application configurations that can be used by services. Swarm mode must be enabled for these endpoints to work.

Public Instance Methods

create(body = {}) click to toggle source

Create a config

Docker API: POST /configs/create

@see docs.docker.com/engine/api/v1.40/#operation/ConfigCreate

@param body [Hash]: Request body to be sent as json.

# File lib/docker/api/config.rb, line 26
def create body = {}
    @connection.request(method: :post, path: "/configs/create", headers: {"Content-Type": "application/json"}, body: body.to_json)
end
delete(name) click to toggle source

Delete a config

Docker API: DELETE /configs/{id}

@see docs.docker.com/engine/api/v1.40/#operation/ConfigDelete

@param name [String]: The ID or name of the config.

# File lib/docker/api/config.rb, line 63
def delete name
    @connection.delete("/configs/#{name}")
end
details(name) click to toggle source

Inspect a config

Docker API: GET /configs/{id}

@see docs.docker.com/engine/api/v1.40/#operation/ConfigInspect

@param name [String]: The ID or name of the config.

# File lib/docker/api/config.rb, line 37
def details name
    @connection.get("/configs/#{name}")
end
list(params = {}) click to toggle source

List configs

Docker API: GET /configs

@see docs.docker.com/engine/api/v1.40/#operation/ConfigList

@param params [Hash]: Parameters that are appended to the URL.

# File lib/docker/api/config.rb, line 15
def list params = {}
    @connection.get(build_path("/configs",params))
end
update(name, params = {}) click to toggle source

Update a config

Docker API: POST /configs/{id}/update

@see docs.docker.com/engine/api/v1.40/#operation/ConfigUpdate

@param name [String]: The ID or name of the config.

@param params [Hash]: Parameters that are appended to the URL.

@param body [Hash]: Request body to be sent as json.

# File lib/docker/api/config.rb, line 52
def update name, params = {}, body = {}
    @connection.request(method: :post, path: build_path("/configs/#{name}/update",params), headers: {"Content-Type": "application/json"}, body: body.to_json)
end