Sha256: 5ad1c713d0cbd61a8955acd428a26d7d9c1dc5a6dd782b1f992ce2b59b883a0a

Contents?: true

Size: 657 Bytes

Versions: 21

Compression:

Stored size: 657 Bytes

Contents

module Elasticsearch
  module API
    module Actions

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

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
elasticsearch-api-1.0.6 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.0.5 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.0.4 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.0.2 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.0.1 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.0.0 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.11 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.10 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.9 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.0.0.rc2 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-1.0.0.rc1 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.8 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.7 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.6 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.5 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.4 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.3 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.2 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.1 lib/elasticsearch/api/actions/ping.rb
elasticsearch-api-0.4.0 lib/elasticsearch/api/actions/ping.rb