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