Class: Docker::API::Swarm
Overview
This class represents the Docker API endpoints regarding swamrs.
Instance Method Summary collapse
-
#details ⇒ Object
Inspect swarm.
-
#init(body = {}) ⇒ Object
Initialize a new swarm.
-
#join(body = {}) ⇒ Object
Join an existing swarm.
-
#leave(params = {}) ⇒ Object
Leave a swarm.
-
#unlock(body = {}) ⇒ Object
Unlock a locked manager.
-
#unlock_key ⇒ Object
Get the unlock key.
-
#update(params = {}, body = {}) ⇒ Object
Update a swarm.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Docker::API::Base
Instance Method Details
#details ⇒ Object
Inspect swarm.
Docker API: GET /swarm
34 35 36 |
# File 'lib/docker/api/swarm.rb', line 34 def details @connection.get("/swarm") end |
#init(body = {}) ⇒ Object
Initialize a new swarm.
Docker API: POST /swarm/init
13 14 15 |
# File 'lib/docker/api/swarm.rb', line 13 def init body = {} @connection.request(method: :post, path: build_path("/swarm/init"), headers: {"Content-Type": "application/json"}, body: body.to_json) end |
#join(body = {}) ⇒ Object
Join an existing swarm.
Docker API: POST /swarm/join
65 66 67 |
# File 'lib/docker/api/swarm.rb', line 65 def join body = {} @connection.request(method: :post, path: "/swarm/join", headers: {"Content-Type": "application/json"}, body: body.to_json) end |
#leave(params = {}) ⇒ Object
Leave a swarm.
Docker API: POST /swarm/leave
76 77 78 |
# File 'lib/docker/api/swarm.rb', line 76 def leave params = {} @connection.post(build_path("/swarm/leave", params)) end |
#unlock(body = {}) ⇒ Object
Unlock a locked manager.
Docker API: POST /swarm/unlock
54 55 56 |
# File 'lib/docker/api/swarm.rb', line 54 def unlock body = {} @connection.request(method: :post, path: "/swarm/unlock", headers: {"Content-Type": "application/json"}, body: body.to_json) end |
#unlock_key ⇒ Object
Get the unlock key.
Docker API: GET /swarm/unlockkey
43 44 45 |
# File 'lib/docker/api/swarm.rb', line 43 def unlock_key @connection.get("/swarm/unlockkey") end |
#update(params = {}, body = {}) ⇒ Object
Update a swarm.
Docker API: POST /swarm/update
25 26 27 |
# File 'lib/docker/api/swarm.rb', line 25 def update params = {}, body = {} @connection.request(method: :post, path: build_path("/swarm/update", params), headers: {"Content-Type": "application/json"}, body: body.to_json) end |