Module: Eson::Shared::Aliases

Extended by:
API
Defined in:
lib/eson/shared/indices/aliases.rb

Overview

Requests using this API have the following properties:

The request supports the following parameters: actions The request declares the following parameters as source parameters: actions

Instance Method Summary collapse

Methods included from API

multi_index, multi_types, no_indices

Methods included from Chainable

#chainable, #extendable

Instance Method Details

#actionsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



47
48
49
# File 'lib/eson/shared/indices/aliases.rb', line 47

def actions
  @actions ||= []
end

#add(index, aka, options = {}) ⇒ Object

Adds an alias to the alias request. The aliased index and the alias are given directly, while further options can be provided in the options hash.

Parameters:

  • index (String, Symbol)

    The index name.

  • aka (String, Symbol)

    The aliased name.



33
34
35
# File 'lib/eson/shared/indices/aliases.rb', line 33

def add(index, aka, options = {})
  actions << {:add => { :index => index, :alias => aka}.merge!(options)}
end

#parametersArray<String>

The request supports the following parameters: actions

Returns:

  • (Array<String>)

    The parameters



15
# File 'lib/eson/shared/indices/aliases.rb', line 15

parameters :actions

#remove(index, aka) ⇒ Object

Removes an alias. To remove and alias, both the original index and the alias have to be given.

Parameters:

  • index (String, Symbol)

    The index name.

  • aka (String, Symbol)

    The aliased name.



42
43
44
# File 'lib/eson/shared/indices/aliases.rb', line 42

def remove(index, aka)
  actions << {:remove => { :index => index, :alias => aka}}
end

#source_paramArray<String>

The request declares the following parameters as source parameters: actions

Returns:

  • (Array<String>)

    The source parameters



17
# File 'lib/eson/shared/indices/aliases.rb', line 17

source_param [:actions]