package Search::Elasticsearch::Client::0_90::Direct::Cluster; $Search::Elasticsearch::Client::0_90::Direct::Cluster::VERSION = '1.10'; use Moo; with 'Search::Elasticsearch::Role::API::0_90'; with 'Search::Elasticsearch::Role::Client::Direct'; __PACKAGE__->_install_api('cluster'); 1; =pod =encoding UTF-8 =head1 NAME Search::Elasticsearch::Client::0_90::Direct::Cluster - A client for running cluster-level requests =head1 VERSION version 1.10 =head1 DESCRIPTION This module provides methods to make cluster-level requests, such as getting and setting cluster-level settings, manually rerouting shards, and retrieving for monitoring purposes. It does L. =head1 METHODS =head2 C $response = $e->cluster->health( %qs_params ) The C method is used to retrieve information about the cluster health, returning C, C or C to indicate the state of the cluster, indices or shards. Query string parameters: C, C, C, C, C, C, C, C See the L for more information. =head2 C $response = $e->cluster->pending_tasks(); Returns a list of cluster-level tasks still pending on the master node. Query string parameters: C, C See the L for more information. =head2 C $response = $e->cluster->node_info( node_id => $node_id | \@node_ids # optional ); The C method returns static information about the nodes in the cluster, such as the configured maximum number of file handles, the maximum configured heap size or the threadpool settings. Query string parameters: C, C, C, C, C, C, C, C, C, C, C, C See the L for more information. =head2 C $response = $e->cluster->node_stats( node_id => $node_id | \@node_ids # optional ); The C method returns statistics about the nodes in the cluster, such as the number of currently open file handles, the current heap memory usage or the current number of threads in use. Stats can be returned for all nodes, or limited to particular nodes with the C parameter. The L information can also be retrieved on a per-node basis with the C method: $response = $e->cluster->node_stats( node_id => 'node_1', indices => 1, metric => 'docs' ); Query string parameters: C, C, C, C, C, C, C, C, C, C, C, C See the L for more information. =head2 C $response = $e->cluster->hot_threads( node_id => $node_id | \@node_ids # optional ) The C method is a useful tool for diagnosing busy nodes. It takes a snapshot of which threads are consuming the most CPU. Query string parameters: C, C, C, C See the L for more information. =head2 C $response = $e->cluster->get_settings() The C method is used to retrieve cluster-wide settings that have been set with the L method. See the L for more information. =head2 C $response = $e->cluster->put_settings( %settings ); The C method is used to set cluster-wide settings, either transiently (which don't survive restarts) or permanently (which do survive restarts). For instance: $response = $e->cluster->put_settings( body => { transient => { "discovery.zen.minimum_master_nodes" => 5 } } ); See the L for more information. =head2 C $response = $e->cluster->state(); The C method returns the current cluster state from the master node, or from the responding node if C is set to C. Query string parameters: C, C, C, C, C, C, C, C See the L for more information. =head2 C $e->cluster->reroute( body => { commands } # required ); The C method is used to manually reallocate shards from one node to another. The C should contain the C indicating which changes should be made. For instance: $e->cluster->reroute( body => { commands => [ { move => { index => 'test', shard => 0, from_node => 'node_1', to_node => 'node_2 }}, { allocate => { index => 'test', shard => 1, node => 'node_3' }} ] } ); Query string parameters: C, C See the L for more information. =head2 C $e->cluster->shutdown( node_id => $node_id | \@node_ids # optional ); The C method is used to shutdown one or more nodes, or the whole cluster. Query string parameters: C, C See the L for more information. =head1 AUTHOR Clinton Gormley =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2014 by Elasticsearch BV. This is free software, licensed under: The Apache License, Version 2.0, January 2004 =cut __END__ # ABSTRACT: A client for running cluster-level requests