Class: Esearch::Cluster

Inherits:
Object
  • Object
show all
Includes:
Adamantium::Flat
Defined in:
lib/esearch/cluster.rb

Overview

Handle for an elasticsearch cluster

Constant Summary collapse

PATH =
Pathname.new('/').freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connectionConnection (readonly)

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.

Return connection

Returns:



16
17
18
# File 'lib/esearch/cluster.rb', line 16

def connection
  @connection
end

Class Method Details

.connect(*args) ⇒ Connection

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.

Build connection

Returns:



81
82
83
# File 'lib/esearch/cluster.rb', line 81

def self.connect(*args)
  new(Connection.build(*args))
end

Instance Method Details

#all_indicesIndices::All

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.

Return handler for all indices

Returns:



70
71
72
# File 'lib/esearch/cluster.rb', line 70

def all_indices
  Indices::All.new(connection)
end

#health(options = {}) ⇒ Presenter::Health

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.

Return cluster health

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (Presenter::Health)


50
51
52
# File 'lib/esearch/cluster.rb', line 50

def health(options = {})
  Command::Cluster::Health.run(self, options)
end

#index(name) ⇒ Index

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.

Return handler for index

Parameters:

  • name (String)

Returns:



26
27
28
# File 'lib/esearch/cluster.rb', line 26

def index(name)
  Index.new(connection, name)
end

#indices(names) ⇒ Indices

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.

Return handler for indices

Parameters:

  • names (Enumerable<String>)

Returns:



38
39
40
# File 'lib/esearch/cluster.rb', line 38

def indices(names)
  Indices.new(connection, names)
end

#pathPathname

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.

Return path

Returns:

  • (Pathname)


60
61
62
# File 'lib/esearch/cluster.rb', line 60

def path
  PATH
end