class Sonic::ServiceChecker
Attributes
error[RW]
host[RW]
password[RW]
path[RW]
payload[RW]
port[RW]
protocol[RW]
response[RW]
ssl_cert[RW]
ssl_key[RW]
username[RW]
vhost[RW]
Public Class Methods
new(protocol, host, port, username=nil, password=nil, vhost=nil, path=nil, payload=nil, ssl_cert=nil, ssl_key=nil)
click to toggle source
# File lib/sonic/service_checker.rb, line 17 def initialize(protocol, host, port, username=nil, password=nil, vhost=nil, path=nil, payload=nil, ssl_cert=nil, ssl_key=nil) @protocol = protocol @host = host @port = port @username = username @password = password @vhost = vhost @path = path @payload = payload @ssl_key = ssl_key @ssl_cert = ssl_cert end
Public Instance Methods
check_service()
click to toggle source
# File lib/sonic/service_checker.rb, line 30 def check_service() @response = nil @error = nil case protocol when :http, :https http = Protocol::HTTP.new(self) http.get when :amqp amqp = Protocol::AMQP.new(self) amqp.check when :tcp tcp = Protocol::TCP.new(self) tcp.send end end