Sha256: 9b17eecf317e2228f73c96ae342b5de0eef09bf7786cfabb5495e517514185f4

Contents?: true

Size: 1.78 KB

Versions: 38

Compression:

Stored size: 1.78 KB

Contents

module Elasticsearch
  module API
    module Indices
      module Actions

        # The rollover index API rolls an alias over to a new index when the existing index
        # is considered to be too large or too old
        #
        # @option arguments [String] :alias The name of the alias to rollover (*Required*)
        # @option arguments [String] :new_index The name of the rollover index
        # @option arguments [Hash] :body The conditions that needs to be met for executing rollover
        # @option arguments [Number] :wait_for_active_shards Wait until the specified number of shards is active
        # @option arguments [Time] :timeout Explicit operation timeout
        # @option arguments [Time] :master_timeout Specify timeout for connection to master
        # @option arguments [Boolean] :dry_run If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
        #
        # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html
        #
        def rollover(arguments={})
          raise ArgumentError, "Required argument 'alias' missing" unless arguments[:alias]

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

          arguments = arguments.clone

          source = arguments.delete(:alias)
          target = arguments.delete(:new_index)

          method = HTTP_POST
          path   = Utils.__pathify Utils.__escape(source), '_rollover', Utils.__escape(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

38 entries across 38 versions & 5 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/rollover.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.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/rollover.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/rollover.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/indices/rollover.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/rollover.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/rollover.rb