0_90/Direct/Cluster.pm untested

filter: Statementstmt 0.0% 0 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 0.0% 0 / 10 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
CRAP 2.0
1 # Licensed to Elasticsearch B.V under one or more agreements.
2 # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3 # See the LICENSE file in the project root for more information
4  
5 package Search::Elasticsearch::Client::0_90::Direct::Cluster;
6 $Search::Elasticsearch::Client::0_90::Direct::Cluster::VERSION = '7.30_1'; # TRIAL
7  
8 $Search::Elasticsearch::Client::0_90::Direct::Cluster::VERSION = '7.301';
9 use Moo;
10 with 'Search::Elasticsearch::Client::0_90::Role::API';
11 with 'Search::Elasticsearch::Role::Client::Direct';
12 __PACKAGE__->_install_api('cluster');
13  
14 1;
15  
16 =pod
17  
18 =encoding UTF-8
19  
20 =head1 NAME
21  
22 Search::Elasticsearch::Client::0_90::Direct::Cluster - A client for running cluster-level requests
23  
24 =head1 VERSION
25  
26 version 7.30_1
27  
28 =head1 DESCRIPTION
29  
30 This module provides methods to make cluster-level requests, such as
31 getting and setting cluster-level settings, manually rerouting shards,
32 and retrieving for monitoring purposes.
33  
34 It does L<Search::Elasticsearch::Role::Client::Direct>.
35  
36 =head1 METHODS
37  
38 =head2 C<health()>
39  
40 $response = $e->cluster->health( %qs_params )
41  
42 The C<health()> method is used to retrieve information about the cluster
43 health, returning C<red>, C<yellow> or C<green> to indicate the state
44 of the cluster, indices or shards.
45  
46 Query string parameters:
47 C<level>,
48 C<local>,
49 C<master_timeout>,
50 C<timeout>,
51 C<wait_for_active_shards>,
52 C<wait_for_nodes>,
53 C<wait_for_relocating_shards>,
54 C<wait_for_status>
55  
56 See the L<cluster health docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-health.html>
57 for more information.
58  
59 =head2 C<pending_tasks()>
60  
61 $response = $e->cluster->pending_tasks();
62  
63 Returns a list of cluster-level tasks still pending on the master node.
64  
65 Query string parameters:
66 C<local>,
67 C<master_timeout>
68  
69 See the L<pending tasks docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-pending.html>
70 for more information.
71  
72 =head2 C<node_info()>
73  
74 $response = $e->cluster->node_info(
75 node_id => $node_id | \@node_ids # optional
76 );
77  
78 The C<node_info()> method returns static information about the nodes in the
79 cluster, such as the configured maximum number of file handles, the maximum
80 configured heap size or the threadpool settings.
81  
82 Query string parameters:
83 C<all>,
84 C<clear>,
85 C<http>,
86 C<jvm>,
87 C<network>,
88 C<os>,
89 C<plugin>,
90 C<process>,
91 C<settings>,
92 C<thread_pool>,
93 C<timeout>,
94 C<transport>
95  
96 See the L<node_info docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-info.html>
97 for more information.
98  
99 =head2 C<node_stats()>
100  
101 $response = $e->cluster->node_stats(
102 node_id => $node_id | \@node_ids # optional
103 );
104  
105 The C<node_stats()> method returns statistics about the nodes in the
106 cluster, such as the number of currently open file handles, the current
107 heap memory usage or the current number of threads in use.
108  
109 Stats can be returned for all nodes, or limited to particular nodes
110 with the C<node_id> parameter.
111 The L<indices_stats|Search::Elasticsearch::Client::0_90::Direct::Indices/indices_stats()>
112 information can also be retrieved on a per-node basis with the C<node_stats()>
113 method:
114  
115 $response = $e->cluster->node_stats(
116 node_id => 'node_1',
117 indices => 1,
118 metric => 'docs'
119 );
120  
121 Query string parameters:
122 C<all>,
123 C<clear>,
124 C<fields>,
125 C<fs>,
126 C<http>,
127 C<indices>,
128 C<jvm>,
129 C<network>,
130 C<os>,
131 C<process>,
132 C<thread_pool>,
133 C<transport>
134  
135 See the L<node_stats docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-stats.html>
136 for more information.
137  
138 =head2 C<hot_threads()>
139  
140 $response = $e->cluster->hot_threads(
141 node_id => $node_id | \@node_ids # optional
142 )
143  
144 The C<hot_threads()> method is a useful tool for diagnosing busy nodes. It
145 takes a snapshot of which threads are consuming the most CPU.
146  
147 Query string parameters:
148 C<interval>,
149 C<snapshots>,
150 C<threads>,
151 C<type>
152  
153 See the L<hot_threads docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-hot-threads.html>
154 for more information.
155  
156 =head2 C<get_settings()>
157  
158 $response = $e->cluster->get_settings()
159  
160 The C<get_settings()> method is used to retrieve cluster-wide settings that
161 have been set with the L</put_settings()> method.
162  
163 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html>
164 for more information.
165  
166 =head2 C<put_settings()>
167  
168 $response = $e->cluster->put_settings( %settings );
169  
170 The C<put_settings()> method is used to set cluster-wide settings, either
171 transiently (which don't survive restarts) or permanently (which do survive
172 restarts).
173  
174 For instance:
175  
176 $response = $e->cluster->put_settings(
177 body => {
178 transient => { "discovery.zen.minimum_master_nodes" => 5 }
179 }
180 );
181  
182 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html>
183 for more information.
184  
185 =head2 C<state()>
186  
187 $response = $e->cluster->state();
188  
189 The C<state()> method returns the current cluster state from the master node,
190 or from the responding node if C<local> is set to C<true>.
191  
192 Query string parameters:
193 C<filter_blocks>,
194 C<filter_index_templates>,
195 C<filter_indices>,
196 C<filter_metadata>,
197 C<filter_nodes>,
198 C<filter_routing_table>,
199 C<local>,
200 C<master_timeout>
201  
202 See the L<cluster state docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-state.html>
203 for more information.
204  
205 =head2 C<reroute()>
206  
207 $e->cluster->reroute(
208 body => { commands } # required
209 );
210  
211 The C<reroute()> method is used to manually reallocate shards from one
212 node to another. The C<body> should contain the C<commands> indicating
213 which changes should be made. For instance:
214  
215 $e->cluster->reroute(
216 body => {
217 commands => [
218 { move => {
219 index => 'test',
220 shard => 0,
221 from_node => 'node_1',
222 to_node => 'node_2
223 }},
224 { allocate => {
225 index => 'test',
226 shard => 1,
227 node => 'node_3'
228 }}
229 ]
230 }
231 );
232  
233 Query string parameters:
234 C<dry_run>,
235 C<filter_metadata>
236  
237 See the L<reroute docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-reroute.html>
238 for more information.
239  
240 =head2 C<shutdown()>
241  
242 $e->cluster->shutdown(
243 node_id => $node_id | \@node_ids # optional
244 );
245  
246 The C<shutdown()> method is used to shutdown one or more nodes, or the whole
247 cluster.
248  
249 Query string parameters:
250 C<delay>,
251 C<exit>
252  
253 See the L<shutdown docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-shutdown.html>
254 for more information.
255  
256 =head1 AUTHOR
257  
258 Enrico Zimuel <enrico.zimuel@elastic.co>
259  
260 =head1 COPYRIGHT AND LICENSE
261  
262 This software is Copyright (c) 2020 by Elasticsearch BV.
263  
264 This is free software, licensed under:
265  
266 The Apache License, Version 2.0, January 2004
267  
268 =cut
269  
270 __END__