Class: Phase::Adapters::AWS::LoadBalancer

Inherits:
Phase::Adapters::Abstract::LoadBalancer show all
Defined in:
lib/phase/adapters/aws/load_balancer.rb

Instance Attribute Summary

Attributes inherited from Phase::Adapters::Abstract::Base

#resource

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Phase::Adapters::Abstract::Base

#initialize

Constructor Details

This class inherits a constructor from Phase::Adapters::Abstract::Base

Class Method Details

.allArray<AWS::LoadBalancer>

Returns All known ELB instances.

Returns:



23
24
25
# File 'lib/phase/adapters/aws/load_balancer.rb', line 23

def all
  api.load_balancers.all.map {|balancer| new(balancer) }
end

.find(balancer_name) ⇒ AWS::LoadBalancer

Returns The requested ELB instance.

Parameters:

  • balancer_name (String)

    The name of the requested ELB instance

Returns:



29
30
31
# File 'lib/phase/adapters/aws/load_balancer.rb', line 29

def find(balancer_name)
  new(api.load_balancers.get(balancer_name))
end

Instance Method Details

#deregister_server(server_id, options = {}) ⇒ AWS::Server

Returns The deregistered EC2 instance.

Parameters:

  • server_id (String)

    The ID of the instance to deregister

Returns:



8
9
# File 'lib/phase/adapters/aws/load_balancer.rb', line 8

def deregister_server(server_id, options = {})
end

#register_server(server_id, options = {}) ⇒ AWS::Server

Returns The registered EC2 instance.

Parameters:

  • server_id (String)

    The ID of the instance to register

Returns:



13
14
# File 'lib/phase/adapters/aws/load_balancer.rb', line 13

def register_server(server_id, options = {})
end

#serversArray<AWS::Server>

Returns The EC2 instances registered to this ELB instance.

Returns:

  • (Array<AWS::Server>)

    The EC2 instances registered to this ELB instance



17
18
19
# File 'lib/phase/adapters/aws/load_balancer.rb', line 17

def servers
  Server.all(instance_ids: resource.instances)
end