lib/docker/swarm/swarm.rb
# Return all of the Nodes.
Return all of the Nodes.
Return all of the Nodes .
def nodes
    opts = {}
    query = {}
    response = self.connection.get('/nodes', query, :body => opts.to_json, expects: [200, 406], full_response: true)
    if (response.status == 200)
      hashes = JSON.parse(response.body)
      nodes = []
      hashes.each do |node_hash|
        node  = Docker::Swarm::Node.new(self, node_hash)
        nodes << node
      end
      return nodes || []
    else
      return []
    end
  end
def nodes opts = { } query = { } response = self . connection . get ( '/nodes' , query , :body => opts . to_json , expects : [ 200 , 406 ] , full_response : true ) if ( response . status == 200 ) hashes = JSON . parse ( response . body ) nodes = [ ] hashes . each do | node_hash | node = Docker :: Swarm :: Node . new ( self , node_hash ) nodes << node end return nodes || [ ] else return [ ] end end
Return all of the Nodes.
Return all of the Nodes .