Class: Docker::API::Config
Overview
This class represents the Docker API endpoints regarding configs.
Configs are application configurations that can be used by services. Swarm mode must be enabled for these endpoints to work.
Instance Method Summary collapse
-
#create(body = {}) ⇒ Object
Create a config.
-
#delete(name) ⇒ Object
Delete a config.
-
#details(name) ⇒ Object
Inspect a config.
-
#list(params = {}) ⇒ Object
List configs.
-
#update(name, params = {}, body = {}) ⇒ Object
Update a config.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Docker::API::Base
Instance Method Details
#create(body = {}) ⇒ Object
Create a config
Docker API: POST /configs/create
26 27 28 |
# 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) ⇒ Object
Delete a config
Docker API: DELETE /configs/id
63 64 65 |
# File 'lib/docker/api/config.rb', line 63 def delete name @connection.delete("/configs/#{name}") end |
#details(name) ⇒ Object
Inspect a config
Docker API: GET /configs/id
37 38 39 |
# File 'lib/docker/api/config.rb', line 37 def details name @connection.get("/configs/#{name}") end |
#list(params = {}) ⇒ Object
List configs
Docker API: GET /configs
15 16 17 |
# File 'lib/docker/api/config.rb', line 15 def list params = {} @connection.get(build_path("/configs",params)) end |
#update(name, params = {}, body = {}) ⇒ Object
Update a config
Docker API: POST /configs/id/update
52 53 54 |
# 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 |