Class: Sonic::ServiceChecker
- Inherits:
-
Object
- Object
- Sonic::ServiceChecker
- Defined in:
- lib/sonic/service_checker.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#host ⇒ Object
Returns the value of attribute host.
-
#path ⇒ Object
Returns the value of attribute path.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#port ⇒ Object
Returns the value of attribute port.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#response ⇒ Object
Returns the value of attribute response.
-
#ssl_cert ⇒ Object
Returns the value of attribute ssl_cert.
-
#ssl_key ⇒ Object
Returns the value of attribute ssl_key.
Instance Method Summary collapse
- #check_service ⇒ Object
-
#initialize(protocol, host, port, path = nil, payload = nil, ssl_cert = nil, ssl_key = nil) ⇒ ServiceChecker
constructor
A new instance of ServiceChecker.
Constructor Details
#initialize(protocol, host, port, path = nil, payload = nil, ssl_cert = nil, ssl_key = nil) ⇒ ServiceChecker
Returns a new instance of ServiceChecker.
14 15 16 17 18 19 20 21 22 |
# File 'lib/sonic/service_checker.rb', line 14 def initialize(protocol, host, port, path=nil, payload=nil, ssl_cert=nil, ssl_key=nil) @protocol = protocol @host = host @port = port @path = path @payload = payload @ssl_key = ssl_key @ssl_cert = ssl_cert end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
12 13 14 |
# File 'lib/sonic/service_checker.rb', line 12 def error @error end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/sonic/service_checker.rb', line 5 def host @host end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/sonic/service_checker.rb', line 7 def path @path end |
#payload ⇒ Object
Returns the value of attribute payload.
8 9 10 |
# File 'lib/sonic/service_checker.rb', line 8 def payload @payload end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/sonic/service_checker.rb', line 6 def port @port end |
#protocol ⇒ Object
Returns the value of attribute protocol.
4 5 6 |
# File 'lib/sonic/service_checker.rb', line 4 def protocol @protocol end |
#response ⇒ Object
Returns the value of attribute response.
11 12 13 |
# File 'lib/sonic/service_checker.rb', line 11 def response @response end |
#ssl_cert ⇒ Object
Returns the value of attribute ssl_cert.
10 11 12 |
# File 'lib/sonic/service_checker.rb', line 10 def ssl_cert @ssl_cert end |
#ssl_key ⇒ Object
Returns the value of attribute ssl_key.
9 10 11 |
# File 'lib/sonic/service_checker.rb', line 9 def ssl_key @ssl_key end |
Instance Method Details
#check_service ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sonic/service_checker.rb', line 24 def check_service() 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 |