Module: Spice::Connection::Nodes

Included in:
Spice, Spice::Connection
Defined in:
lib/spice/connection/nodes.rb

Instance Method Summary collapse

Instance Method Details

#node(name) ⇒ Spice::Node

Retrieve a single client

Examples:

Retrieve the node named "app.example.com"

Spice.node("app.example.com")

Raises:



22
23
24
25
# File 'lib/spice/connection/nodes.rb', line 22

def node(name)
  node_attributes = connection.get("/nodes/#{name}").body
  Spice::Node.new(node_attributes)
end

#nodes(options = {}) ⇒ Array<Spice::Node>

A collection of nodes

Examples:

Retrieve all nodes that have the role "base"

Spice.nodes(:q => "roles:base")

Retrieve nodes with role "base" in the "production" environment

Spice.nodes(:q => "roles:base AND environment:production")

See Also:



12
13
14
# File 'lib/spice/connection/nodes.rb', line 12

def nodes(options={})
  connection.search('node', options)
end