Class: InfluxDB2::HealthApi Deprecated
- Inherits:
-
DefaultApi
- Object
- DefaultApi
- InfluxDB2::HealthApi
- Defined in:
- lib/influxdb2/client/health_api.rb
Overview
Deprecated.
Use `PingApi` instead
The client of the InfluxDB 2.x that implement Health HTTP API endpoint.
Constant Summary
Constants inherited from DefaultApi
DefaultApi::DEFAULT_REDIRECT_COUNT, DefaultApi::DEFAULT_TIMEOUT, DefaultApi::HEADER_CONTENT_TYPE
Instance Method Summary collapse
-
#health ⇒ HealthCheck
Get the health of an instance.
-
#initialize(options:) ⇒ HealthApi
constructor
A new instance of HealthApi.
Methods inherited from DefaultApi
Constructor Details
#initialize(options:) ⇒ HealthApi
Returns a new instance of HealthApi.
28 29 30 |
# File 'lib/influxdb2/client/health_api.rb', line 28 def initialize(options:) super(options: ) end |
Instance Method Details
#health ⇒ HealthCheck
Get the health of an instance.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/influxdb2/client/health_api.rb', line 35 def health uri = _parse_uri('/health') body = _get(uri).body data = JSON.parse("[#{body}]", symbolize_names: true)[0] HealthCheck.new.tap do |model| model.build_from_hash data end rescue StandardError => e HealthCheck.new.tap do |model| model.name = 'influxdb' model.status = 'fail' model. = e. end end |