Class: Fog::AWS::ELB::Listener
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::ELB::Listener
- Defined in:
- lib/fog/aws/models/elb/listener.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Listener
constructor
A new instance of Listener.
- #load_balancer ⇒ Object
-
#policy ⇒ Object
Return the policy associated with this load balancer.
- #reload ⇒ Object
- #save ⇒ Object
- #to_params ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Listener
Returns a new instance of Listener.
12 13 14 15 16 |
# File 'lib/fog/aws/models/elb/listener.rb', line 12 def initialize(attributes={}) # set defaults, which may be overridden in super merge_attributes(:policy_names => [], :instance_port => 80, :instance_protocol => 'HTTP', :lb_port => 80, :protocol => 'HTTP') super end |
Instance Method Details
#destroy ⇒ Object
24 25 26 27 28 |
# File 'lib/fog/aws/models/elb/listener.rb', line 24 def destroy requires :load_balancer, :lb_port service.delete_load_balancer_listeners(load_balancer.id, [lb_port]) reload end |
#load_balancer ⇒ Object
39 40 41 |
# File 'lib/fog/aws/models/elb/listener.rb', line 39 def load_balancer collection.load_balancer end |
#policy ⇒ Object
Return the policy associated with this load balancer
31 32 33 |
# File 'lib/fog/aws/models/elb/listener.rb', line 31 def policy load_balancer.policies.get(policy_names.first) end |
#reload ⇒ Object
35 36 37 |
# File 'lib/fog/aws/models/elb/listener.rb', line 35 def reload load_balancer.reload end |
#save ⇒ Object
18 19 20 21 22 |
# File 'lib/fog/aws/models/elb/listener.rb', line 18 def save requires :load_balancer, :instance_port, :lb_port, :protocol, :instance_protocol service.create_load_balancer_listeners(load_balancer.id, [to_params]) reload end |
#to_params ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/fog/aws/models/elb/listener.rb', line 43 def to_params { 'InstancePort' => instance_port, 'InstanceProtocol' => instance_protocol, 'LoadBalancerPort' => lb_port, 'Protocol' => protocol, 'SSLCertificateId' => ssl_id } end |