Class: Topo::Provision::LoadBalancerGenerator

Inherits:
ResourceGenerator show all
Includes:
Topo::ParseGen
Defined in:
lib/topo/provision/generators/load_balancer.rb

Direct Known Subclasses

AwsLoadBalancerGenerator

Instance Attribute Summary

Attributes inherited from ResourceGenerator

#name, #resource_attributes, #resource_type, #undeploy_action

Instance Method Summary collapse

Methods included from Topo::ParseGen

#convert_keys_to_sym, #convert_keys_to_sym_deep, #expand_ref, #lazy_attribute_to_s, #topo_refs, #value_from_path

Methods inherited from ResourceGenerator

#default_action, #default_resource_template, #deploy, #do_action, #template, #template_root_dir, #undeploy

Constructor Details

#initialize(data) ⇒ LoadBalancerGenerator

Returns a new instance of LoadBalancerGenerator.



27
28
29
30
31
32
33
34
35
36
# File 'lib/topo/provision/generators/load_balancer.rb', line 27

def initialize(data)
  @resource_type ||= "load_balancer"
  super
  @undeploy_action = "destroy"
  %w[machines load_balancer_options].each do |key|
    @resource_attributes[key] = data['provisioning'][key] if data['provisioning'].key? key
  end
  
  # Note: driver-specific classes may need to convert load_balancer_options into symbols
end