Module: ElasticSearch::Api::Admin::Cluster
- Included in:
- Client
- Defined in:
- lib/elasticsearch/client/admin_cluster.rb
Constant Summary collapse
- PSEUDO_NODES =
[:all, :local, :master]
Instance Method Summary collapse
-
#cluster_health(*args) ⇒ Object
list of indices, or all indices (default) options: level (cluster (default), indices, shards), wait_for_status, wait_for_relocating_shards, timeout.
- #cluster_state(options = {}) ⇒ Object
-
#nodes_info(*args) ⇒ Object
list of nodes, or all nodes (default) no options.
-
#nodes_stats(*args) ⇒ Object
list of nodes, or all nodes (default) no options.
-
#restart_nodes(*args) ⇒ Object
list of nodes, or :local, :master, :all if no nodes, then do nothing (to avoid accidental cluster shutdown) options: delay.
-
#shutdown_nodes(*args) ⇒ Object
list of nodes, or :local, :master, :all if no nodes, then do nothing (to avoid accidental cluster shutdown) options: delay.
Instance Method Details
#cluster_health(*args) ⇒ Object
list of indices, or all indices (default) options: level (cluster (default), indices, shards), wait_for_status, wait_for_relocating_shards, timeout
9 10 11 12 |
# File 'lib/elasticsearch/client/admin_cluster.rb', line 9 def cluster_health(*args) = args.last.is_a?(Hash) ? args.pop : {} execute(:cluster_health, args.flatten, ) end |
#cluster_state(options = {}) ⇒ Object
14 15 16 |
# File 'lib/elasticsearch/client/admin_cluster.rb', line 14 def cluster_state(={}) execute(:cluster_state, ) end |
#nodes_info(*args) ⇒ Object
list of nodes, or all nodes (default) no options
20 21 22 23 |
# File 'lib/elasticsearch/client/admin_cluster.rb', line 20 def nodes_info(*args) = args.last.is_a?(Hash) ? args.pop : {} execute(:nodes_info, args.flatten, ) end |
#nodes_stats(*args) ⇒ Object
list of nodes, or all nodes (default) no options
27 28 29 30 |
# File 'lib/elasticsearch/client/admin_cluster.rb', line 27 def nodes_stats(*args) = args.last.is_a?(Hash) ? args.pop : {} execute(:nodes_stats, args.flatten, ) end |
#restart_nodes(*args) ⇒ Object
list of nodes, or :local, :master, :all if no nodes, then do nothing (to avoid accidental cluster shutdown) options: delay
46 47 48 49 50 51 52 |
# File 'lib/elasticsearch/client/admin_cluster.rb', line 46 def restart_nodes(*args) = 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, ) end |
#shutdown_nodes(*args) ⇒ Object
list of nodes, or :local, :master, :all if no nodes, then do nothing (to avoid accidental cluster shutdown) options: delay
35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/client/admin_cluster.rb', line 35 def shutdown_nodes(*args) = 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, ) end |