Sha256: c50355079f76e3a1e1541c298a69bd3bd478b9b214b5670a2257ae5f101ad156

Contents?: true

Size: 722 Bytes

Versions: 50

Compression:

Stored size: 722 Bytes

Contents

module Elasticsearch
  module API
    module Actions

      # Returns true if the cluster returns a successful HTTP response, false otherwise.
      #
      # @example
      #
      #     client.ping
      #
      # @see http://elasticsearch.org/guide/
      #
      def ping(arguments={})
        method = HTTP_HEAD
        path   = ""
        params = {}
        body   = nil

        begin
          perform_request(method, path, params, body).status == 200 ? true : false
        rescue Exception => e
          if e.class.to_s =~ /NotFound|ConnectionFailed/ || e.message =~ /Not\s*Found|404|ConnectionFailed/i
            false
          else
            raise e
          end
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 6 rubygems

Version Path
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/elasticsearch-api-5.0.4/lib/elasticsearch/api/actions/ping.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/elasticsearch-api-5.0.4/lib/elasticsearch/api/actions/ping.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/elasticsearch-api-5.0.4/lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-5.0.4 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-2.0.2 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-5.0.3 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-5.0.2 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-5.0.1 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-2.0.1 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.1.2 lib/elasticsearch/api/actions/ping.rb