Debian Codegraph @

lib/Search/Elasticsearch/Client/1_0/Direct/Cluster.pm

raw symbols SCIP
1 package Search::Elasticsearch::Client::scip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/1_0::Direct::Cluster;
2 $Search::Elasticsearch::Client::1_0::Direct::Cluster::VERSIONscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/1_0/Direct/Cluster/$VERSION. = '6.81';
3 use Mooscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Moo/;
4 withscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/with(). 'Search::Elasticsearch::Client::1_0::Role::API';
5 withscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/with(). 'Search::Elasticsearch::Role::Client::Direct';
6 __PACKAGE__->_install_apiscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 __PACKAGE__/_install_api().('cluster');
7
8 sub node_infoscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/node_info(). { _deprecatedscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/_deprecated().( 'node_info', 'info' ) }
9 sub node_statsscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/node_stats(). { _deprecatedscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/_deprecated().( 'node_stats', 'stats' ) }
10 sub hot_threadsscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/hot_threads(). { _deprecatedscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/_deprecated().( 'hot_threads', 'hot_threads' ) }
11 sub node_shutdownscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/node_shutdown(). { _deprecatedscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/_deprecated().( 'node_shutdown', 'shutdown' ) }
12
13 #===================================
14 sub _deprecatedscip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/_deprecated(). {
15 #===================================
16 my ( $old, $new ) = @_scip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/`@_`.;
17 diescip-perl cpan Search-Elasticsearch-Client-1_0 6.81 Search/Elasticsearch/Client/` 1_0`/die(). "The method \$es->cluster->$old() has moved to \$es->nodes->$new()";
18 }
19
20 1;
21
22 =pod
23
24 =encoding UTF-8
25
26 =head1 NAME
27
28 Search::Elasticsearch::Client::1_0::Direct::Cluster - A client for running cluster-level requests
29
30 =head1 VERSION
31
32 version 6.81
33
34 =head1 DESCRIPTION
35
36 This module provides methods to make cluster-level requests, such as
37 getting and setting cluster-level settings, manually rerouting shards,
38 and retrieving for monitoring purposes.
39
40 It does L<Search::Elasticsearch::Role::Client::Direct>.
41
42 =head1 METHODS
43
44 =head2 C<health()>
45
46 $response = $e->cluster->health(
47 index => 'index' | \@indices # optional
48 );
49
50 The C<health()> method is used to retrieve information about the cluster
51 health, returning C<red>, C<yellow> or C<green> to indicate the state
52 of the cluster, indices or shards.
53
54 Query string parameters:
55 C<level>,
56 C<local>,
57 C<master_timeout>,
58 C<timeout>,
59 C<wait_for_active_shards>,
60 C<wait_for_nodes>,
61 C<wait_for_relocating_shards>,
62 C<wait_for_status>
63
64 See the L<cluster health docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>
65 for more information.
66
67 =head2 C<stats()>
68
69 $response = $e->cluster->stats(
70 node_id => 'node' | \@nodes # optional
71 );
72
73 Returns high-level cluster stats, optionally limited to the listed nodes.
74
75 Query string parameters:
76 C<flat_settings>,
77 C<human>
78
79 See the L<cluster stats docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>
80 for more information.
81
82 =head2 C<get_settings()>
83
84 $response = $e->cluster->get_settings()
85
86 The C<get_settings()> method is used to retrieve cluster-wide settings that
87 have been set with the L</put_settings()> method.
88
89 Query string parameters:
90 C<flat_settings>,
91 C<master_timeout>,
92 C<timeout>
93
94 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
95 for more information.
96
97 =head2 C<put_settings()>
98
99 $response = $e->cluster->put_settings( %settings );
100
101 The C<put_settings()> method is used to set cluster-wide settings, either
102 transiently (which don't survive restarts) or permanently (which do survive
103 restarts).
104
105 For instance:
106
107 $response = $e->cluster->put_settings(
108 body => {
109 transient => { "discovery.zen.minimum_master_nodes" => 5 }
110 }
111 );
112
113 Query string parameters:
114 C<flat_settings>
115
116 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
117 for more information.
118
119 =head2 C<state()>
120
121 $response = $e->cluster->state(
122 metric => $metric | \@metrics # optional
123 index => $index | \@indices # optional
124 );
125
126 The C<state()> method returns the current cluster state from the master node,
127 or from the responding node if C<local> is set to C<true>.
128
129 It returns all metrics by default, but these can be limited to any of:
130 C<_all>,
131 C<blocks>,
132 C<metadata>,
133 C<nodes>,
134 C<routing_table>
135
136 Metrics for indices can be limited to particular indices with the C<index>
137 parameter.
138
139 Query string parameters:
140 C<allow_no_indices>,
141 C<expand_wildcards>,
142 C<flat_settings>,
143 C<ignore_unavailable>,
144 C<local>,
145 C<master_timeout>
146
147 See the L<cluster state docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>
148 for more information.
149
150 =head2 C<pending_tasks()>
151
152 $response = $e->cluster->pending_tasks();
153
154 Returns a list of cluster-level tasks still pending on the master node.
155
156 Query string parameters:
157 C<local>,
158 C<master_timeout>
159
160 See the L<pending tasks docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html>
161 for more information.
162
163 =head2 C<reroute()>
164
165 $e->cluster->reroute(
166 body => { commands }
167 );
168
169 The C<reroute()> method is used to manually reallocate shards from one
170 node to another. The C<body> should contain the C<commands> indicating
171 which changes should be made. For instance:
172
173 $e->cluster->reroute(
174 body => {
175 commands => [
176 { move => {
177 index => 'test',
178 shard => 0,
179 from_node => 'node_1',
180 to_node => 'node_2
181 }},
182 { allocate => {
183 index => 'test',
184 shard => 1,
185 node => 'node_3'
186 }}
187 ]
188 }
189 );
190
191 Query string parameters:
192 C<dry_run>,
193 C<explain>,
194 C<master_timeout>,
195 C<metric>,
196 C<timeout>
197
198 See the L<reroute docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>
199 for more information.
200
201 =head1 AUTHOR
202
203 Enrico Zimuel <[email protected]>
204
205 =head1 COPYRIGHT AND LICENSE
206
207 This software is Copyright (c) 2020 by Elasticsearch BV.
208
209 This is free software, licensed under:
210
211 The Apache License, Version 2.0, January 2004
212
213 =cut
214
215 __END__
216
217 # ABSTRACT: A client for running cluster-level requests
218