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