class Docker::API::Node
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. @see docs.docker.com/engine/api/v1.40/#tag/Node
Public Instance Methods
Delete a node.
Docker
API: DELETE /nodes/{id} @see docs.docker.com/engine/api/v1.40/#operation/NodeDelete
@param name [String]: The ID or name of the node. @param params [Hash]: Parameters that are appended to the URL.
# File lib/docker/api/node.rb, line 39 def delete name, params = {} @connection.delete(build_path("/nodes/#{name}", params)) end
Inspect a node.
Docker
API: GET /nodes/{id} @see docs.docker.com/engine/api/v1.40/#operation/NodeInspect
@param name [String]: The ID or name of the node.
# File lib/docker/api/node.rb, line 50 def details name @connection.get("/nodes/#{name}") end
List nodes.
Docker
API: GET /nodes @see docs.docker.com/engine/api/v1.40/#operation/NodeList
@param params [Hash]: Parameters that are appended to the URL.
# File lib/docker/api/node.rb, line 14 def list params = {} @connection.get(build_path("/nodes", params)) end
Update a node.
Docker
API: POST /nodes/{id}/update @see docs.docker.com/engine/api/v1.40/#operation/NodeUpdate
@param name [String]: The ID or name of the node. @param params [Hash]: Parameters that are appended to the URL. @param body [Hash]: Request body to be sent as json.
# 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