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