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: | /** |
25: | * Class DataFrameTransformDeprecatedNamespace |
26: | * |
27: | * @deprecated in 2.4.0 and will be removed in 3.0.0. |
28: | */ |
29: | class DataFrameTransformDeprecatedNamespace extends AbstractNamespace |
30: | { |
31: | /** |
32: | * $params['transform_id'] = (string) The id of the transform to delete |
33: | * $params['force'] = (boolean) When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. |
34: | * |
35: | * @param array $params Associative array of parameters |
36: | * @return array |
37: | |
38: | * |
39: | * @note This API is BETA and may change in ways that are not backwards compatible |
40: | * |
41: | */ |
42: | public function deleteTransform(array $params = []) |
43: | { |
44: | $transform_id = $this->extractArgument($params, 'transform_id'); |
45: | |
46: | $endpointBuilder = $this->endpoints; |
47: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\DeleteTransform'); |
48: | $endpoint->setParams($params); |
49: | $endpoint->setTransformId($transform_id); |
50: | |
51: | return $this->performRequest($endpoint); |
52: | } |
53: | /** |
54: | * $params['transform_id'] = (string) The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms |
55: | * $params['from'] = (int) skips a number of transform configs, defaults to 0 |
56: | * $params['size'] = (int) specifies a max number of transforms to get, defaults to 100 |
57: | * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
58: | * |
59: | * @param array $params Associative array of parameters |
60: | * @return array |
61: | |
62: | * |
63: | * @note This API is BETA and may change in ways that are not backwards compatible |
64: | * |
65: | */ |
66: | public function getTransform(array $params = []) |
67: | { |
68: | $transform_id = $this->extractArgument($params, 'transform_id'); |
69: | |
70: | $endpointBuilder = $this->endpoints; |
71: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransform'); |
72: | $endpoint->setParams($params); |
73: | $endpoint->setTransformId($transform_id); |
74: | |
75: | return $this->performRequest($endpoint); |
76: | } |
77: | /** |
78: | * $params['transform_id'] = (string) The id of the transform for which to get stats. '_all' or '*' implies all transforms |
79: | * $params['from'] = (number) skips a number of transform stats, defaults to 0 |
80: | * $params['size'] = (number) specifies a max number of transform stats to get, defaults to 100 |
81: | * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
82: | * |
83: | * @param array $params Associative array of parameters |
84: | * @return array |
85: | |
86: | * |
87: | * @note This API is BETA and may change in ways that are not backwards compatible |
88: | * |
89: | */ |
90: | public function getTransformStats(array $params = []) |
91: | { |
92: | $transform_id = $this->extractArgument($params, 'transform_id'); |
93: | |
94: | $endpointBuilder = $this->endpoints; |
95: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransformStats'); |
96: | $endpoint->setParams($params); |
97: | $endpoint->setTransformId($transform_id); |
98: | |
99: | return $this->performRequest($endpoint); |
100: | } |
101: | public function previewTransform(array $params = []) |
102: | { |
103: | $body = $this->extractArgument($params, 'body'); |
104: | |
105: | $endpointBuilder = $this->endpoints; |
106: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PreviewTransform'); |
107: | $endpoint->setParams($params); |
108: | $endpoint->setBody($body); |
109: | |
110: | return $this->performRequest($endpoint); |
111: | } |
112: | /** |
113: | * $params['transform_id'] = (string) The id of the new transform. |
114: | * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. |
115: | * $params['body'] = (array) The transform definition (Required) |
116: | * |
117: | * @param array $params Associative array of parameters |
118: | * @return array |
119: | |
120: | * |
121: | * @note This API is BETA and may change in ways that are not backwards compatible |
122: | * |
123: | */ |
124: | public function putTransform(array $params = []) |
125: | { |
126: | $transform_id = $this->extractArgument($params, 'transform_id'); |
127: | $body = $this->extractArgument($params, 'body'); |
128: | |
129: | $endpointBuilder = $this->endpoints; |
130: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PutTransform'); |
131: | $endpoint->setParams($params); |
132: | $endpoint->setTransformId($transform_id); |
133: | $endpoint->setBody($body); |
134: | |
135: | return $this->performRequest($endpoint); |
136: | } |
137: | /** |
138: | * $params['transform_id'] = (string) The id of the transform to start |
139: | * $params['timeout'] = (time) Controls the time to wait for the transform to start |
140: | * |
141: | * @param array $params Associative array of parameters |
142: | * @return array |
143: | |
144: | * |
145: | * @note This API is BETA and may change in ways that are not backwards compatible |
146: | * |
147: | */ |
148: | public function startTransform(array $params = []) |
149: | { |
150: | $transform_id = $this->extractArgument($params, 'transform_id'); |
151: | |
152: | $endpointBuilder = $this->endpoints; |
153: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StartTransform'); |
154: | $endpoint->setParams($params); |
155: | $endpoint->setTransformId($transform_id); |
156: | |
157: | return $this->performRequest($endpoint); |
158: | } |
159: | /** |
160: | * $params['transform_id'] = (string) The id of the transform to stop |
161: | * $params['wait_for_completion'] = (boolean) Whether to wait for the transform to fully stop before returning or not. Default to false |
162: | * $params['timeout'] = (time) Controls the time to wait until the transform has stopped. Default to 30 seconds |
163: | * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) |
164: | * |
165: | * @param array $params Associative array of parameters |
166: | * @return array |
167: | |
168: | * |
169: | * @note This API is BETA and may change in ways that are not backwards compatible |
170: | * |
171: | */ |
172: | public function stopTransform(array $params = []) |
173: | { |
174: | $transform_id = $this->extractArgument($params, 'transform_id'); |
175: | |
176: | $endpointBuilder = $this->endpoints; |
177: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StopTransform'); |
178: | $endpoint->setParams($params); |
179: | $endpoint->setTransformId($transform_id); |
180: | |
181: | return $this->performRequest($endpoint); |
182: | } |
183: | /** |
184: | * $params['transform_id'] = (string) The id of the transform. |
185: | * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. |
186: | * $params['body'] = (array) The update transform definition (Required) |
187: | * |
188: | * @param array $params Associative array of parameters |
189: | * @return array |
190: | |
191: | * |
192: | * @note This API is BETA and may change in ways that are not backwards compatible |
193: | * |
194: | */ |
195: | public function updateTransform(array $params = []) |
196: | { |
197: | $transform_id = $this->extractArgument($params, 'transform_id'); |
198: | $body = $this->extractArgument($params, 'body'); |
199: | |
200: | $endpointBuilder = $this->endpoints; |
201: | $endpoint = $endpointBuilder('DataFrameTransformDeprecated\UpdateTransform'); |
202: | $endpoint->setParams($params); |
203: | $endpoint->setTransformId($transform_id); |
204: | $endpoint->setBody($body); |
205: | |
206: | return $this->performRequest($endpoint); |
207: | } |
208: | } |
209: |