5_0/Direct/Cat.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
help
2.0
BEGIN
2.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::5_0::Direct::Cat;
6 $Search::Elasticsearch::Client::5_0::Direct::Cat::VERSION = '7.30_1'; # TRIAL
7  
8 $Search::Elasticsearch::Client::5_0::Direct::Cat::VERSION = '7.301';
9 use Moo;
10 with 'Search::Elasticsearch::Client::5_0::Role::API';
11 with 'Search::Elasticsearch::Role::Client::Direct';
12 use Search::Elasticsearch::Util qw(parse_params);
13 use namespace::clean;
14 __PACKAGE__->_install_api('cat');
15  
16 #===================================
17 sub help {
18 #===================================
19 my ( $self, $params ) = parse_params(@_);
20 $params->{help} = 1;
21 my $defn = $self->api->{'cat.help'};
22 $self->perform_request( $defn, $params );
23 }
24  
25 #===================================
26 around 'perform_request' => sub {
27 #===================================
28 my $orig = shift;
29 my $self = shift;
30 my ( $defn, $params ) = parse_params(@_);
31 if ( $params->{help} && $params->{help} ne 'false' ) {
32 $defn = { %$defn, parts => {} };
33 }
34  
35 return $orig->( $self, $defn, $params );
36  
37 };
38  
39 1;
40  
41 =pod
42  
43 =encoding UTF-8
44  
45 =head1 NAME
46  
47 Search::Elasticsearch::Client::5_0::Direct::Cat - A client for running cat debugging requests
48  
49 =head1 VERSION
50  
51 version 7.30_1
52  
53 =head1 DESCRIPTION
54  
55 The C<cat> API in Elasticsearch provides information about your
56 cluster and indices in a simple, easy to read text format, intended
57 for human consumption.
58  
59 These APIs have a number of parameters in common:
60  
61 =over
62  
63 =item * C<help>
64  
65 Returns help about the API, eg:
66  
67 say $e->cat->allocation(help => 1);
68  
69 =item * C<v>
70  
71 Includes the column headers in the output:
72  
73 say $e->cat->allocation(v => 1);
74  
75 =item * C<h>
76  
77 Accepts a list of column names to be output, eg:
78  
79 say $e->cat->indices(h => ['health','index']);
80  
81 =item * C<bytes>
82  
83 Formats byte-based values as bytes (C<b>), kilobytes (C<k>), megabytes
84 (C<m>) or gigabytes (C<g>)
85  
86 =back
87  
88 It does L<Search::Elasticsearch::Role::Client::Direct>.
89  
90 =head1 METHODS
91  
92 =head2 C<help()>
93  
94 say $e->cat->help;
95  
96 Returns the list of supported C<cat> APIs
97  
98 =head2 C<aliases()>
99  
100 say $e->cat->aliases(
101 name => 'name' | \@names # optional
102 );
103  
104 Returns information about index aliases, optionally limited to the specified
105 index/alias names.
106  
107 Query string parameters:
108 C<error_trace>,
109 C<format>,
110 C<h>,
111 C<help>,
112 C<human>,
113 C<local>,
114 C<master_timeout>,
115 C<s>,
116 C<v>
117  
118 See the L<cat aliases docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-aliases.html>
119 for more information.
120  
121 =head2 C<allocation()>
122  
123 say $e->cat->allocation(
124 node_id => 'node' | \@nodes # optional
125 );
126  
127 Provides a snapshot of how shards have located around the cluster and the
128 state of disk usage.
129  
130 Query string parameters:
131 C<bytes>,
132 C<error_trace>,
133 C<format>,
134 C<h>,
135 C<help>,
136 C<human>,
137 C<local>,
138 C<master_timeout>,
139 C<s>,
140 C<v>
141  
142 See the L<cat allocation docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>
143 for more information.
144  
145 =head2 C<count()>
146  
147 say $e->cat->count(
148 index => 'index' | \@indices # optional
149 );
150  
151 Provides quick access to the document count of the entire cluster, or
152 individual indices.
153  
154 Query string parameters:
155 C<error_trace>,
156 C<format>,
157 C<h>,
158 C<help>,
159 C<human>,
160 C<local>,
161 C<master_timeout>,
162 C<s>,
163 C<v>
164  
165 See the L<cat count docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>
166 for more information.
167  
168 =head2 C<fielddata()>
169  
170 say $e->cat->fielddata(
171 fields => 'field' | \@fields # optional
172 );
173  
174 Shows the amount of memory used by each of the specified `fields` (or all
175 fields) loaded into fielddata.
176  
177 Query string parameters:
178 C<bytes>,
179 C<error_trace>,
180 C<format>,
181 C<h>,
182 C<help>,
183 C<human>,
184 C<local>,
185 C<master_timeout>,
186 C<s>,
187 C<v>
188  
189 See the L<cat fielddata docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>
190 for more information.
191  
192 =head2 C<health()>
193  
194 say $e->cat->health();
195  
196 Provides a snapshot of how shards have located around the cluster and the
197 state of disk usage.
198  
199 Query string parameters:
200 C<error_trace>,
201 C<format>,
202 C<h>,
203 C<help>,
204 C<human>,
205 C<local>,
206 C<master_timeout>,
207 C<ts>,
208 C<s>,
209 C<v>
210  
211 See the L<cat health docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html>
212 for more information.
213  
214 =head2 C<indices()>
215  
216 say $e->cat->indices(
217 index => 'index' | \@indices # optional
218 );
219  
220 Provides a summary of index size and health for the whole cluster
221 or individual indices
222  
223 Query string parameters:
224 C<bytes>,
225 C<error_trace>,
226 C<format>,
227 C<h>,
228 C<health>,
229 C<help>,
230 C<human>,
231 C<local>,
232 C<master_timeout>,
233 C<pri>,
234 C<s>,
235 C<v>
236  
237 See the L<cat indices docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>
238 for more information.
239  
240 =head2 C<master()>
241  
242 say $e->cat->master();
243  
244 Displays the master’s node ID, bound IP address, and node name.
245  
246 Query string parameters:
247 C<error_trace>,
248 C<format>,
249 C<h>,
250 C<help>,
251 C<human>,
252 C<local>,
253 C<master_timeout>,
254 C<s>,
255 C<v>
256  
257 See the L<cat master docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-master.html>
258 for more information.
259  
260 =head2 C<nodeattrs()>
261  
262 say $e->cat->nodeattrs();
263  
264 Returns the node attributes set per node.
265  
266 Query string parameters:
267 C<error_trace>,
268 C<format>,
269 C<h>,
270 C<help>,
271 C<human>,
272 C<local>,
273 C<master_timeout>,
274 C<s>,
275 C<v>
276  
277 See the L<cat nodeattrs docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodeattrs.html>
278 for more information.
279  
280 =head2 C<nodes()>
281  
282 say $e->cat->nodes();
283  
284 Provides a snapshot of all of the nodes in your cluster.
285  
286 Query string parameters:
287 C<error_trace>,
288 C<format>,
289 C<h>,
290 C<help>,
291 C<human>,
292 C<local>,
293 C<master_timeout>,
294 C<s>,
295 C<v>
296  
297 See the L<cat nodes docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html>
298 for more information.
299  
300 =head2 C<pending_tasks()>
301  
302 say $e->cat->pending_tasks();
303  
304 Returns any cluster-level tasks which are queued on the master.
305  
306 Query string parameters:
307 C<error_trace>,
308 C<format>,
309 C<human>,
310 C<local>,
311 C<master_timeout>,
312 C<h>,
313 C<help>,
314 C<s>,
315 C<v>
316  
317 See the L<cat pending-tasks docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-pending-tasks.html>
318 for more information.
319  
320 =head2 C<plugins()>
321  
322 say $e->cat->plugins();
323  
324 Returns information about plugins installed on each node.
325  
326 Query string parameters:
327 C<error_trace>,
328 C<format>,
329 C<human>,
330 C<local>,
331 C<master_timeout>,
332 C<h>,
333 C<help>,
334 C<s>,
335 C<v>
336  
337 See the L<cat plugins docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-plugins.html>
338 for more information.
339  
340 =head2 C<recovery()>
341  
342 say $e->cat->recovery(
343 index => 'index' | \@indices # optional
344 );
345  
346 Provides a view of shard replication. It will show information
347 anytime data from at least one shard is copying to a different node.
348 It can also show up on cluster restarts. If your recovery process seems
349 stuck, try it to see if there’s any movement using C<recovery()>.
350  
351 Query string parameters:
352 C<bytes>,
353 C<error_trace>,
354 C<format>,
355 C<h>,
356 C<help>,
357 C<human>,
358 C<master_timeout>,
359 C<s>,
360 C<v>
361  
362 See the L<cat recovery docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>
363 for more information.
364  
365 =head2 C<repositories()>
366  
367 say $e->cat->repositories()
368  
369 Provides a list of registered snapshot repositories.
370  
371 Query string parameters:
372 C<error_trace>,
373 C<format>,
374 C<h>,
375 C<help>,
376 C<human>,
377 C<local>,
378 C<master_timeout>,
379 C<s>,
380 C<v>
381  
382 See the L<cat repositories docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html>
383 for more information.
384  
385 =head2 C<segments()>
386  
387 say $e->cat->segments(
388 index => 'index' | \@indices # optional
389 );
390  
391 Provides low level information about the segments in the shards of an index.
392  
393 Query string parameters:
394 C<bytes>,
395 C<error_trace>,
396 C<format>,
397 C<h>,
398 C<help>,
399 C<human>,
400 C<s>,
401 C<v>
402  
403 See the L<cat shards docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>
404 for more information.
405  
406 =head2 C<shards()>
407  
408 say $e->cat->shards(
409 index => 'index' | \@indices # optional
410 );
411  
412 Provides a detailed view of what nodes contain which shards, the state and
413 size of each shard.
414  
415 Query string parameters:
416 C<bytes>,
417 C<error_trace>,
418 C<format>,
419 C<h>,
420 C<help>,
421 C<human>,
422 C<local>,
423 C<master_timeout>,
424 C<s>,
425 C<v>
426  
427 See the L<cat shards docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>
428 for more information.
429  
430 =head2 C<snapshots()>
431  
432 say $e->cat->snapshots(
433 repository => 'repository' | \@repositories # required
434 )
435  
436 Provides a list of all snapshots that belong to the specified repositories.
437  
438 Query string parameters:
439 C<error_trace>,
440 C<format>,
441 C<h>,
442 C<help>,
443 C<human>,
444 C<ignore_unavailable>,
445 C<master_timeout>,
446 C<s>,
447 C<v>
448  
449 See the L<cat snapshots docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html>
450 for more information.
451  
452 =head2 C<tasks()>
453  
454 say $e->cat->tasks()
455  
456 Provides a list of node-level tasks.
457  
458 Query string parameters:
459 C<actions>,
460 C<detailed>,
461 C<error_trace>,
462 C<format>,
463 C<h>,
464 C<help>,
465 C<human>,
466 C<node_id>,
467 C<parent_node>,
468 C<parent_task>,
469 C<s>,
470 C<v>
471  
472 See the L<cat tasks docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>
473 for more information.
474  
475 =head2 C<templates()>
476  
477 say $e->cat->templates(
478 name => $name # optional
479 )
480  
481 Provides a list of index templates.
482  
483 Query string parameters:
484 C<error_trace>,
485 C<format>,
486 C<h>,
487 C<help>,
488 C<human>,
489 C<local>,
490 C<master_timeout>,
491 C<s>,
492 C<v>
493  
494 See the L<cat templates docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/templates.html>
495 for more information.
496  
497 =head2 C<thread_pool()>
498  
499 say $e->cat->thread_pool(
500 index => 'index' | \@indices # optional
501 );
502  
503 Shows cluster wide thread pool statistics per node. By default the C<active>,
504 C<queue> and C<rejected> statistics are returned for the C<bulk>, C<index> and
505 C<search> thread pools.
506  
507 Query string parameters:
508 C<error_trace>,
509 C<format>,
510 C<h>,
511 C<help>,
512 C<human>,
513 C<local>,
514 C<master_timeout>,
515 C<size>,
516 C<s>,
517 C<v>
518  
519 See the L<cat thread_pool docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>
520 for more information.
521  
522 =head1 AUTHOR
523  
524 Enrico Zimuel <enrico.zimuel@elastic.co>
525  
526 =head1 COPYRIGHT AND LICENSE
527  
528 This software is Copyright (c) 2020 by Elasticsearch BV.
529  
530 This is free software, licensed under:
531  
532 The Apache License, Version 2.0, January 2004
533  
534 =cut
535  
536 __END__