Class: Tama::Apis::WakameApiTest

Inherits:
Object
  • Object
show all
Includes:
InstanceHashBuilder
Defined in:
lib/apis/wakame.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InstanceHashBuilder

#build_instances_hash, #dns_list, #ip_list, #private_dns, #private_ip

Constructor Details

#initializeWakameApiTest

Returns a new instance of WakameApiTest.



168
169
170
171
172
173
174
175
# File 'lib/apis/wakame.rb', line 168

def initialize
  self.host_nodes_file = "#{File.expand_path(File.dirname(__FILE__))}/../../test/test_files/host_nodes.json"
  self.show_instance_specs_file = "#{File.expand_path(File.dirname(__FILE__))}/../../test/test_files/show_instance_specs.json"
  self.show_instances_file = "#{File.expand_path(File.dirname(__FILE__))}/../../test/test_files/describe_instances.json"
  
  self. = "a-shpoolxx"
  self.private_network_name = "nw-data"
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



157
158
159
# File 'lib/apis/wakame.rb', line 157

def 
  @account
end

#host_nodes_fileObject Also known as: describe_host_nodes_file

Returns the value of attribute host_nodes_file.



153
154
155
# File 'lib/apis/wakame.rb', line 153

def host_nodes_file
  @host_nodes_file
end

#private_network_nameObject

Returns the value of attribute private_network_name.



156
157
158
# File 'lib/apis/wakame.rb', line 156

def private_network_name
  @private_network_name
end

#show_instance_specs_fileObject Also known as: describe_instance_specs_file

Returns the value of attribute show_instance_specs_file.



154
155
156
# File 'lib/apis/wakame.rb', line 154

def show_instance_specs_file
  @show_instance_specs_file
end

#show_instances_fileObject Also known as: describe_instances_file

Returns the value of attribute show_instances_file.



155
156
157
# File 'lib/apis/wakame.rb', line 155

def show_instances_file
  @show_instances_file
end

Instance Method Details

#show_host_nodes(list = []) ⇒ Object Also known as: describe_host_nodes



177
178
179
# File 'lib/apis/wakame.rb', line 177

def show_host_nodes(list = [])
  read_file(self.host_nodes_file, list).first["results"]
end

#show_instance_specs(list = []) ⇒ Object Also known as: describe_instance_specs



182
183
184
# File 'lib/apis/wakame.rb', line 182

def show_instance_specs(list = [])
  read_file(self.show_instance_specs_file, list).first["results"]
end

#show_instances(list = []) ⇒ Object Also known as: describe_instances

This method could be taken care of by the EC2 adapter but since we want to show ip addresses differently from EC2, we add it to the Wakame part of Tama



190
191
192
193
# File 'lib/apis/wakame.rb', line 190

def show_instances(list = [])
  instances = read_file(self.show_instances_file, list)
  build_instances_hash(instances,self.)
end