Class: Fog::AWS::ELB::Listener

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/elb/listener.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #to_json, #wait_for

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



19
20
21
22
23
# File 'lib/fog/aws/models/elb/listener.rb', line 19

def destroy
  requires :load_balancer, :lb_port
  connection.delete_load_balancer_listeners(load_balancer.id, [lb_port])
  reload
end

#load_balancerObject



34
35
36
# File 'lib/fog/aws/models/elb/listener.rb', line 34

def load_balancer
  collection.load_balancer
end

#policyObject

Return the policy associated with this load balancer



26
27
28
# File 'lib/fog/aws/models/elb/listener.rb', line 26

def policy
  load_balancer.policies.get(policy_names.first)
end

#reloadObject



30
31
32
# File 'lib/fog/aws/models/elb/listener.rb', line 30

def reload
  load_balancer.reload
end

#saveObject



13
14
15
16
17
# File 'lib/fog/aws/models/elb/listener.rb', line 13

def save
  requires :load_balancer, :instance_port, :lb_port, :protocol
  connection.create_load_balancer_listeners(load_balancer.id, [to_params])
  reload
end

#to_paramsObject



38
39
40
41
42
43
44
45
# File 'lib/fog/aws/models/elb/listener.rb', line 38

def to_params
  {
    'InstancePort'     => instance_port,
    'LoadBalancerPort' => lb_port,
    'Protocol'         => protocol,
    'SSLCertificateId' => ssl_id
  }
end