1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * Copyright OpenSearch Contributors
7: * SPDX-License-Identifier: Apache-2.0
8: *
9: * OpenSearch PHP client
10: *
11: * @link https://github.com/opensearch-project/opensearch-php/
12: * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
13: * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
14: * @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
15: *
16: * Licensed to Elasticsearch B.V under one or more agreements.
17: * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
18: * the GNU Lesser General Public License, Version 2.1, at your option.
19: * See the LICENSE file in the project root for more information.
20: */
21:
22: namespace OpenSearch\Namespaces;
23:
24: use OpenSearch\Namespaces\AbstractNamespace;
25:
26: /**
27: * Class ClusterNamespace
28: *
29: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
30: */
31: class ClusterNamespace extends AbstractNamespace
32: {
33: /**
34: * Provides explanations for shard allocations in the cluster.
35: *
36: * $params['include_disk_info'] = (boolean) If true, returns information about disk usage and shard sizes. (Default = false)
37: * $params['include_yes_decisions'] = (boolean) If true, returns YES decisions in explanation. (Default = false)
38: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
39: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
40: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
41: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
42: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
43: * $params['body'] = (array) The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
44: *
45: * @param array $params Associative array of parameters
46: * @return array
47: */
48: public function allocationExplain(array $params = [])
49: {
50: $body = $this->extractArgument($params, 'body');
51:
52: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\AllocationExplain::class);
53: $endpoint->setParams($params);
54: $endpoint->setBody($body);
55:
56: return $this->performRequest($endpoint);
57: }
58:
59: /**
60: * Deletes a component template.
61: *
62: * $params['name'] = (string) Name of the component template to delete. Wildcard (*) expressions are supported.
63: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
64: * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error.
65: * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error.
66: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
67: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
68: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
69: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
70: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
71: *
72: * @param array $params Associative array of parameters
73: * @return array
74: */
75: public function deleteComponentTemplate(array $params = [])
76: {
77: $name = $this->extractArgument($params, 'name');
78:
79: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\DeleteComponentTemplate::class);
80: $endpoint->setParams($params);
81: $endpoint->setName($name);
82:
83: return $this->performRequest($endpoint);
84: }
85:
86: /**
87: * Delete any existing decommission.
88: *
89: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
90: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
91: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
92: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
93: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
94: *
95: * @param array $params Associative array of parameters
96: * @return array
97: */
98: public function deleteDecommissionAwareness(array $params = [])
99: {
100: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\DeleteDecommissionAwareness::class);
101: $endpoint->setParams($params);
102:
103: return $this->performRequest($endpoint);
104: }
105:
106: /**
107: * Clears cluster voting config exclusions.
108: *
109: * $params['wait_for_removal'] = (boolean) Specifies whether to wait for all excluded nodes to be removed from thecluster before clearing the voting configuration exclusions list.Defaults to true, meaning that all excluded nodes must be removed fromthe cluster before this API takes any action. If set to false then thevoting configuration exclusions list is cleared even if some excludednodes are still in the cluster. (Default = true)
110: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
111: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
112: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
113: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
114: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
115: *
116: * @param array $params Associative array of parameters
117: * @return array
118: */
119: public function deleteVotingConfigExclusions(array $params = [])
120: {
121: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\DeleteVotingConfigExclusions::class);
122: $endpoint->setParams($params);
123:
124: return $this->performRequest($endpoint);
125: }
126:
127: /**
128: * Delete weighted shard routing weights.
129: *
130: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
131: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
132: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
133: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
134: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
135: *
136: * @param array $params Associative array of parameters
137: * @return array
138: */
139: public function deleteWeightedRouting(array $params = [])
140: {
141: $body = $this->extractArgument($params, 'body');
142:
143: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\DeleteWeightedRouting::class);
144: $endpoint->setParams($params);
145: $endpoint->setBody($body);
146:
147: return $this->performRequest($endpoint);
148: }
149:
150: /**
151: * Returns information about whether a particular component template exist.
152: *
153: * $params['name'] = (string) Name of the component template to check existence of. Wildcard (*) expressions are supported.
154: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
155: * $params['local'] = (boolean) If true, the request retrieves information from the local node only.Defaults to false, which means information is retrieved from the master node. (Default = false)
156: * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response isreceived before the timeout expires, the request fails and returns anerror.
157: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
158: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
159: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
160: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
161: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
162: *
163: * @param array $params Associative array of parameters
164: * @return bool
165: */
166: public function existsComponentTemplate(array $params = []): bool
167: {
168: $name = $this->extractArgument($params, 'name');
169:
170: // manually make this verbose so we can check status code
171: $params['client']['verbose'] = true;
172:
173: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\ExistsComponentTemplate::class);
174: $endpoint->setParams($params);
175: $endpoint->setName($name);
176:
177: return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
178: }
179:
180: /**
181: * Returns one or more component templates.
182: *
183: * $params['name'] = (array) Name of the component template to retrieve. Wildcard (`*`) expressions are supported.
184: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
185: * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only.If `false`, information is retrieved from the master node. (Default = false)
186: * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error.
187: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
188: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
189: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
190: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
191: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
192: *
193: * @param array $params Associative array of parameters
194: * @return array
195: */
196: public function getComponentTemplate(array $params = [])
197: {
198: $name = $this->extractArgument($params, 'name');
199:
200: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\GetComponentTemplate::class);
201: $endpoint->setParams($params);
202: $endpoint->setName($name);
203:
204: return $this->performRequest($endpoint);
205: }
206:
207: /**
208: * Get details and status of decommissioned attribute.
209: *
210: * $params['awareness_attribute_name'] = (string) Awareness attribute name.
211: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
212: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
213: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
214: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
215: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
216: *
217: * @param array $params Associative array of parameters
218: * @return array
219: */
220: public function getDecommissionAwareness(array $params = [])
221: {
222: $awareness_attribute_name = $this->extractArgument($params, 'awareness_attribute_name');
223:
224: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\GetDecommissionAwareness::class);
225: $endpoint->setParams($params);
226: $endpoint->setAwarenessAttributeName($awareness_attribute_name);
227:
228: return $this->performRequest($endpoint);
229: }
230:
231: /**
232: * Returns cluster settings.
233: *
234: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
235: * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false)
236: * $params['include_defaults'] = (boolean) If `true`, returns default cluster settings from the local node. (Default = false)
237: * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error.
238: * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error.
239: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
240: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
241: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
242: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
243: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
244: *
245: * @param array $params Associative array of parameters
246: * @return array
247: */
248: public function getSettings(array $params = [])
249: {
250: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\GetSettings::class);
251: $endpoint->setParams($params);
252:
253: return $this->performRequest($endpoint);
254: }
255:
256: /**
257: * Fetches weighted shard routing weights.
258: *
259: * $params['attribute'] = (string) Awareness attribute name.
260: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
261: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
262: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
263: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
264: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
265: *
266: * @param array $params Associative array of parameters
267: * @return array
268: */
269: public function getWeightedRouting(array $params = [])
270: {
271: $attribute = $this->extractArgument($params, 'attribute');
272:
273: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\GetWeightedRouting::class);
274: $endpoint->setParams($params);
275: $endpoint->setAttribute($attribute);
276:
277: return $this->performRequest($endpoint);
278: }
279:
280: /**
281: * Returns basic information about the health of the cluster.
282: *
283: * $params['index'] = (array) Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indexes in a cluster, omit this parameter or use `_all` or `*`.
284: * $params['awareness_attribute'] = (string) The awareness attribute for which the health is required.
285: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
286: * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indexes that are open, closed or both.
287: * $params['level'] = (enum) Can be one of cluster, indexes or shards. Controls the details level of the health information returned. (Options = awareness_attributes,cluster,indices,shards)
288: * $params['local'] = (boolean) If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. (Default = false)
289: * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
290: * $params['timeout'] = (string) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
291: * $params['wait_for_active_shards'] = (any) A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait.
292: * $params['wait_for_events'] = (enum) Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. (Options = high,immediate,languid,low,normal,urgent)
293: * $params['wait_for_no_initializing_shards'] = (boolean) A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.
294: * $params['wait_for_no_relocating_shards'] = (boolean) A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.
295: * $params['wait_for_nodes'] = (any) The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation.
296: * $params['wait_for_status'] = (enum) One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. (Options = green,red,yellow)
297: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
298: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
299: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
300: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
301: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
302: *
303: * @param array $params Associative array of parameters
304: * @return array
305: */
306: public function health(array $params = [])
307: {
308: $index = $this->extractArgument($params, 'index');
309:
310: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\Health::class);
311: $endpoint->setParams($params);
312: $endpoint->setIndex($index);
313:
314: return $this->performRequest($endpoint);
315: }
316:
317: /**
318: * Returns a list of any cluster-level changes (e.g. create index, update mapping,allocate or fail shard) which have not yet been executed.
319: *
320: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
321: * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only.If `false`, information is retrieved from the master node. (Default = false)
322: * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error.
323: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
324: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
325: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
326: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
327: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
328: *
329: * @param array $params Associative array of parameters
330: * @return array
331: */
332: public function pendingTasks(array $params = [])
333: {
334: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\PendingTasks::class);
335: $endpoint->setParams($params);
336:
337: return $this->performRequest($endpoint);
338: }
339:
340: /**
341: * Updates the cluster voting config exclusions by node ids or node names.
342: *
343: * $params['node_ids'] = (any) A comma-separated list of the persistent ids of the nodes to excludefrom the voting configuration. If specified, you may not also specify node_names.
344: * $params['node_names'] = (any) A comma-separated list of the names of the nodes to exclude from thevoting configuration. If specified, you may not also specify node_ids.
345: * $params['timeout'] = (string) When adding a voting configuration exclusion, the API waits for thespecified nodes to be excluded from the voting configuration beforereturning. If the timeout expires before the appropriate conditionis satisfied, the request fails and returns an error.
346: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
347: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
348: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
349: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
350: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
351: *
352: * @param array $params Associative array of parameters
353: * @return array
354: */
355: public function postVotingConfigExclusions(array $params = [])
356: {
357: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\PostVotingConfigExclusions::class);
358: $endpoint->setParams($params);
359:
360: return $this->performRequest($endpoint);
361: }
362:
363: /**
364: * Creates or updates a component template.
365: *
366: * $params['name'] = (string) Name of the component template to create. OpenSearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. OpenSearch Agent uses these templates to configure backing indexes for its data streams. If you use OpenSearch Agent and want to overwrite one of these templates, set the `version` for your replacement template higher than the current version. If you don't use OpenSearch Agent and want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the cluster update settings API.
367: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
368: * $params['create'] = (boolean) If `true`, this request cannot replace or update existing component templates. (Default = false)
369: * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error.
370: * $params['timeout'] = (string) Operation timeout.
371: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
372: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
373: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
374: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
375: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
376: * $params['body'] = (array) The template definition (Required)
377: *
378: * @param array $params Associative array of parameters
379: * @return array
380: */
381: public function putComponentTemplate(array $params = [])
382: {
383: $name = $this->extractArgument($params, 'name');
384: $body = $this->extractArgument($params, 'body');
385:
386: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\PutComponentTemplate::class);
387: $endpoint->setParams($params);
388: $endpoint->setName($name);
389: $endpoint->setBody($body);
390:
391: return $this->performRequest($endpoint);
392: }
393:
394: /**
395: * Decommissions an awareness attribute.
396: *
397: * $params['awareness_attribute_name'] = (string) Awareness attribute name.
398: * $params['awareness_attribute_value'] = (string) Awareness attribute value.
399: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
400: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
401: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
402: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
403: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
404: *
405: * @param array $params Associative array of parameters
406: * @return array
407: */
408: public function putDecommissionAwareness(array $params = [])
409: {
410: $awareness_attribute_name = $this->extractArgument($params, 'awareness_attribute_name');
411: $awareness_attribute_value = $this->extractArgument($params, 'awareness_attribute_value');
412:
413: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\PutDecommissionAwareness::class);
414: $endpoint->setParams($params);
415: $endpoint->setAwarenessAttributeName($awareness_attribute_name);
416: $endpoint->setAwarenessAttributeValue($awareness_attribute_value);
417:
418: return $this->performRequest($endpoint);
419: }
420:
421: /**
422: * Updates the cluster settings.
423: *
424: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
425: * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false)
426: * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node
427: * $params['timeout'] = (string) Explicit operation timeout
428: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
429: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
430: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
431: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
432: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
433: * $params['body'] = (array) The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). (Required)
434: *
435: * @param array $params Associative array of parameters
436: * @return array
437: */
438: public function putSettings(array $params = [])
439: {
440: $body = $this->extractArgument($params, 'body');
441:
442: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\PutSettings::class);
443: $endpoint->setParams($params);
444: $endpoint->setBody($body);
445:
446: return $this->performRequest($endpoint);
447: }
448:
449: /**
450: * Updates weighted shard routing weights.
451: *
452: * $params['attribute'] = (string) Awareness attribute name.
453: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
454: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
455: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
456: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
457: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
458: *
459: * @param array $params Associative array of parameters
460: * @return array
461: */
462: public function putWeightedRouting(array $params = [])
463: {
464: $attribute = $this->extractArgument($params, 'attribute');
465: $body = $this->extractArgument($params, 'body');
466:
467: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\PutWeightedRouting::class);
468: $endpoint->setParams($params);
469: $endpoint->setAttribute($attribute);
470: $endpoint->setBody($body);
471:
472: return $this->performRequest($endpoint);
473: }
474:
475: /**
476: * Returns the information about configured remote clusters.
477: *
478: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
479: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
480: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
481: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
482: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
483: *
484: * @param array $params Associative array of parameters
485: * @return array
486: */
487: public function remoteInfo(array $params = [])
488: {
489: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\RemoteInfo::class);
490: $endpoint->setParams($params);
491:
492: return $this->performRequest($endpoint);
493: }
494:
495: /**
496: * Allows to manually change the allocation of individual shards in the cluster.
497: *
498: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
499: * $params['dry_run'] = (boolean) If true, then the request simulates the operation only and returns the resulting state.
500: * $params['explain'] = (boolean) If true, then the response contains an explanation of why the commands can or cannot be executed.
501: * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
502: * $params['metric'] = (any) Limits the information returned to the specified metrics.
503: * $params['retry_failed'] = (boolean) If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures.
504: * $params['timeout'] = (string) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
505: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
506: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
507: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
508: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
509: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
510: * $params['body'] = (array) The definition of `commands` to perform (`move`, `cancel`, `allocate`)
511: *
512: * @param array $params Associative array of parameters
513: * @return array
514: */
515: public function reroute(array $params = [])
516: {
517: $body = $this->extractArgument($params, 'body');
518:
519: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\Reroute::class);
520: $endpoint->setParams($params);
521: $endpoint->setBody($body);
522:
523: return $this->performRequest($endpoint);
524: }
525:
526: /**
527: * Returns a comprehensive information about the state of the cluster.
528: *
529: * $params['metric'] = (array) Limit the information returned to the specified metrics
530: * $params['index'] = (array) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes
531: * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified)
532: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
533: * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indexes that are open, closed or both.
534: * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false)
535: * $params['ignore_unavailable'] = (boolean) Whether specified concrete indexes should be ignored when unavailable (missing or closed)
536: * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false)
537: * $params['master_timeout'] = (string) Specify timeout for connection to master
538: * $params['wait_for_metadata_version'] = (integer) Wait for the metadata version to be equal or greater than the specified metadata version
539: * $params['wait_for_timeout'] = (string) The maximum time to wait for wait_for_metadata_version before timing out
540: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
541: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
542: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
543: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
544: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
545: *
546: * @param array $params Associative array of parameters
547: * @return array
548: */
549: public function state(array $params = [])
550: {
551: $metric = $this->extractArgument($params, 'metric');
552: $index = $this->extractArgument($params, 'index');
553:
554: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\State::class);
555: $endpoint->setParams($params);
556: $endpoint->setMetric($metric);
557: $endpoint->setIndex($index);
558:
559: return $this->performRequest($endpoint);
560: }
561:
562: /**
563: * Returns high-level overview of cluster statistics.
564: *
565: * $params['index_metric'] = (array) Limit the information returned for indexes metric to the specific index metrics. It can be used only if indexes (or all) metric is specified.
566: * $params['metric'] = (array) Limit the information returned to the specified metrics
567: * $params['node_id'] = (array) Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster.
568: * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false)
569: * $params['timeout'] = (string) Period to wait for each node to respond.If a node does not respond before its timeout expires, the response does not include its stats.However, timed out nodes are included in the response's `_nodes.failed` property. Defaults to no timeout.
570: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
571: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
572: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
573: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
574: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
575: *
576: * @param array $params Associative array of parameters
577: * @return array
578: */
579: public function stats(array $params = [])
580: {
581: $index_metric = $this->extractArgument($params, 'index_metric');
582: $metric = $this->extractArgument($params, 'metric');
583: $node_id = $this->extractArgument($params, 'node_id');
584:
585: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Cluster\Stats::class);
586: $endpoint->setParams($params);
587: $endpoint->setIndexMetric($index_metric);
588: $endpoint->setMetric($metric);
589: $endpoint->setNodeId($node_id);
590:
591: return $this->performRequest($endpoint);
592: }
593:
594: }
595: