| 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::2_0::Direct::Cat; | ||
| 6 | $Search::Elasticsearch::Client::2_0::Direct::Cat::VERSION = '7.30_1'; # TRIAL | ||
| 7 | |||
| 8 | $Search::Elasticsearch::Client::2_0::Direct::Cat::VERSION = '7.301'; | ||
| 9 | use Moo; | ||
| 10 | with 'Search::Elasticsearch::Client::2_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 | 1; | ||
| 26 | |||
| 27 | =pod | ||
| 28 | |||
| 29 | =encoding UTF-8 | ||
| 30 | |||
| 31 | =head1 NAME | ||
| 32 | |||
| 33 | Search::Elasticsearch::Client::2_0::Direct::Cat - A client for running cat debugging requests | ||
| 34 | |||
| 35 | =head1 VERSION | ||
| 36 | |||
| 37 | version 7.30_1 | ||
| 38 | |||
| 39 | =head1 DESCRIPTION | ||
| 40 | |||
| 41 | The C<cat> API in Elasticsearch provides information about your | ||
| 42 | cluster and indices in a simple, easy to read text format, intended | ||
| 43 | for human consumption. | ||
| 44 | |||
| 45 | These APIs have a number of parameters in common: | ||
| 46 | |||
| 47 | =over | ||
| 48 | |||
| 49 | =item * C<help> | ||
| 50 | |||
| 51 | Returns help about the API, eg: | ||
| 52 | |||
| 53 | say $e->cat->allocation(help => 1); | ||
| 54 | |||
| 55 | =item * C<v> | ||
| 56 | |||
| 57 | Includes the column headers in the output: | ||
| 58 | |||
| 59 | say $e->cat->allocation(v => 1); | ||
| 60 | |||
| 61 | =item * C<h> | ||
| 62 | |||
| 63 | Accepts a list of column names to be output, eg: | ||
| 64 | |||
| 65 | say $e->cat->indices(h => ['health','index']); | ||
| 66 | |||
| 67 | =item * C<bytes> | ||
| 68 | |||
| 69 | Formats byte-based values as bytes (C<b>), kilobytes (C<k>), megabytes | ||
| 70 | (C<m>) or gigabytes (C<g>) | ||
| 71 | |||
| 72 | =back | ||
| 73 | |||
| 74 | It does L<Search::Elasticsearch::Role::Client::Direct>. | ||
| 75 | |||
| 76 | =head1 METHODS | ||
| 77 | |||
| 78 | =head2 C<help()> | ||
| 79 | |||
| 80 | say $e->cat->help; | ||
| 81 | |||
| 82 | Returns the list of supported C<cat> APIs | ||
| 83 | |||
| 84 | =head2 C<aliases()> | ||
| 85 | |||
| 86 | say $e->cat->aliases( | ||
| 87 | name => 'name' | \@names # optional | ||
| 88 | ); | ||
| 89 | |||
| 90 | Returns information about index aliases, optionally limited to the specified | ||
| 91 | index/alias names. | ||
| 92 | |||
| 93 | Query string parameters: | ||
| 94 | C<h>, | ||
| 95 | C<help>, | ||
| 96 | C<local>, | ||
| 97 | C<master_timeout>, | ||
| 98 | C<v> | ||
| 99 | |||
| 100 | See the L<cat aliases docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-aliases.html> | ||
| 101 | for more information. | ||
| 102 | |||
| 103 | =head2 C<allocation()> | ||
| 104 | |||
| 105 | say $e->cat->allocation( | ||
| 106 | node_id => 'node' | \@nodes # optional | ||
| 107 | ); | ||
| 108 | |||
| 109 | Provides a snapshot of how shards have located around the cluster and the | ||
| 110 | state of disk usage. | ||
| 111 | |||
| 112 | Query string parameters: | ||
| 113 | C<bytes>, | ||
| 114 | C<h>, | ||
| 115 | C<help>, | ||
| 116 | C<local>, | ||
| 117 | C<master_timeout>, | ||
| 118 | C<v> | ||
| 119 | |||
| 120 | See the L<cat allocation docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html> | ||
| 121 | for more information. | ||
| 122 | |||
| 123 | =head2 C<count()> | ||
| 124 | |||
| 125 | say $e->cat->count( | ||
| 126 | index => 'index' | \@indices # optional | ||
| 127 | ); | ||
| 128 | |||
| 129 | Provides quick access to the document count of the entire cluster, or | ||
| 130 | individual indices. | ||
| 131 | |||
| 132 | Query string parameters: | ||
| 133 | C<h>, | ||
| 134 | C<help>, | ||
| 135 | C<local>, | ||
| 136 | C<master_timeout>, | ||
| 137 | C<v> | ||
| 138 | |||
| 139 | See the L<cat count docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html> | ||
| 140 | for more information. | ||
| 141 | |||
| 142 | =head2 C<fielddata()> | ||
| 143 | |||
| 144 | say $e->cat->fielddata( | ||
| 145 | fields => 'field' | \@fields # optional | ||
| 146 | ); | ||
| 147 | |||
| 148 | Shows the amount of memory used by each of the specified `fields` (or all | ||
| 149 | fields) loaded into fielddata. | ||
| 150 | |||
| 151 | Query string parameters: | ||
| 152 | C<bytes>, | ||
| 153 | C<h>, | ||
| 154 | C<help>, | ||
| 155 | C<local>, | ||
| 156 | C<master_timeout>, | ||
| 157 | C<v> | ||
| 158 | |||
| 159 | See the L<cat fielddata docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html> | ||
| 160 | for more information. | ||
| 161 | |||
| 162 | =head2 C<health()> | ||
| 163 | |||
| 164 | say $e->cat->health(); | ||
| 165 | |||
| 166 | Provides a snapshot of how shards have located around the cluster and the | ||
| 167 | state of disk usage. | ||
| 168 | |||
| 169 | Query string parameters: | ||
| 170 | C<bytes>, | ||
| 171 | C<h>, | ||
| 172 | C<help>, | ||
| 173 | C<local>, | ||
| 174 | C<master_timeout>, | ||
| 175 | C<ts>, | ||
| 176 | C<v> | ||
| 177 | |||
| 178 | See the L<cat health docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html> | ||
| 179 | for more information. | ||
| 180 | |||
| 181 | =head2 C<indices()> | ||
| 182 | |||
| 183 | say $e->cat->indices( | ||
| 184 | index => 'index' | \@indices # optional | ||
| 185 | ); | ||
| 186 | |||
| 187 | Provides a summary of index size and health for the whole cluster | ||
| 188 | or individual indices | ||
| 189 | |||
| 190 | Query string parameters: | ||
| 191 | C<bytes>, | ||
| 192 | C<h>, | ||
| 193 | C<help>, | ||
| 194 | C<local>, | ||
| 195 | C<master_timeout>, | ||
| 196 | C<pri>, | ||
| 197 | C<v> | ||
| 198 | |||
| 199 | See the L<cat indices docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html> | ||
| 200 | for more information. | ||
| 201 | |||
| 202 | =head2 C<master()> | ||
| 203 | |||
| 204 | say $e->cat->master(); | ||
| 205 | |||
| 206 | Displays the master’s node ID, bound IP address, and node name. | ||
| 207 | |||
| 208 | Query string parameters: | ||
| 209 | C<h>, | ||
| 210 | C<help>, | ||
| 211 | C<local>, | ||
| 212 | C<master_timeout>, | ||
| 213 | C<v> | ||
| 214 | |||
| 215 | See the L<cat master docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-master.html> | ||
| 216 | for more information. | ||
| 217 | |||
| 218 | =head2 C<nodeattrs()> | ||
| 219 | |||
| 220 | say $e->cat->nodeattrs(); | ||
| 221 | |||
| 222 | Returns the node attributes set per node. | ||
| 223 | |||
| 224 | Query string parameters: | ||
| 225 | C<h>, | ||
| 226 | C<help>, | ||
| 227 | C<local>, | ||
| 228 | C<master_timeout>, | ||
| 229 | C<v> | ||
| 230 | |||
| 231 | See the L<cat nodeattrs docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodeattrs.html> | ||
| 232 | for more information. | ||
| 233 | |||
| 234 | =head2 C<nodes()> | ||
| 235 | |||
| 236 | say $e->cat->nodes(); | ||
| 237 | |||
| 238 | Provides a snapshot of all of the nodes in your cluster. | ||
| 239 | |||
| 240 | Query string parameters: | ||
| 241 | C<h>, | ||
| 242 | C<help>, | ||
| 243 | C<local>, | ||
| 244 | C<master_timeout>, | ||
| 245 | C<v> | ||
| 246 | |||
| 247 | See the L<cat nodes docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html> | ||
| 248 | for more information. | ||
| 249 | |||
| 250 | =head2 C<pending_tasks()> | ||
| 251 | |||
| 252 | say $e->cat->pending_tasks(); | ||
| 253 | |||
| 254 | Returns any cluster-level tasks which are queued on the master. | ||
| 255 | |||
| 256 | Query string parameters: | ||
| 257 | C<local>, | ||
| 258 | C<master_timeout>, | ||
| 259 | C<h>, | ||
| 260 | C<help>, | ||
| 261 | C<v> | ||
| 262 | |||
| 263 | See the L<cat pending-tasks docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-pending-tasks.html> | ||
| 264 | for more information. | ||
| 265 | |||
| 266 | =head2 C<plugins()> | ||
| 267 | |||
| 268 | say $e->cat->plugins(); | ||
| 269 | |||
| 270 | Returns information about plugins installed on each node. | ||
| 271 | |||
| 272 | Query string parameters: | ||
| 273 | C<local>, | ||
| 274 | C<master_timeout>, | ||
| 275 | C<h>, | ||
| 276 | C<help>, | ||
| 277 | C<v> | ||
| 278 | |||
| 279 | See the L<cat plugins docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-plugins.html> | ||
| 280 | for more information. | ||
| 281 | |||
| 282 | =head2 C<recovery()> | ||
| 283 | |||
| 284 | say $e->cat->recovery( | ||
| 285 | index => 'index' | \@indices # optional | ||
| 286 | ); | ||
| 287 | |||
| 288 | Provides a view of shard replication. It will show information | ||
| 289 | anytime data from at least one shard is copying to a different node. | ||
| 290 | It can also show up on cluster restarts. If your recovery process seems | ||
| 291 | stuck, try it to see if there’s any movement using C<recovery()>. | ||
| 292 | |||
| 293 | Query string parameters: | ||
| 294 | C<bytes>, | ||
| 295 | C<h>, | ||
| 296 | C<help>, | ||
| 297 | C<master_timeout>, | ||
| 298 | C<v> | ||
| 299 | |||
| 300 | See the L<cat recovery docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html> | ||
| 301 | for more information. | ||
| 302 | |||
| 303 | =head2 C<repositories()> | ||
| 304 | |||
| 305 | say $e->cat->repositories() | ||
| 306 | |||
| 307 | Provides a list of registered snapshot repositories. | ||
| 308 | |||
| 309 | Query string parameters: | ||
| 310 | C<h>, | ||
| 311 | C<help>, | ||
| 312 | C<local>, | ||
| 313 | C<master_timeout>, | ||
| 314 | C<v> | ||
| 315 | |||
| 316 | See the L<cat repositories docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html> | ||
| 317 | for more information. | ||
| 318 | |||
| 319 | =head2 C<segments()> | ||
| 320 | |||
| 321 | say $e->cat->segments( | ||
| 322 | index => 'index' | \@indices # optional | ||
| 323 | ); | ||
| 324 | |||
| 325 | Provides low level information about the segments in the shards of an index. | ||
| 326 | |||
| 327 | Query string parameters: | ||
| 328 | C<h>, | ||
| 329 | C<help>, | ||
| 330 | C<v> | ||
| 331 | |||
| 332 | See the L<cat shards docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html> | ||
| 333 | for more information. | ||
| 334 | |||
| 335 | =head2 C<shards()> | ||
| 336 | |||
| 337 | say $e->cat->shards( | ||
| 338 | index => 'index' | \@indices # optional | ||
| 339 | ); | ||
| 340 | |||
| 341 | Provides a detailed view of what nodes contain which shards, the state and | ||
| 342 | size of each shard. | ||
| 343 | |||
| 344 | Query string parameters: | ||
| 345 | C<h>, | ||
| 346 | C<help>, | ||
| 347 | C<local>, | ||
| 348 | C<master_timeout>, | ||
| 349 | C<v> | ||
| 350 | |||
| 351 | See the L<cat shards docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html> | ||
| 352 | for more information. | ||
| 353 | |||
| 354 | =head2 C<snapshots()> | ||
| 355 | |||
| 356 | say $e->cat->snapshots( | ||
| 357 | repository => 'repository' | \@repositories # required | ||
| 358 | ) | ||
| 359 | |||
| 360 | Provides a list of all snapshots that belong to the specified repositories. | ||
| 361 | |||
| 362 | Query string parameters: | ||
| 363 | C<h>, | ||
| 364 | C<help>, | ||
| 365 | C<ignore_unavailable>, | ||
| 366 | C<master_timeout>, | ||
| 367 | C<v> | ||
| 368 | |||
| 369 | See the L<cat snapshots docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html> | ||
| 370 | for more information. | ||
| 371 | |||
| 372 | =head2 C<thread_pool()> | ||
| 373 | |||
| 374 | say $e->cat->thread_pool( | ||
| 375 | index => 'index' | \@indices # optional | ||
| 376 | ); | ||
| 377 | |||
| 378 | Shows cluster wide thread pool statistics per node. By default the C<active>, | ||
| 379 | C<queue> and C<rejected> statistics are returned for the C<bulk>, C<index> and | ||
| 380 | C<search> thread pools. | ||
| 381 | |||
| 382 | Query string parameters: | ||
| 383 | C<full_id>, | ||
| 384 | C<h>, | ||
| 385 | C<help>, | ||
| 386 | C<local>, | ||
| 387 | C<master_timeout>, | ||
| 388 | C<v> | ||
| 389 | |||
| 390 | See the L<cat thread_pool docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html> | ||
| 391 | for more information. | ||
| 392 | |||
| 393 | =head1 AUTHOR | ||
| 394 | |||
| 395 | Enrico Zimuel <enrico.zimuel@elastic.co> | ||
| 396 | |||
| 397 | =head1 COPYRIGHT AND LICENSE | ||
| 398 | |||
| 399 | This software is Copyright (c) 2020 by Elasticsearch BV. | ||
| 400 | |||
| 401 | This is free software, licensed under: | ||
| 402 | |||
| 403 | The Apache License, Version 2.0, January 2004 | ||
| 404 | |||
| 405 | =cut | ||
| 406 | |||
| 407 | __END__ |