class Docker::API::Swarm
This class represents the Docker
API endpoints regarding swamrs. @see docs.docker.com/engine/api/v1.40/#tag/Swarm
Public Instance Methods
Inspect swarm.
Docker
API: GET /swarm @see docs.docker.com/engine/api/v1.40/#operation/SwarmInspect
# File lib/docker/api/swarm.rb, line 34 def details @connection.get("/swarm") end
Initialize a new swarm.
Docker
API: POST /swarm/init @see docs.docker.com/engine/api/v1.40/#operation/SwarmInit
@param body [Hash]: Request body to be sent as json.
# 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 an existing swarm.
Docker
API: POST /swarm/join @see docs.docker.com/engine/api/v1.40/#operation/SwarmJoin
@param body [Hash]: Request body to be sent as json.
# 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 a swarm.
Docker
API: POST /swarm/leave @see docs.docker.com/engine/api/v1.40/#operation/SwarmLeave
@param params [Hash]: Parameters that are appended to the URL.
# File lib/docker/api/swarm.rb, line 76 def leave params = {} @connection.post(build_path("/swarm/leave", params)) end
Unlock a locked manager.
Docker
API: POST /swarm/unlock @see docs.docker.com/engine/api/v1.40/#operation/SwarmUnlock
@param body [Hash]: Request body to be sent as json.
# 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
Get the unlock key.
Docker
API: GET /swarm/unlockkey @see docs.docker.com/engine/api/v1.40/#operation/SwarmUnlockkey
# File lib/docker/api/swarm.rb, line 43 def unlock_key @connection.get("/swarm/unlockkey") end
Update a swarm.
Docker
API: POST /swarm/update @see docs.docker.com/engine/api/v1.40/#operation/SwarmUpdate
@param params [Hash]: Parameters that are appended to the URL. @param body [Hash]: Request body to be sent as json.
# 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