Class: Bcome::Node::Estate

Inherits:
Base show all
Includes:
Selections
Defined in:
lib/nodes/estate.rb

Instance Attribute Summary

Attributes inherited from Base

#meta_data, #stack_peer

Instance Method Summary collapse

Methods included from Selections

#add, #add!, #add_object, #clear!, #find_resource_by_identifier, #get, #in_resources?, #manage_object, #no_selections?, #no_selections_error, #object_in_selections?, #put, #remove, #remove_object, #selections

Methods inherited from Base

#initialize, #interactive, #method_missing, #set_parent_reference, #set_stack_peer

Methods included from CommandHelper

#run_local

Constructor Details

This class inherits a constructor from Bcome::Node::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bcome::Node::Base

Instance Method Details

#environmentsObject



26
27
28
# File 'lib/nodes/estate.rb', line 26

def environments
  @environments ||= platforms.collect(&:environments).flatten
end

#list_allObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/nodes/estate.rb', line 30

def list_all
  estate_machine_list = "\n"
  platforms.each do |platform|
    estate_machine_list += "* #{platform.identifier}\n"
    platform.environments.each do |environment|
    estate_machine_list += "\t- #{environment.identifier}\n"
      environment.instances.each do |instance|
        estate_machine_list += "\t\t / #{instance.identifier} (#{instance.public_ip_address})\n"
      end 
    end
  end

  puts estate_machine_list

  return ""
end

#lsObject



14
15
16
# File 'lib/nodes/estate.rb', line 14

def ls
  self.stack_peer.ls
end

#machinesObject



6
7
8
# File 'lib/nodes/estate.rb', line 6

def machines
  platforms.collect(&:machines).flatten
end

#namespaceObject



10
11
12
# File 'lib/nodes/estate.rb', line 10

def namespace
  ""
end

#run(raw_command, bootstrap = false) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/nodes/estate.rb', line 18

def run(raw_command, bootstrap = false)
  return unless platforms
  platforms.pmap {|platform|
    platform.run(raw_command, bootstrap)
  }
  return
end