Module: Cyclid::Client::Health
- Included in:
- Tilapia
- Defined in:
- lib/cyclid/client/health.rb
Overview
Health-check related methods
Instance Method Summary collapse
-
#health_ping ⇒ Boolean
Ping the API server.
Instance Method Details
#health_ping ⇒ Boolean
Ping the API server.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cyclid/client/health.rb', line 23 def health_ping uri = server_uri('/health/status') # We need to do without the API helpers as the health endpoint won't # return any data, just an HTTP status req = authenticate_request(Net::HTTP::Get.new(uri), uri) http = Net::HTTP.new(uri.hostname, uri.port) res = http.request(req) return res.code == '200' end |