1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * SPDX-License-Identifier: Apache-2.0
7: *
8: * The OpenSearch Contributors require contributions made to
9: * this file be licensed under the Apache-2.0 license or a
10: * compatible open source license.
11: *
12: * Modifications Copyright OpenSearch Contributors. See
13: * GitHub history for details.
14: */
15:
16: namespace OpenSearch\Namespaces;
17:
18: use OpenSearch\Namespaces\AbstractNamespace;
19:
20: /**
21: * Class SearchPipelineNamespace
22: *
23: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
24: */
25: class SearchPipelineNamespace extends AbstractNamespace
26: {
27: /**
28: * Deletes the specified search pipeline.
29: *
30: * $params['id'] = (string) Pipeline ID.
31: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
32: * $params['timeout'] = (string) Operation timeout.
33: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
34: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
35: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
36: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
37: * $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 "-".
38: *
39: * @param array $params Associative array of parameters
40: * @return array
41: */
42: public function delete(array $params = [])
43: {
44: $id = $this->extractArgument($params, 'id');
45:
46: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\SearchPipeline\Delete::class);
47: $endpoint->setParams($params);
48: $endpoint->setId($id);
49:
50: return $this->performRequest($endpoint);
51: }
52:
53: /**
54: * Retrieves information about a specified search pipeline.
55: *
56: * $params['id'] = (string) Comma-separated list of search pipeline ids. Wildcards supported.
57: * $params['cluster_manager_timeout'] = (string) operation timeout for connection to cluster-manager node.
58: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
59: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
60: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
61: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
62: * $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 "-".
63: *
64: * @param array $params Associative array of parameters
65: * @return array
66: */
67: public function get(array $params = [])
68: {
69: $id = $this->extractArgument($params, 'id');
70:
71: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\SearchPipeline\Get::class);
72: $endpoint->setParams($params);
73: $endpoint->setId($id);
74:
75: return $this->performRequest($endpoint);
76: }
77:
78: /**
79: * Creates or replaces the specified search pipeline.
80: *
81: * $params['id'] = (string) Pipeline ID.
82: * $params['cluster_manager_timeout'] = (string) operation timeout for connection to cluster-manager node.
83: * $params['timeout'] = (string) Operation timeout.
84: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
85: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
86: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
87: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
88: * $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 "-".
89: *
90: * @param array $params Associative array of parameters
91: * @return array
92: */
93: public function put(array $params = [])
94: {
95: $id = $this->extractArgument($params, 'id');
96: $body = $this->extractArgument($params, 'body');
97:
98: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\SearchPipeline\Put::class);
99: $endpoint->setParams($params);
100: $endpoint->setId($id);
101: $endpoint->setBody($body);
102:
103: return $this->performRequest($endpoint);
104: }
105:
106: }
107: