Class: Fog::AWS::ELB::Listener
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::ELB::Listener
- Defined in:
- lib/fog/aws/models/elb/listener.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary (collapse)
- - (Object) destroy
-
- (Listener) initialize(attributes = {})
constructor
A new instance of Listener.
- - (Object) load_balancer
-
- (Object) policy
Return the policy associated with this load balancer.
- - (Object) reload
- - (Object) save
- - (Object) to_params
Methods inherited from Model
#inspect, #symbolize_keys, #to_json, #wait_for
Methods included from Fog::Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Fog::Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
- (Listener) initialize(attributes = {})
A new instance of Listener
14 15 16 17 18 |
# File 'lib/fog/aws/models/elb/listener.rb', line 14 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
- (Object) destroy
26 27 28 29 30 |
# File 'lib/fog/aws/models/elb/listener.rb', line 26 def destroy requires :load_balancer, :lb_port service.delete_load_balancer_listeners(load_balancer.id, [lb_port]) reload end |
- (Object) load_balancer
41 42 43 |
# File 'lib/fog/aws/models/elb/listener.rb', line 41 def load_balancer collection.load_balancer end |
- (Object) policy
Return the policy associated with this load balancer
33 34 35 |
# File 'lib/fog/aws/models/elb/listener.rb', line 33 def policy load_balancer.policies.get(policy_names.first) end |
- (Object) reload
37 38 39 |
# File 'lib/fog/aws/models/elb/listener.rb', line 37 def reload load_balancer.reload end |
- (Object) save
20 21 22 23 24 |
# File 'lib/fog/aws/models/elb/listener.rb', line 20 def save requires :load_balancer, :instance_port, :lb_port, :protocol, :instance_protocol service.create_load_balancer_listeners(load_balancer.id, [to_params]) reload end |
- (Object) to_params
45 46 47 48 49 50 51 52 53 |
# File 'lib/fog/aws/models/elb/listener.rb', line 45 def to_params { 'InstancePort' => instance_port, 'InstanceProtocol' => instance_protocol, 'LoadBalancerPort' => lb_port, 'Protocol' => protocol, 'SSLCertificateId' => ssl_id } end |