Class: BigBang::DSL::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/bigbang/dsl/run.rb

Direct Known Subclasses

ClusterRun

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, instances) ⇒ Run

Returns a new instance of Run.



9
10
11
12
13
14
15
# File 'lib/bigbang/dsl/run.rb', line 9

def initialize(name, instances)
	@zone_sizes = {}
	@ec2_instances = []
	@assigned_ips = {}
	@instance = instances.find { |i| i.name == name }
	raise "instance #{name} not found" if @instance.nil?
end

Instance Attribute Details

#assigned_ipsObject

Returns the value of attribute assigned_ips.



7
8
9
# File 'lib/bigbang/dsl/run.rb', line 7

def assigned_ips
  @assigned_ips
end

#domainObject

Returns the value of attribute domain.



4
5
6
# File 'lib/bigbang/dsl/run.rb', line 4

def domain
  @domain
end

#ec2_instancesObject

Returns the value of attribute ec2_instances.



6
7
8
# File 'lib/bigbang/dsl/run.rb', line 6

def ec2_instances
  @ec2_instances
end

#elastic_ipObject

Returns the value of attribute elastic_ip.



4
5
6
# File 'lib/bigbang/dsl/run.rb', line 4

def elastic_ip
  @elastic_ip
end

#instanceObject

Returns the value of attribute instance.



4
5
6
# File 'lib/bigbang/dsl/run.rb', line 4

def instance
  @instance
end

#wildcard_domainObject

Returns the value of attribute wildcard_domain.



4
5
6
# File 'lib/bigbang/dsl/run.rb', line 4

def wildcard_domain
  @wildcard_domain
end

#zone_sizesObject

Returns the value of attribute zone_sizes.



5
6
7
# File 'lib/bigbang/dsl/run.rb', line 5

def zone_sizes
  @zone_sizes
end

Instance Method Details

#instances_countObject



23
24
25
# File 'lib/bigbang/dsl/run.rb', line 23

def instances_count
	zones.values.inject(0) { |m,v| m += v }
end

#zonesObject



17
18
19
20
21
# File 'lib/bigbang/dsl/run.rb', line 17

def zones
	return @zone_sizes unless @zone_sizes.empty?

	{ nil => 1 }
end