-
Notifications
You must be signed in to change notification settings - Fork 969
Expand file tree
/
Copy pathTransform.php
More file actions
569 lines (529 loc) · 30.3 KB
/
Copy pathTransform.php
File metadata and controls
569 lines (529 loc) · 30.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
<?php
/**
* Elasticsearch PHP Client
*
* @link https://github.com/elastic/elasticsearch-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/
declare(strict_types=1);
namespace Elastic\Elasticsearch\Endpoints;
use Elastic\Elasticsearch\Exception\ClientResponseException;
use Elastic\Elasticsearch\Exception\MissingParameterException;
use Elastic\Elasticsearch\Exception\ServerResponseException;
use Elastic\Elasticsearch\Response\Elasticsearch;
use Elastic\Transport\Exception\NoNodeAvailableException;
use Http\Promise\Promise;
/**
* @generated This file is generated, please do not edit
*/
class Transform extends AbstractEndpoint
{
/**
* Delete a transform
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-delete-transform
* @group serverless
*
* @param array{
* transform_id: string, // (REQUIRED) The id of the transform to delete
* force?: bool, // If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state.
* delete_dest_index?: bool, // If this value is true, the destination index is deleted together with the transform. If false, the destination index will not be deleted
* timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function deleteTransform(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id'], $params);
$url = '/_transform/' . $this->encode($params['transform_id']);
$method = 'DELETE';
$url = $this->addQueryString($url, $params, ['force','delete_dest_index','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.delete_transform');
return $this->client->sendRequest($request);
}
/**
* Retrieves transform usage information for transform nodes
*
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-node-stats.html
* @group serverless
*
* @param array{
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function getNodeStats(?array $params = null)
{
$params = $params ?? [];
$url = '/_transform/_node_stats';
$method = 'GET';
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'transform.get_node_stats');
return $this->client->sendRequest($request);
}
/**
* Get transforms
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform
* @group serverless
*
* @param array{
* transform_id?: string|array<string>, // Comma-separated list of transform identifiers or wildcard expressions. You can get information for all transforms by using `_all`, by specifying `*` as the `<transform_id>`, or by omitting the `<transform_id>`.
* from?: int, // Skips the specified number of transforms.
* size?: int, // Specifies the maximum number of transforms to obtain. (DEFAULT: 100)
* allow_no_match?: bool, // Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. (DEFAULT: 1)
* exclude_generated?: bool, // Excludes fields that were automatically added when creating the transform. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function getTransform(?array $params = null)
{
$params = $params ?? [];
if (isset($params['transform_id'])) {
$url = '/_transform/' . $this->encode($this->convertValue($params['transform_id']));
$method = 'GET';
} else {
$url = '/_transform';
$method = 'GET';
}
$url = $this->addQueryString($url, $params, ['from','size','allow_no_match','exclude_generated','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.get_transform');
return $this->client->sendRequest($request);
}
/**
* Get transform stats
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform-stats
* @group serverless
*
* @param array{
* transform_id: string|array<string>, // (REQUIRED) Comma-separated list of transform identifiers or wildcard expressions. You can get information for all transforms by using `_all`, by specifying `*` as the `<transform_id>`, or by omitting the `<transform_id>`.
* allow_no_match?: bool, // Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. (DEFAULT: 1)
* basic?: bool, // If true, the response includes `id`, `state`, `node`, `stats`, `health`, and basic `checkpointing` information (the last and next checkpoint numbers, and the next checkpoint's `position` and `progress`). Skips statistics that require heavy computations to calculate: `operations_behind`, `changes_last_detected_at`, `last_search_time`, and the checkpoint timestamps.
* from?: int, // Skips the specified number of transforms.
* size?: int, // Specifies the maximum number of transforms to obtain. (DEFAULT: 100)
* timeout?: int|string, // Controls the time to wait for the stats (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function getTransformStats(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id'], $params);
$url = '/_transform/' . $this->encode($this->convertValue($params['transform_id'])) . '/_stats';
$method = 'GET';
$url = $this->addQueryString($url, $params, ['allow_no_match','basic','from','size','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.get_transform_stats');
return $this->client->sendRequest($request);
}
/**
* Preview a transform
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-preview-transform
* @group serverless
*
* @param array{
* transform_id?: string, // The id of the transform to preview.
* timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body?: string|array<mixed>, // The definition for the transform to preview. If body is a string must be a valid JSON.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function previewTransform(?array $params = null)
{
$params = $params ?? [];
if (isset($params['transform_id'])) {
$url = '/_transform/' . $this->encode($params['transform_id']) . '/_preview';
$method = empty($params['body']) ? 'GET' : 'POST';
} else {
$url = '/_transform/_preview';
$method = empty($params['body']) ? 'GET' : 'POST';
}
$url = $this->addQueryString($url, $params, ['timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.preview_transform');
return $this->client->sendRequest($request);
}
/**
* Create a transform
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-put-transform
* @group serverless
*
* @param array{
* transform_id: string, // (REQUIRED) The id of the new transform.
* defer_validation?: bool, // When the transform is created, a series of validations occur to ensure its success. For example, there is a check for the existence of the source indices and a check that the destination index is not part of the source index pattern. You can use this parameter to skip the checks, for example when the source index does not exist until after the transform is created. The validations are always run when you start the transform, however, with the exception of privilege checks.
* timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) The transform definition. If body is a string must be a valid JSON.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function putTransform(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id','body'], $params);
$url = '/_transform/' . $this->encode($params['transform_id']);
$method = 'PUT';
$url = $this->addQueryString($url, $params, ['defer_validation','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.put_transform');
return $this->client->sendRequest($request);
}
/**
* Reset a transform
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform
* @group serverless
*
* @param array{
* transform_id: string, // (REQUIRED) The id of the transform to reset
* force?: bool, // If this value is `true`, the transform is reset regardless of its current state. If it's `false`, the transform must be stopped before it can be reset.
* timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function resetTransform(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id'], $params);
$url = '/_transform/' . $this->encode($params['transform_id']) . '/_reset';
$method = 'POST';
$url = $this->addQueryString($url, $params, ['force','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.reset_transform');
return $this->client->sendRequest($request);
}
/**
* Schedule a transform to start now
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-schedule-now-transform
* @group serverless
*
* @param array{
* transform_id: string, // (REQUIRED) The id of the transform.
* timeout?: int|string, // Controls the time to wait for the scheduling to take place (DEFAULT: 30s)
* defer?: bool, // When true, defers the scheduling by the transform's configured sync delay instead of triggering immediately. The transform will process new data after the delay elapses rather than right away.
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function scheduleNowTransform(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id'], $params);
$url = '/_transform/' . $this->encode($params['transform_id']) . '/_schedule_now';
$method = 'POST';
$url = $this->addQueryString($url, $params, ['timeout','defer','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.schedule_now_transform');
return $this->client->sendRequest($request);
}
/**
* Set upgrade_mode for transform indices
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode
*
* @param array{
* enabled?: bool, // When `true`, it enables `upgrade_mode` which temporarily halts all transform tasks and prohibits new transform tasks from starting.
* timeout?: int|string, // The time to wait for the request to be completed. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function setUpgradeMode(?array $params = null)
{
$params = $params ?? [];
$url = '/_transform/set_upgrade_mode';
$method = 'POST';
$url = $this->addQueryString($url, $params, ['enabled','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'transform.set_upgrade_mode');
return $this->client->sendRequest($request);
}
/**
* Start a transform
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-start-transform
* @group serverless
*
* @param array{
* transform_id: string, // (REQUIRED) The id of the transform to start
* from?: string, // Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms.
* timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function startTransform(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id'], $params);
$url = '/_transform/' . $this->encode($params['transform_id']) . '/_start';
$method = 'POST';
$url = $this->addQueryString($url, $params, ['from','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.start_transform');
return $this->client->sendRequest($request);
}
/**
* Stop transforms
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform
* @group serverless
*
* @param array{
* transform_id: string, // (REQUIRED) The id of the transform to stop
* force?: bool, // If it is true, the API forcefully stops the transforms.
* wait_for_completion?: bool, // If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns immediately and the indexer is stopped asynchronously in the background.
* timeout?: int|string, // Period to wait for a response when `wait_for_completion` is `true`. If no response is received before the timeout expires, the request returns a timeout exception. However, the request continues processing and eventually moves the transform to a STOPPED state. (DEFAULT: 30s)
* allow_no_match?: bool, // Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If it is true, the API returns a successful acknowledgement message when there are no matches. When there are only partial matches, the API stops the appropriate transforms. If it is false, the request returns a 404 status code when there are no matches or only partial matches. (DEFAULT: 1)
* wait_for_checkpoint?: bool, // If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false, the transform stops as soon as possible.
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function stopTransform(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id'], $params);
$url = '/_transform/' . $this->encode($params['transform_id']) . '/_stop';
$method = 'POST';
$url = $this->addQueryString($url, $params, ['force','wait_for_completion','timeout','allow_no_match','wait_for_checkpoint','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.stop_transform');
return $this->client->sendRequest($request);
}
/**
* Update a transform
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-update-transform
* @group serverless
*
* @param array{
* transform_id: string, // (REQUIRED) The id of the transform.
* defer_validation?: bool, // When true, deferrable validations are not run. This behavior may be desired if the source index does not exist until after the transform is created.
* timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) The update transform definition. If body is a string must be a valid JSON.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function updateTransform(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['transform_id','body'], $params);
$url = '/_transform/' . $this->encode($params['transform_id']) . '/_update';
$method = 'POST';
$url = $this->addQueryString($url, $params, ['defer_validation','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['transform_id'], $request, 'transform.update_transform');
return $this->client->sendRequest($request);
}
/**
* Upgrade all transforms
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-upgrade-transforms
*
* @param array{
* dry_run?: bool, // When true, the request checks for updates but does not run them.
* timeout?: int|string, // Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. (DEFAULT: 30s)
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function upgradeTransforms(?array $params = null)
{
$params = $params ?? [];
$url = '/_transform/_upgrade';
$method = 'POST';
$url = $this->addQueryString($url, $params, ['dry_run','timeout','pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'transform.upgrade_transforms');
return $this->client->sendRequest($request);
}
}