lib/elasticsearch/api/actions/ping.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/ping.rb in elasticsearch-api-8.11.0

- old
+ new

@@ -23,23 +23,25 @@ module Actions # Returns whether the cluster is running. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/index.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/index.html # def ping(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || "ping" } + arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_HEAD path = "" params = {} begin - perform_request(method, path, params, body, headers).status == 200 ? true : false + perform_request(method, path, params, body, headers, request_opts).status == 200 ? true : false rescue Exception => e if e.class.to_s =~ /NotFound|ConnectionFailed/ || e.message =~ /Not *Found|404|ConnectionFailed/i false else raise e