Module: Consulkit::Client::Health

Included in:
Consulkit::Client
Defined in:
lib/consulkit/client/health.rb

Overview

Methods for querying health checks registered with Consul.

Instance Method Summary collapse

Instance Method Details

#health_list_service_instances(service, query_params = {}) {|Faraday::Response| ... } ⇒ Array<Hash>

Returns the list of service instances providing the given service, including health check information.

Parameters:

  • key (String)

    the key to read.

  • query_params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (query_params):

  • optional (Hash)

    query parameters.

  • :passing (Boolean)
  • :filter (String)

Yields:

  • (Faraday::Response)

    The response from the underlying Faraday library.

Returns:

  • (Array<Hash>)

See Also:



21
22
23
24
25
26
27
28
29
# File 'lib/consulkit/client/health.rb', line 21

def health_list_service_instances(service, query_params = {})
  response = get("/v1/health/service/#{service}", query_params)

  if block_given?
    yield response
  else
    response.body
  end
end