module ElasticSearch::Api::Admin::Cluster

Constants

PSEUDO_NODES

Public Instance Methods

cluster_health(*args) click to toggle source

list of indices, or all indices (default) options: level (cluster (default), indices, shards), wait_for_status, wait_for_relocating_shards, timeout

# File lib/elasticsearch/client/admin_cluster.rb, line 9
def cluster_health(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  execute(:cluster_health, args.flatten, options)
end
cluster_state(options={}) click to toggle source
# File lib/elasticsearch/client/admin_cluster.rb, line 14
def cluster_state(options={})
  execute(:cluster_state, options)
end
nodes_info(*args) click to toggle source

list of nodes, or all nodes (default) no options

# File lib/elasticsearch/client/admin_cluster.rb, line 20
def nodes_info(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  execute(:nodes_info, args.flatten, options)
end
nodes_stats(*args) click to toggle source

list of nodes, or all nodes (default) no options

# File lib/elasticsearch/client/admin_cluster.rb, line 27
def nodes_stats(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  execute(:nodes_stats, args.flatten, options)
end
restart_nodes(*args) click to toggle source

list of nodes, or :local, :master, :all if no nodes, then do nothing (to avoid accidental cluster shutdown) options: delay

# File lib/elasticsearch/client/admin_cluster.rb, line 46
def restart_nodes(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  return false if args.empty?
  nodes = args.flatten
  nodes.collect! { |n| PSEUDO_NODES.include?(n) ? "_#{n}" : n }
  execute(:restart_nodes, nodes, options)
end
shutdown_nodes(*args) click to toggle source

list of nodes, or :local, :master, :all if no nodes, then do nothing (to avoid accidental cluster shutdown) options: delay

# File lib/elasticsearch/client/admin_cluster.rb, line 35
def shutdown_nodes(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  return false if args.empty?
  nodes = args.flatten
  nodes.collect! { |n| PSEUDO_NODES.include?(n) ? "_#{n}" : n }
  execute(:shutdown_nodes, nodes, options)
end