Search-Elasticsearch-Client-1_0

 view release on metacpan or  search on metacpan

lib/Search/Elasticsearch/Client/1_0/Direct/Cluster.pm  view on Meta::CPAN

package Search::Elasticsearch::Client::1_0::Direct::Cluster;
$Search::Elasticsearch::Client::1_0::Direct::Cluster::VERSION = '6.81';
use Moo;
with 'Search::Elasticsearch::Client::1_0::Role::API';
with 'Search::Elasticsearch::Role::Client::Direct';
__PACKAGE__->_install_api('cluster');

sub node_info     { _deprecated( 'node_info',     'info' ) }
sub node_stats    { _deprecated( 'node_stats',    'stats' ) }
sub hot_threads   { _deprecated( 'hot_threads',   'hot_threads' ) }
sub node_shutdown { _deprecated( 'node_shutdown', 'shutdown' ) }

#===================================
sub _deprecated {
#===================================
    my ( $old, $new ) = @_;
    die "The method \$es->cluster->$old() has moved to \$es->nodes->$new()";
}

1;

=pod

=encoding UTF-8

=head1 NAME

Search::Elasticsearch::Client::1_0::Direct::Cluster - A client for running cluster-level requests

=head1 VERSION

version 6.81

=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<Search::Elasticsearch::Role::Client::Direct>.

=head1 METHODS

=head2 C<health()>

    $response = $e->cluster->health(
        index   => 'index' | \@indices  # optional
    );

The C<health()> method is used to retrieve information about the cluster
health, returning C<red>, C<yellow> or C<green> to indicate the state
of the cluster, indices or shards.

Query string parameters:
    C<level>,
    C<local>,
    C<master_timeout>,
    C<timeout>,
    C<wait_for_active_shards>,
    C<wait_for_nodes>,
    C<wait_for_relocating_shards>,
    C<wait_for_status>

See the L<cluster health docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>
for more information.

=head2 C<stats()>

    $response = $e->cluster->stats(
        node_id => 'node' | \@nodes     # optional
    );

Returns high-level cluster stats, optionally limited to the listed nodes.

Query string parameters:
    C<flat_settings>,
    C<human>

See the L<cluster stats docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>
for more information.

=head2 C<get_settings()>

    $response = $e->cluster->get_settings()

The C<get_settings()> method is used to retrieve cluster-wide settings that
have been set with the L</put_settings()> method.

Query string parameters:
    C<flat_settings>,
    C<master_timeout>,
    C<timeout>

See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
for more information.

=head2 C<put_settings()>

    $response = $e->cluster->put_settings( %settings );

The C<put_settings()> 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 }
        }
    );

Query string parameters:
    C<flat_settings>

See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
 for more information.

=head2 C<state()>

    $response = $e->cluster->state(



( run in 0.915 second using v1.01-cache-2.11-cpan-71847e10f99 )