5_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::5_0::Direct::Cluster;
6 $Search::Elasticsearch::Client::5_0::Direct::Cluster::VERSION = '7.30_1'; # TRIAL
7  
8 $Search::Elasticsearch::Client::5_0::Direct::Cluster::VERSION = '7.301';
9 use Moo;
10 with 'Search::Elasticsearch::Client::5_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::5_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_relocating_shards>,
58 C<wait_for_nodes>,
59 C<wait_for_status>
60  
61 See the L<cluster health docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>
62 for more information.
63  
64 =head2 C<stats()>
65  
66 $response = $e->cluster->stats(
67 node_id => 'node' | \@nodes # optional
68 );
69  
70 Returns high-level cluster stats, optionally limited to the listed nodes.
71  
72 Query string parameters:
73 C<error_trace>,
74 C<flat_settings>,
75 C<human>,
76 C<timeout>
77  
78 See the L<cluster stats docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>
79 for more information.
80  
81 =head2 C<get_settings()>
82  
83 $response = $e->cluster->get_settings()
84  
85 The C<get_settings()> method is used to retrieve cluster-wide settings that
86 have been set with the L</put_settings()> method.
87  
88 Query string parameters:
89 C<error_trace>,
90 C<flat_settings>,
91 C<human>,
92 C<include_defaults>,
93 C<master_timeout>,
94 C<timeout>
95  
96 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
97 for more information.
98  
99 =head2 C<put_settings()>
100  
101 $response = $e->cluster->put_settings( %settings );
102  
103 The C<put_settings()> method is used to set cluster-wide settings, either
104 transiently (which don't survive restarts) or permanently (which do survive
105 restarts).
106  
107 For instance:
108  
109 $response = $e->cluster->put_settings(
110 body => {
111 transient => { "discovery.zen.minimum_master_nodes" => 5 }
112 }
113 );
114  
115 Query string parameters:
116 C<error_trace>,
117 C<flat_settings>,
118 C<human>
119  
120 See the L<cluster settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>
121 for more information.
122  
123 =head2 C<state()>
124  
125 $response = $e->cluster->state(
126 metric => $metric | \@metrics # optional
127 index => $index | \@indices # optional
128 );
129  
130 The C<state()> method returns the current cluster state from the master node,
131 or from the responding node if C<local> is set to C<true>.
132  
133 It returns all metrics by default, but these can be limited to any of:
134 C<_all>,
135 C<blocks>,
136 C<metadata>,
137 C<nodes>,
138 C<routing_table>
139  
140 Metrics for indices can be limited to particular indices with the C<index>
141 parameter.
142  
143 Query string parameters:
144 C<allow_no_indices>,
145 C<error_trace>,
146 C<expand_wildcards>,
147 C<flat_settings>,
148 C<human>,
149 C<ignore_unavailable>,
150 C<local>,
151 C<master_timeout>
152  
153 See the L<cluster state docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>
154 for more information.
155  
156 =head2 C<allocation_explain()>
157  
158 $response = $e->cluster->allocation_explain(
159 body => { ... shard selectors ...} # optional
160 );
161  
162 Returns information about why a shard is allocated or unallocated or why.
163  
164 Query string parameters:
165 C<error_trace>,
166 C<human>,
167 C<include_disk_info>,
168 C<include_yes_decisions>
169  
170 See the L<cluster allocation explain docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>
171 for more information.
172  
173 =head2 C<pending_tasks()>
174  
175 $response = $e->cluster->pending_tasks();
176  
177 Returns a list of cluster-level tasks still pending on the master node.
178  
179 Query string parameters:
180 C<error_trace>,
181 C<human>,
182 C<local>,
183 C<master_timeout>
184  
185 See the L<pending tasks docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html>
186 for more information.
187  
188 =head2 C<reroute()>
189  
190 $e->cluster->reroute(
191 body => { commands }
192 );
193  
194 The C<reroute()> method is used to manually reallocate shards from one
195 node to another. The C<body> should contain the C<commands> indicating
196 which changes should be made. For instance:
197  
198 $e->cluster->reroute(
199 body => {
200 commands => [
201 { move => {
202 index => 'test',
203 shard => 0,
204 from_node => 'node_1',
205 to_node => 'node_2
206 }},
207 { allocate => {
208 index => 'test',
209 shard => 1,
210 node => 'node_3'
211 }}
212 ]
213 }
214 );
215  
216 Query string parameters:
217 C<dry_run>,
218 C<error_trace>,
219 C<explain>,
220 C<human>,
221 C<master_timeout>,
222 C<metric>,
223 C<retry_failed>,
224 C<timeout>
225  
226 See the L<reroute docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>
227 for more information.
228  
229 =head2 C<remote_info()>
230  
231 $response = $e->cluster->remote_info();
232  
233 The C<remote_info()> API retrieves all of the configured remote cluster information.
234  
235 Query string parameters:
236 C<error_trace>,
237 C<human>
238  
239 See the L<remote_info docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-remote-info.html>
240 for more information.
241  
242 =head1 AUTHOR
243  
244 Enrico Zimuel <enrico.zimuel@elastic.co>
245  
246 =head1 COPYRIGHT AND LICENSE
247  
248 This software is Copyright (c) 2020 by Elasticsearch BV.
249  
250 This is free software, licensed under:
251  
252 The Apache License, Version 2.0, January 2004
253  
254 =cut
255  
256 __END__