Elasticsearch/Client/7_0/Direct/Cluster.pm untested

filter: Statementstmt 0.0% 0 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 0.0% 0 / 10 CC 1 SCAR 6.9
CC
1
Cov
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::7_0::Direct::Cluster;
6 $Search::Elasticsearch::Client::7_0::Direct::Cluster::VERSION = '7.30_1'; # TRIAL
7  
8 $Search::Elasticsearch::Client::7_0::Direct::Cluster::VERSION = '7.301';
9 use Moo;
10 with 'Search::Elasticsearch::Client::7_0::Role::API';
11 with 'Search::Elasticsearch::Role::Client::Direct';
12 __PACKAGE__->_install_api('cluster');
13  
14 1;
15  
16 =pod
17  
18 =encoding UTF-8
19  
20 =head1 NAME
21  
22 Search::Elasticsearch::Client::7_0::Direct::Cluster - A client for running cluster-level requests
23  
24 =head1 VERSION
25  
26 version 7.30_1
27  
28 =head1 DESCRIPTION
29  
30 This module provides methods to make cluster-level requests, such as
31 getting and setting cluster-level settings, manually rerouting shards,
32 and retrieving for monitoring purposes.
33  
34 It does L<Search::Elasticsearch::Role::Client::Direct>.
35  
36 =head1 METHODS
37  
38 =head2 C<health()>
39  
40 $response = $e->cluster->health(
41 index => 'index' | \@indices # optional
42 );
43  
44 The C<health()> method is used to retrieve information about the cluster
45 health, returning C<red>, C<yellow> or C<green> to indicate the state
46 of the cluster, indices or shards.
47  
48 Query string parameters:
49 C<error_trace>,
50 C<human>,
51 C<level>,
52 C<local>,
53 C<master_timeout>,
54 C<timeout>,
55 C<wait_for_active_shards>,
56 C<wait_for_events>,
57 C<wait_for_no_initializing_shards>,
58 C<wait_for_no_relocating_shards>,
59 C<wait_for_nodes>,
60 C<wait_for_status>
61  
62 See the L<cluster health docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>
63 for more information.
64  
65 =head2 C<stats()>
66  
67 $response = $e->cluster->stats(
68 node_id => 'node' | \@nodes # optional
69 );
70  
71 Returns high-level cluster stats, optionally limited to the listed nodes.
72  
73 Query string parameters:
74 C<error_trace>,
75 C<flat_settings>,
76 C<human>,
77 C<timeout>
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<error_trace>,
91 C<flat_settings>,
92 C<human>,
93 C<include_defaults>,
94 C<master_timeout>,
95 C<timeout>
96  
97 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
98 for more information.
99  
100 =head2 C<put_settings()>
101  
102 $response = $e->cluster->put_settings( %settings );
103  
104 The C<put_settings()> method is used to set cluster-wide settings, either
105 transiently (which don't survive restarts) or permanently (which do survive
106 restarts).
107  
108 For instance:
109  
110 $response = $e->cluster->put_settings(
111 body => {
112 transient => { "discovery.zen.minimum_master_nodes" => 6 }
113 }
114 );
115  
116 Query string parameters:
117 C<error_trace>,
118 C<flat_settings>,
119 C<human>
120  
121 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
122 for more information.
123  
124 =head2 C<state()>
125  
126 $response = $e->cluster->state(
127 metric => $metric | \@metrics # optional
128 index => $index | \@indices # optional
129 );
130  
131 The C<state()> method returns the current cluster state from the master node,
132 or from the responding node if C<local> is set to C<true>.
133  
134 It returns all metrics by default, but these can be limited to any of:
135 C<_all>,
136 C<blocks>,
137 C<metadata>,
138 C<nodes>,
139 C<routing_table>
140  
141 Metrics for indices can be limited to particular indices with the C<index>
142 parameter.
143  
144 Query string parameters:
145 C<allow_no_indices>,
146 C<error_trace>,
147 C<expand_wildcards>,
148 C<flat_settings>,
149 C<human>,
150 C<ignore_unavailable>,
151 C<local>,
152 C<master_timeout>,
153 C<wait_for_metadata_version>,
154 C<wait_for_timeout>
155  
156 See the L<cluster state docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>
157 for more information.
158  
159 =head2 C<allocation_explain()>
160  
161 $response = $e->cluster->allocation_explain(
162 body => { ... shard selectors ...} # optional
163 );
164  
165 Returns information about why a shard is allocated or unallocated or why.
166  
167 Query string parameters:
168 C<error_trace>,
169 C<human>,
170 C<include_disk_info>,
171 C<include_yes_decisions>
172  
173 See the L<cluster allocation explain docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>
174 for more information.
175  
176 =head2 C<pending_tasks()>
177  
178 $response = $e->cluster->pending_tasks();
179  
180 Returns a list of cluster-level tasks still pending on the master node.
181  
182 Query string parameters:
183 C<error_trace>,
184 C<human>,
185 C<local>,
186 C<master_timeout>
187  
188 See the L<pending tasks docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html>
189 for more information.
190  
191 =head2 C<reroute()>
192  
193 $e->cluster->reroute(
194 body => { commands }
195 );
196  
197 The C<reroute()> method is used to manually reallocate shards from one
198 node to another. The C<body> should contain the C<commands> indicating
199 which changes should be made. For instance:
200  
201 $e->cluster->reroute(
202 body => {
203 commands => [
204 { move => {
205 index => 'test',
206 shard => 0,
207 from_node => 'node_1',
208 to_node => 'node_2
209 }},
210 { allocate => {
211 index => 'test',
212 shard => 1,
213 node => 'node_3'
214 }}
215 ]
216 }
217 );
218  
219 Query string parameters:
220 C<dry_run>,
221 C<error_trace>,
222 C<explain>,
223 C<human>,
224 C<master_timeout>,
225 C<metric>,
226 C<retry_failed>,
227 C<timeout>
228  
229 See the L<reroute docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>
230 for more information.
231  
232 =head2 C<remote_info()>
233  
234 $response = $e->cluster->remote_info();
235  
236 The C<remote_info()> API retrieves all of the configured remote cluster information.
237  
238 Query string parameters:
239 C<error_trace>,
240 C<human>
241  
242 See the L<remote_info docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-remote-info.html>
243 for more information.
244  
245 =head1 AUTHOR
246  
247 Enrico Zimuel <enrico.zimuel@elastic.co>
248  
249 =head1 COPYRIGHT AND LICENSE
250  
251 This software is Copyright (c) 2020 by Elasticsearch BV.
252  
253 This is free software, licensed under:
254  
255 The Apache License, Version 2.0, January 2004
256  
257 =cut
258  
259 __END__