Module: Stackit::Mixin::Tier

Includes:
AvailabilityZone
Defined in:
lib/stackit/mixin/tier.rb

Instance Attribute Summary collapse

Attributes included from AvailabilityZone

#az_syms

Instance Method Summary collapse

Methods included from AvailabilityZone

#availability_zones, #random_az, #random_az_hash, #selected_az, #selected_az_sym

Instance Attribute Details

#tierObject

Returns the value of attribute tier.



7
8
9
# File 'lib/stackit/mixin/tier.rb', line 7

def tier
  @tier
end

#tier_mapObject

Returns the value of attribute tier_map.



8
9
10
# File 'lib/stackit/mixin/tier.rb', line 8

def tier_map
  @tier_map
end

Instance Method Details

#random_az_and_subnetObject



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/stackit/mixin/tier.rb', line 40

def random_az_and_subnet
  random_az = random_az_hash
  random_az_sym = random_az.keys[0]
  random_az_value = random_az.values[0]
  selected_subnet_sym = tier_map[tier][random_az_sym]
  resolved_subnet = resolve_parameter(selected_subnet_sym)
  {
    :az => random_az_value,
    :subnet => resolved_subnet
  }
end

#random_subnetObject



30
31
32
# File 'lib/stackit/mixin/tier.rb', line 30

def random_subnet
  random_az_and_subnet[:subnet]
end

#random_subnet_symObject



34
35
36
37
38
# File 'lib/stackit/mixin/tier.rb', line 34

def random_subnet_sym
  random_az = random_az_hash
  random_az_sym = random_az.keys[0]
  tier_map[tier][random_az_sym]
end

#selected_subnetObject



22
23
24
# File 'lib/stackit/mixin/tier.rb', line 22

def selected_subnet
  resolve_parameter(selected_subnet_sym)
end

#selected_subnet_symObject



18
19
20
# File 'lib/stackit/mixin/tier.rb', line 18

def selected_subnet_sym
  tier_map[tier][selected_az_sym]
end

#subnetsObject



26
27
28
# File 'lib/stackit/mixin/tier.rb', line 26

def subnets
  resolve_parameters(tier_map[tier].values)
end