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