-
-
20 Oct 2021 09:35:18 UTC
- Distribution: Search-Elasticsearch-Client-6_0
- Module version: 7.715
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (25)
- Testers (111 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: apache_2_0
- Activity
24 month- Tools
- Download (66.43KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Enrico Zimuel
- Dependencies
- Devel::GlobalDestruction
- Moo
- Moo::Role
- Search::Elasticsearch
- Search::Elasticsearch::Role::API
- Search::Elasticsearch::Role::Client::Direct
- Search::Elasticsearch::Role::Is_Sync
- Search::Elasticsearch::Util
- Try::Tiny
- namespace::clean
- strict
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Search::Elasticsearch::Client::6_0::Direct::Cluster - A client for running cluster-level requests
VERSION
version 7.715
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 Search::Elasticsearch::Role::Client::Direct.
METHODS
health()
$response = $e->cluster->health( index => 'index' | \@indices # optional );
The
health()
method is used to retrieve information about the cluster health, returningred
,yellow
orgreen
to indicate the state of the cluster, indices or shards.Query string parameters:
error_trace
,human
,level
,local
,master_timeout
,timeout
,wait_for_active_shards
,wait_for_events
,wait_for_no_initializing_shards
,wait_for_no_relocating_shards
,wait_for_nodes
,wait_for_status
See the cluster health docs for more information.
stats()
$response = $e->cluster->stats( node_id => 'node' | \@nodes # optional );
Returns high-level cluster stats, optionally limited to the listed nodes.
Query string parameters:
error_trace
,flat_settings
,human
,timeout
See the cluster stats docs for more information.
get_settings()
$response = $e->cluster->get_settings()
The
get_settings()
method is used to retrieve cluster-wide settings that have been set with the "put_settings()" method.Query string parameters:
error_trace
,flat_settings
,human
,include_defaults
,master_timeout
,timeout
See the cluster settings docs for more information.
put_settings()
$response = $e->cluster->put_settings( %settings );
The
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" => 6 } } );
Query string parameters:
error_trace
,flat_settings
,human
See the cluster settings docs for more information.
state()
$response = $e->cluster->state( metric => $metric | \@metrics # optional index => $index | \@indices # optional );
The
state()
method returns the current cluster state from the master node, or from the responding node iflocal
is set totrue
.It returns all metrics by default, but these can be limited to any of:
_all
,blocks
,metadata
,nodes
,routing_table
Metrics for indices can be limited to particular indices with the
index
parameter.Query string parameters:
allow_no_indices
,error_trace
,expand_wildcards
,flat_settings
,human
,ignore_unavailable
,local
,master_timeout
,wait_for_metadata_version
,wait_for_timeout
See the cluster state docs for more information.
allocation_explain()
$response = $e->cluster->allocation_explain( body => { ... shard selectors ...} # optional );
Returns information about why a shard is allocated or unallocated or why.
Query string parameters:
error_trace
,human
,include_disk_info
,include_yes_decisions
See the cluster allocation explain docs for more information.
pending_tasks()
$response = $e->cluster->pending_tasks();
Returns a list of cluster-level tasks still pending on the master node.
Query string parameters:
error_trace
,human
,local
,master_timeout
See the pending tasks docs for more information.
reroute()
$e->cluster->reroute( body => { commands } );
The
reroute()
method is used to manually reallocate shards from one node to another. Thebody
should contain thecommands
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:
dry_run
,error_trace
,explain
,human
,master_timeout
,metric
,retry_failed
,timeout
See the reroute docs for more information.
remote_info()
$response = $e->cluster->remote_info();
The
remote_info()
API retrieves all of the configured remote cluster information.Query string parameters:
error_trace
,human
See the remote_info docs for more information.
AUTHOR
Enrico Zimuel <enrico.zimuel@elastic.co>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2021 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Module Install Instructions
To install Search::Elasticsearch::Client::6_0, copy and paste the appropriate command in to your terminal.
cpanm Search::Elasticsearch::Client::6_0
perl -MCPAN -e shell install Search::Elasticsearch::Client::6_0
For more information on module installation, please visit the detailed CPAN module installation guide.