Sha256: b37d8f3ae0e204d3cf1078c2b424dd815490c05bdfc92bac00e4f0c28d471041

Contents?: true

Size: 532 Bytes

Versions: 2

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

require 'elasticsearch'
require 'ditty/services/logger'

module ProxES
  module Services
    module ES
      def client
        @client ||= Elasticsearch::Client.new(
          url: ENV['ELASTICSEARCH_URL'],
          transport_options: {
            ssl: { verify: ENV['SSL_VERIFY_NONE'].to_i != 1 }
          },
          logger: Ditty::Services::Logger.instance
        )
      end

      def cluster_health(level = 'cluster')
        client.cluster.health level: level
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
proxes-0.8.6 lib/proxes/services/es.rb
proxes-0.8.5 lib/proxes/services/es.rb