Class: Kelbim::DSL::EC2::LoadBalancer::HealthCheck

Inherits:
Object
  • Object
show all
Includes:
Checker
Defined in:
lib/kelbim/dsl/health-check.rb

Instance Method Summary collapse

Constructor Details

#initialize(load_balancer, &block) ⇒ HealthCheck

Returns a new instance of HealthCheck.



11
12
13
14
15
# File 'lib/kelbim/dsl/health-check.rb', line 11

def initialize(load_balancer, &block)
  @error_identifier = "LoadBalancer `#{load_balancer}`"
  @result = {}
  instance_eval(&block)
end

Instance Method Details

#healthy_threshold(value) ⇒ Object



42
43
44
45
46
# File 'lib/kelbim/dsl/health-check.rb', line 42

def healthy_threshold(value)
  call_once(:healthy_threshold)
  expected_type(value, Integer)
  @result[:healthy_threshold] = value
end

#interval(value) ⇒ Object



36
37
38
39
40
# File 'lib/kelbim/dsl/health-check.rb', line 36

def interval(value)
  call_once(:interval)
  expected_type(value, Integer)
  @result[:interval] = value
end

#resultObject



17
18
19
20
21
22
23
# File 'lib/kelbim/dsl/health-check.rb', line 17

def result
  [:target, :timeout, :interval, :healthy_threshold, :unhealthy_threshold].each do |name|
    required(name, @result[name])
  end

  @result
end

#target(value) ⇒ Object



25
26
27
28
# File 'lib/kelbim/dsl/health-check.rb', line 25

def target(value)
  call_once(:target)
  @result[:target] = value
end

#timeout(value) ⇒ Object



30
31
32
33
34
# File 'lib/kelbim/dsl/health-check.rb', line 30

def timeout(value)
  call_once(:timeout)
  expected_type(value, Integer)
  @result[:timeout] = value
end

#unhealthy_threshold(value) ⇒ Object



48
49
50
51
52
# File 'lib/kelbim/dsl/health-check.rb', line 48

def unhealthy_threshold(value)
  call_once(:unhealthy_threshold)
  expected_type(value, Integer)
  @result[:unhealthy_threshold] = value
end