Sha256: 46befc42a7e753bce9432be97fcd71c25b37bc3b81192ba6981433ce7801f5a0

Contents?: true

Size: 1.86 KB

Versions: 47

Compression:

Stored size: 1.86 KB

Contents

module Elasticsearch
  module API
    module Indices
      module Actions

        # Copy an existing index into a new index with a fewer number of primary shards
        #
        # @option arguments [String] :index The name of the source index to shrink (*Required*)
        # @option arguments [String] :target The name of the target index to shrink into (*Required*)
        # @option arguments [Hash] :body The configuration for the target index (`settings` and `aliases`)
        # @option arguments [Number] :wait_for_active_shards Wait until the specified number of shards is active
        # @option arguments [Boolean] :wait_for_no_relocating_shards Whether to wait until there are no relocating
        #                                                            shards in the cluster
        # @option arguments [Time] :timeout Explicit operation timeout
        # @option arguments [Time] :master_timeout Specify timeout for connection to master
        #
        # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html
        #
        def shrink(arguments={})
          raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
          raise ArgumentError, "Required argument 'target' missing" unless arguments[:target]

          valid_params = [
            :wait_for_active_shards,
            :wait_for_no_relocating_shards,
            :timeout,
            :master_timeout
          ]

          arguments = arguments.clone

          source = arguments.delete(:index)
          target = arguments.delete(:target)

          method = HTTP_PUT
          path   = Utils.__pathify(source, '_shrink', target)
          params = Utils.__validate_and_extract_params arguments, valid_params
          body   = arguments[:body]

          perform_request(method, path, params, body).body
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 6 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/shrink.rb