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 IngestNamespace
28: *
29: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
30: */
31: class IngestNamespace extends AbstractNamespace
32: {
33: /**
34: * Deletes a pipeline.
35: *
36: * $params['id'] = (string) Pipeline ID or wildcard expression of pipeline IDs used to limit the request. To delete all ingest pipelines in a cluster, use a value of `*`.
37: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
38: * $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.
39: * $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.
40: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
41: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
42: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
43: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44: * $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 "-".
45: *
46: * @param array $params Associative array of parameters
47: * @return array
48: */
49: public function deletePipeline(array $params = [])
50: {
51: $id = $this->extractArgument($params, 'id');
52:
53: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ingest\DeletePipeline::class);
54: $endpoint->setParams($params);
55: $endpoint->setId($id);
56:
57: return $this->performRequest($endpoint);
58: }
59:
60: /**
61: * Returns a pipeline.
62: *
63: * $params['id'] = (string) Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions are supported. To get all ingest pipelines, omit this parameter or use `*`.
64: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
65: * $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.
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 getPipeline(array $params = [])
76: {
77: $id = $this->extractArgument($params, 'id');
78:
79: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ingest\GetPipeline::class);
80: $endpoint->setParams($params);
81: $endpoint->setId($id);
82:
83: return $this->performRequest($endpoint);
84: }
85:
86: /**
87: * Returns a list of the built-in patterns.
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 processorGrok(array $params = [])
99: {
100: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ingest\ProcessorGrok::class);
101: $endpoint->setParams($params);
102:
103: return $this->performRequest($endpoint);
104: }
105:
106: /**
107: * Creates or updates a pipeline.
108: *
109: * $params['id'] = (string) ID of the ingest pipeline to create or update.
110: * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node.
111: * $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.
112: * $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.
113: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
114: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
115: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
116: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
117: * $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 "-".
118: * $params['body'] = (array) The ingest definition (Required)
119: *
120: * @param array $params Associative array of parameters
121: * @return array
122: */
123: public function putPipeline(array $params = [])
124: {
125: $id = $this->extractArgument($params, 'id');
126: $body = $this->extractArgument($params, 'body');
127:
128: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ingest\PutPipeline::class);
129: $endpoint->setParams($params);
130: $endpoint->setId($id);
131: $endpoint->setBody($body);
132:
133: return $this->performRequest($endpoint);
134: }
135:
136: /**
137: * Allows to simulate a pipeline with example documents.
138: *
139: * $params['id'] = (string) Pipeline to test. If you don't specify a `pipeline` in the request body, this parameter is required.
140: * $params['verbose'] = (boolean) If `true`, the response includes output data for each processor in the executed pipeline. (Default = false)
141: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
142: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
143: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
144: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
145: * $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 "-".
146: * $params['body'] = (array) The simulate definition (Required)
147: *
148: * @param array $params Associative array of parameters
149: * @return array
150: */
151: public function simulate(array $params = [])
152: {
153: $id = $this->extractArgument($params, 'id');
154: $body = $this->extractArgument($params, 'body');
155:
156: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ingest\Simulate::class);
157: $endpoint->setParams($params);
158: $endpoint->setId($id);
159: $endpoint->setBody($body);
160:
161: return $this->performRequest($endpoint);
162: }
163:
164: }
165: