Class: Applb::ClientWrapper

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/applb/client_wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ClientWrapper

Returns a new instance of ClientWrapper.



14
15
16
17
18
# File 'lib/applb/client_wrapper.rb', line 14

def initialize(options)
  @includes = options[:includes] || []
  @excludes = options[:excludes] || []
  @client = Aws::ElasticLoadBalancingV2::Client.new
end

Instance Method Details

#delete_load_balancer(arn) ⇒ Object



33
34
35
# File 'lib/applb/client_wrapper.rb', line 33

def delete_load_balancer(arn)
  @client.delete_load_balancer(load_balancer_arn: arn)
end

#listeners(*argv) ⇒ Object



48
49
50
51
52
53
54
55
56
57
# File 'lib/applb/client_wrapper.rb', line 48

def listeners(*argv)
  results = []
  next_marker = nil
  begin
    resp = @client.describe_listeners(*argv)
    results.push(*resp.listeners)
    next_marker = resp.next_marker
  end while next_marker
  results
end

#load_balancer_attributes(*argv) ⇒ Object



70
71
72
73
# File 'lib/applb/client_wrapper.rb', line 70

def load_balancer_attributes(*argv)
  resp = @client.describe_load_balancer_attributes(*argv)
  resp.attributes
end

#load_balancersObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/applb/client_wrapper.rb', line 20

def load_balancers
  results = []
  next_marker = nil
  begin
    resp = @client.describe_load_balancers(marker: next_marker)
    resp.load_balancers.each do |lb|
      results << lb if target?(lb)
    end
    next_marker = resp.next_marker
  end while next_marker
  results
end

#rules(*argv) ⇒ Object



59
60
61
62
63
64
65
66
67
68
# File 'lib/applb/client_wrapper.rb', line 59

def rules(*argv)
  results = []
  next_marker = nil
  begin
    resp = @client.describe_rules(*argv)
    results.push(*resp.rules)
    next_marker = resp.next_marker
  end while next_marker
  results
end

#target_groups(*argv) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/applb/client_wrapper.rb', line 37

def target_groups(*argv)
  results = []
  next_marker = nil
  begin
    resp = @client.describe_target_groups(*argv)
    results.push(*resp.target_groups)
    next_marker = resp.next_marker
  end while next_marker
  results
end