Class: Docker::API::Node
Overview
This class represents the Docker API endpoints regarding nodes.
Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work.
Instance Method Summary collapse
-
#delete(name, params = {}) ⇒ Object
Delete a node.
-
#details(name) ⇒ Object
Inspect a node.
-
#list(params = {}) ⇒ Object
List nodes.
-
#update(name, params = {}, body = {}) ⇒ Object
Update a node.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Docker::API::Base
Instance Method Details
#delete(name, params = {}) ⇒ Object
Delete a node.
Docker API: DELETE /nodes/id
39 40 41 |
# File 'lib/docker/api/node.rb', line 39 def delete name, params = {} @connection.delete(build_path("/nodes/#{name}", params)) end |
#details(name) ⇒ Object
Inspect a node.
Docker API: GET /nodes/id
50 51 52 |
# File 'lib/docker/api/node.rb', line 50 def details name @connection.get("/nodes/#{name}") end |
#list(params = {}) ⇒ Object
List nodes.
Docker API: GET /nodes
14 15 16 |
# File 'lib/docker/api/node.rb', line 14 def list params = {} @connection.get(build_path("/nodes", params)) end |
#update(name, params = {}, body = {}) ⇒ Object
Update a node.
Docker API: POST /nodes/id/update
27 28 29 |
# File 'lib/docker/api/node.rb', line 27 def update name, params = {}, body = {} @connection.request(method: :post, path: build_path("nodes/#{name}/update", params), headers: {"Content-Type": "application/json"}, body: body.to_json) end |