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 DanglingIndicesNamespace
28: *
29: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
30: */
31: class DanglingIndicesNamespace extends AbstractNamespace
32: {
33: /**
34: * Deletes the specified dangling index.
35: *
36: * $params['index_uuid'] = (string) The UUID of the dangling index
37: * $params['accept_data_loss'] = (boolean) Must be set to true in order to delete the dangling index
38: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
39: * $params['master_timeout'] = (string) Specify timeout for connection to master
40: * $params['timeout'] = (string) Explicit operation timeout
41: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
42: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
43: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
44: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
45: * $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 "-".
46: *
47: * @param array $params Associative array of parameters
48: * @return array
49: */
50: public function deleteDanglingIndex(array $params = [])
51: {
52: $index_uuid = $this->extractArgument($params, 'index_uuid');
53:
54: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\DanglingIndices\DeleteDanglingIndex::class);
55: $endpoint->setParams($params);
56: $endpoint->setIndexUuid($index_uuid);
57:
58: return $this->performRequest($endpoint);
59: }
60:
61: /**
62: * Imports the specified dangling index.
63: *
64: * $params['index_uuid'] = (string) The UUID of the dangling index
65: * $params['accept_data_loss'] = (boolean) Must be set to true in order to import the dangling index
66: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
67: * $params['master_timeout'] = (string) Specify timeout for connection to master
68: * $params['timeout'] = (string) Explicit operation timeout
69: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
70: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
71: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
72: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
73: * $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 "-".
74: *
75: * @param array $params Associative array of parameters
76: * @return array
77: */
78: public function importDanglingIndex(array $params = [])
79: {
80: $index_uuid = $this->extractArgument($params, 'index_uuid');
81:
82: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\DanglingIndices\ImportDanglingIndex::class);
83: $endpoint->setParams($params);
84: $endpoint->setIndexUuid($index_uuid);
85:
86: return $this->performRequest($endpoint);
87: }
88:
89: /**
90: * Returns all dangling indexes.
91: *
92: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
93: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
94: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
95: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
96: * $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 "-".
97: *
98: * @param array $params Associative array of parameters
99: * @return array
100: */
101: public function listDanglingIndices(array $params = [])
102: {
103: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\DanglingIndices\ListDanglingIndices::class);
104: $endpoint->setParams($params);
105:
106: return $this->performRequest($endpoint);
107: }
108:
109: }
110: