Module: Elasticsearch::API::Cluster::Actions
- Included in:
- ClusterClient
- Defined in:
- lib/elasticsearch/api/namespace/cluster.rb,
lib/elasticsearch/api/actions/cluster/info.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/remote_info.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,
lib/elasticsearch/api/actions/cluster/get_component_template.rb,
lib/elasticsearch/api/actions/cluster/put_component_template.rb,
lib/elasticsearch/api/actions/cluster/delete_component_template.rb,
lib/elasticsearch/api/actions/cluster/exists_component_template.rb,
lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb,
lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb
Instance Method Summary collapse
-
#allocation_explain(arguments = {}) ⇒ Object
Explain the shard allocations.
-
#delete_component_template(arguments = {}) ⇒ Object
Delete component templates.
-
#delete_voting_config_exclusions(arguments = {}) ⇒ Object
Clear cluster voting config exclusions.
-
#exists_component_template(arguments = {}) ⇒ Object
(also: #exists_component_template?)
Check component templates.
-
#get_component_template(arguments = {}) ⇒ Object
Get component templates.
-
#get_settings(arguments = {}) ⇒ Object
Get cluster-wide settings.
-
#health(arguments = {}) ⇒ Object
Get the cluster health status.
-
#info(arguments = {}) ⇒ Object
Get cluster info.
-
#pending_tasks(arguments = {}) ⇒ Object
Get the pending cluster tasks.
-
#post_voting_config_exclusions(arguments = {}) ⇒ Object
Update voting configuration exclusions.
-
#put_component_template(arguments = {}) ⇒ Object
Create or update a component template.
-
#put_settings(arguments = {}) ⇒ Object
Update the cluster settings.
-
#remote_info(arguments = {}) ⇒ Object
Get remote cluster information.
-
#reroute(arguments = {}) ⇒ Object
Reroute the cluster.
-
#state(arguments = {}) ⇒ Object
Get the cluster state.
-
#stats(arguments = {}) ⇒ Object
Get cluster statistics.
Instance Method Details
#allocation_explain(arguments = {}) ⇒ Object
Explain the shard allocations
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/elasticsearch/api/actions/cluster/allocation_explain.rb', line 35 def allocation_explain(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.allocation_explain' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = '_cluster/allocation/explain' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_component_template(arguments = {}) ⇒ Object
Delete component templates
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 |
# File 'lib/elasticsearch/api/actions/cluster/delete_component_template.rb', line 34 def delete_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.delete_component_template' } defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE path = "_component_template/#{Utils.__listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_voting_config_exclusions(arguments = {}) ⇒ Object
Clear cluster voting config exclusions
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb', line 33 def delete_voting_config_exclusions(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.delete_voting_config_exclusions' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_DELETE path = '_cluster/voting_config_exclusions' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#exists_component_template(arguments = {}) ⇒ Object Also known as: exists_component_template?
Check component templates
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 |
# File 'lib/elasticsearch/api/actions/cluster/exists_component_template.rb', line 34 def exists_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.exists_component_template' } defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_HEAD path = "_component_template/#{Utils.__listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_component_template(arguments = {}) ⇒ Object
Get component templates
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 62 63 |
# File 'lib/elasticsearch/api/actions/cluster/get_component_template.rb', line 37 def get_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.get_component_template' } defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_GET path = if _name "_component_template/#{Utils.__listify(_name)}" else '_component_template' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_settings(arguments = {}) ⇒ Object
Get cluster-wide settings
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/elasticsearch/api/actions/cluster/get_settings.rb', line 35 def get_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.get_settings' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_cluster/settings' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#health(arguments = {}) ⇒ Object
Get the cluster health status
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/elasticsearch/api/actions/cluster/health.rb', line 43 def health(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.health' } defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index "_cluster/health/#{Utils.__listify(_index)}" else '_cluster/health' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#info(arguments = {}) ⇒ Object
Get cluster info
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 |
# File 'lib/elasticsearch/api/actions/cluster/info.rb', line 32 def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.info' } defined_params = [:target].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'target' missing" unless arguments[:target] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_GET path = "_info/#{Utils.__listify(_target)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#pending_tasks(arguments = {}) ⇒ Object
Get the pending cluster tasks
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/api/actions/cluster/pending_tasks.rb', line 33 def pending_tasks(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.pending_tasks' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_cluster/pending_tasks' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#post_voting_config_exclusions(arguments = {}) ⇒ Object
Update voting configuration exclusions
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb', line 35 def post_voting_config_exclusions(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.post_voting_config_exclusions' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_POST path = '_cluster/voting_config_exclusions' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_component_template(arguments = {}) ⇒ Object
Create or update a component template
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/put_component_template.rb', line 36 def put_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.put_component_template' } defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT path = "_component_template/#{Utils.__listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_settings(arguments = {}) ⇒ Object
Update the cluster settings
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/elasticsearch/api/actions/cluster/put_settings.rb', line 35 def put_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.put_settings' } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) || {} method = Elasticsearch::API::HTTP_PUT path = '_cluster/settings' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#remote_info(arguments = {}) ⇒ Object
Get remote cluster information
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch/api/actions/cluster/remote_info.rb', line 31 def remote_info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.remote_info' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_remote/info' params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#reroute(arguments = {}) ⇒ Object
Reroute the cluster
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/elasticsearch/api/actions/cluster/reroute.rb', line 38 def reroute(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.reroute' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) || {} method = Elasticsearch::API::HTTP_POST path = '_cluster/reroute' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#state(arguments = {}) ⇒ Object
Get the cluster state
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/elasticsearch/api/actions/cluster/state.rb', line 41 def state(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.state' } defined_params = %i[metric index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _metric = arguments.delete(:metric) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _metric && _index "_cluster/state/#{Utils.__listify(_metric)}/#{Utils.__listify(_index)}" elsif _metric "_cluster/state/#{Utils.__listify(_metric)}" else '_cluster/state' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#stats(arguments = {}) ⇒ Object
Get cluster statistics
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 |
# File 'lib/elasticsearch/api/actions/cluster/stats.rb', line 34 def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.stats' } defined_params = [:node_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _node_id = arguments.delete(:node_id) method = Elasticsearch::API::HTTP_GET path = if _node_id "_cluster/stats/nodes/#{Utils.__listify(_node_id)}" else '_cluster/stats' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |