24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/cloudlb/health_monitor.rb', line 24
def populate
response = @connection.lbreq("GET",@lbmgmthost,"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@load_balancer.id.to_s)}/healthmonitor",@lbmgmtport,@lbmgmtscheme)
CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)
data = JSON.parse(response.body)['healthMonitor']
@enabled = data == {} ? false : true
return nil unless @enabled
@type = data["type"]
@delay = data["delay"]
@timeout = data["timeout"]
@attempts_before_deactivation = data["attemptsBeforeDeactivation"]
@path = data["path"]
@status_regex = data["statusRegex"]
@body_regex = data["bodyRegex"]
true
end
|