Module: Elasticsearch::API::Cluster::Actions
- Included in:
- ClusterClient
- Defined in:
- lib/elasticsearch/api/namespace/cluster.rb,
lib/elasticsearch/api/actions/cluster/state.rb,
lib/elasticsearch/api/actions/cluster/stats.rb,
lib/elasticsearch/api/actions/cluster/health.rb,
lib/elasticsearch/api/actions/cluster/reroute.rb,
lib/elasticsearch/api/actions/cluster/get_settings.rb,
lib/elasticsearch/api/actions/cluster/put_settings.rb,
lib/elasticsearch/api/actions/cluster/pending_tasks.rb,
lib/elasticsearch/api/actions/cluster/allocation_explain.rb
Instance Method Summary collapse
-
#allocation_explain(arguments = {}) ⇒ Object
Return the information about why a shard is or isn’t allocated.
-
#get_settings(arguments = {}) ⇒ Object
Get the cluster settings (previously set with #put_settings).
-
#health(arguments = {}) ⇒ Object
Returns information about cluster “health”.
-
#pending_tasks(arguments = {}) ⇒ Object
Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed and are queued up.
-
#put_settings(arguments = {}) ⇒ Object
Update cluster settings.
-
#reroute(arguments = {}) ⇒ Object
Perform manual shard allocation in the cluster.
-
#state(arguments = {}) ⇒ Object
Get information about the cluster state (indices settings, allocations, etc).
-
#stats(arguments = {}) ⇒ Object
Returns statistical information about the cluster.
Instance Method Details
#allocation_explain(arguments = {}) ⇒ Object
Return the information about why a shard is or isn’t allocated
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/elasticsearch/api/actions/cluster/allocation_explain.rb', line 15 def allocation_explain(arguments={}) valid_params = [ :include_yes_decisions, :include_disk_info ] method = 'GET' path = "_cluster/allocation/explain" params = Utils.__validate_and_extract_params arguments, valid_params body = arguments[:body] perform_request(method, path, params, body).body end |
#get_settings(arguments = {}) ⇒ Object
Get the cluster settings (previously set with #put_settings)
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/elasticsearch/api/actions/cluster/get_settings.rb', line 18 def get_settings(arguments={}) valid_params = [ :flat_settings, :include_defaults ] method = HTTP_GET path = "_cluster/settings" params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end |
#health(arguments = {}) ⇒ Object
Returns information about cluster “health”.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch/api/actions/cluster/health.rb', line 36 def health(arguments={}) arguments = arguments.clone index = arguments.delete(:index) valid_params = [ :level, :local, :master_timeout, :timeout, :wait_for_active_shards, :wait_for_nodes, :wait_for_relocating_shards, :wait_for_no_relocating_shards, :wait_for_status, :wait_for_events ] method = HTTP_GET path = Utils.__pathify "_cluster/health", Utils.__listify(index) params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end |
#pending_tasks(arguments = {}) ⇒ Object
Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed and are queued up.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/elasticsearch/api/actions/cluster/pending_tasks.rb', line 19 def pending_tasks(arguments={}) valid_params = [ :local, :master_timeout ] method = HTTP_GET path = "_cluster/pending_tasks" params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end |
#put_settings(arguments = {}) ⇒ Object
Update cluster settings.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/elasticsearch/api/actions/cluster/put_settings.rb', line 17 def put_settings(arguments={}) valid_params = [ :flat_settings ] method = HTTP_PUT path = "_cluster/settings" params = Utils.__validate_and_extract_params arguments, valid_params body = arguments[:body] || {} perform_request(method, path, params, body).body end |
#reroute(arguments = {}) ⇒ Object
If you want to explicitly set the shard allocation to a certain node, you might want to look at the ‘allocation.*` cluster settings.
Perform manual shard allocation in the cluster.
Pass the operations you want to perform in the ‘:body` option. Use the `dry_run` option to evaluate the result of operations without actually performing them.
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/elasticsearch/api/actions/cluster/reroute.rb', line 34 def reroute(arguments={}) valid_params = [ :dry_run, :explain, :metric, :master_timeout, :retry_failed, :timeout ] method = HTTP_POST path = "_cluster/reroute" params = Utils.__validate_and_extract_params arguments, valid_params body = arguments[:body] || {} perform_request(method, path, params, body).body end |
#state(arguments = {}) ⇒ Object
Get information about the cluster state (indices settings, allocations, etc)
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/elasticsearch/api/actions/cluster/state.rb', line 30 def state(arguments={}) arguments = arguments.clone index = arguments.delete(:index) metric = arguments.delete(:metric) valid_params = [ :metric, :index_templates, :local, :master_timeout, :flat_settings, :allow_no_indices, :expand_wildcards, :ignore_unavailable ] method = HTTP_GET path = "_cluster/state" path = Utils.__pathify '_cluster/state', Utils.__listify(metric), Utils.__listify(index) params = Utils.__validate_and_extract_params arguments, valid_params [:index_templates].each do |key| params[key] = Utils.__listify(params[key]) if params[key] end body = nil perform_request(method, path, params, body).body end |
#stats(arguments = {}) ⇒ Object
Returns statistical information about the cluster
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/elasticsearch/api/actions/cluster/stats.rb', line 15 def stats(arguments={}) valid_params = [ :flat_settings, :human, :timeout ] method = 'GET' path = "_cluster/stats" params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end |