Class: Fog::AWS::ELB::Listener
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::ELB::Listener
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
#inspect, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
#initialize(attributes = {}) ⇒ Listener
Returns a new instance of Listener.
13
14
15
16
17
|
# File 'lib/fog/aws/models/elb/listener.rb', line 13
def initialize(attributes={})
merge_attributes(:policy_names => [], :instance_port => 80, :lb_port => 80, :protocol => 'HTTP')
super
end
|
Instance Method Details
#destroy ⇒ Object
25
26
27
28
29
|
# File 'lib/fog/aws/models/elb/listener.rb', line 25
def destroy
requires :load_balancer, :lb_port
connection.delete_load_balancer_listeners(load_balancer.id, [lb_port])
reload
end
|
#load_balancer ⇒ Object
40
41
42
|
# File 'lib/fog/aws/models/elb/listener.rb', line 40
def load_balancer
collection.load_balancer
end
|
#policy ⇒ Object
Return the policy associated with this load balancer
32
33
34
|
# File 'lib/fog/aws/models/elb/listener.rb', line 32
def policy
load_balancer.policies.get(policy_names.first)
end
|
#reload ⇒ Object
36
37
38
|
# File 'lib/fog/aws/models/elb/listener.rb', line 36
def reload
load_balancer.reload
end
|
#save ⇒ Object
19
20
21
22
23
|
# File 'lib/fog/aws/models/elb/listener.rb', line 19
def save
requires :load_balancer, :instance_port, :lb_port, :protocol
connection.create_load_balancer_listeners(load_balancer.id, [to_params])
reload
end
|
#to_params ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/fog/aws/models/elb/listener.rb', line 44
def to_params
{
'InstancePort' => instance_port,
'LoadBalancerPort' => lb_port,
'Protocol' => protocol,
'SSLCertificateId' => ssl_id
}
end
|