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