elasticsearch9 9.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. elasticsearch9/__init__.py +98 -0
  2. elasticsearch9/_async/__init__.py +16 -0
  3. elasticsearch9/_async/client/__init__.py +6531 -0
  4. elasticsearch9/_async/client/_base.py +430 -0
  5. elasticsearch9/_async/client/async_search.py +637 -0
  6. elasticsearch9/_async/client/autoscaling.py +252 -0
  7. elasticsearch9/_async/client/cat.py +2995 -0
  8. elasticsearch9/_async/client/ccr.py +1043 -0
  9. elasticsearch9/_async/client/cluster.py +1223 -0
  10. elasticsearch9/_async/client/connector.py +1978 -0
  11. elasticsearch9/_async/client/dangling_indices.py +192 -0
  12. elasticsearch9/_async/client/enrich.py +291 -0
  13. elasticsearch9/_async/client/eql.py +359 -0
  14. elasticsearch9/_async/client/esql.py +490 -0
  15. elasticsearch9/_async/client/features.py +130 -0
  16. elasticsearch9/_async/client/fleet.py +658 -0
  17. elasticsearch9/_async/client/graph.py +113 -0
  18. elasticsearch9/_async/client/ilm.py +668 -0
  19. elasticsearch9/_async/client/indices.py +5582 -0
  20. elasticsearch9/_async/client/inference.py +2247 -0
  21. elasticsearch9/_async/client/ingest.py +766 -0
  22. elasticsearch9/_async/client/license.py +400 -0
  23. elasticsearch9/_async/client/logstash.py +176 -0
  24. elasticsearch9/_async/client/migration.py +160 -0
  25. elasticsearch9/_async/client/ml.py +5835 -0
  26. elasticsearch9/_async/client/monitoring.py +100 -0
  27. elasticsearch9/_async/client/nodes.py +543 -0
  28. elasticsearch9/_async/client/query_rules.py +485 -0
  29. elasticsearch9/_async/client/rollup.py +616 -0
  30. elasticsearch9/_async/client/search_application.py +574 -0
  31. elasticsearch9/_async/client/searchable_snapshots.py +313 -0
  32. elasticsearch9/_async/client/security.py +4688 -0
  33. elasticsearch9/_async/client/shutdown.py +268 -0
  34. elasticsearch9/_async/client/simulate.py +145 -0
  35. elasticsearch9/_async/client/slm.py +559 -0
  36. elasticsearch9/_async/client/snapshot.py +1338 -0
  37. elasticsearch9/_async/client/sql.py +469 -0
  38. elasticsearch9/_async/client/ssl.py +76 -0
  39. elasticsearch9/_async/client/synonyms.py +413 -0
  40. elasticsearch9/_async/client/tasks.py +295 -0
  41. elasticsearch9/_async/client/text_structure.py +664 -0
  42. elasticsearch9/_async/client/transform.py +922 -0
  43. elasticsearch9/_async/client/utils.py +48 -0
  44. elasticsearch9/_async/client/watcher.py +894 -0
  45. elasticsearch9/_async/client/xpack.py +134 -0
  46. elasticsearch9/_async/helpers.py +596 -0
  47. elasticsearch9/_otel.py +110 -0
  48. elasticsearch9/_sync/__init__.py +16 -0
  49. elasticsearch9/_sync/client/__init__.py +6529 -0
  50. elasticsearch9/_sync/client/_base.py +430 -0
  51. elasticsearch9/_sync/client/async_search.py +637 -0
  52. elasticsearch9/_sync/client/autoscaling.py +252 -0
  53. elasticsearch9/_sync/client/cat.py +2995 -0
  54. elasticsearch9/_sync/client/ccr.py +1043 -0
  55. elasticsearch9/_sync/client/cluster.py +1223 -0
  56. elasticsearch9/_sync/client/connector.py +1978 -0
  57. elasticsearch9/_sync/client/dangling_indices.py +192 -0
  58. elasticsearch9/_sync/client/enrich.py +291 -0
  59. elasticsearch9/_sync/client/eql.py +359 -0
  60. elasticsearch9/_sync/client/esql.py +490 -0
  61. elasticsearch9/_sync/client/features.py +130 -0
  62. elasticsearch9/_sync/client/fleet.py +658 -0
  63. elasticsearch9/_sync/client/graph.py +113 -0
  64. elasticsearch9/_sync/client/ilm.py +668 -0
  65. elasticsearch9/_sync/client/indices.py +5582 -0
  66. elasticsearch9/_sync/client/inference.py +2247 -0
  67. elasticsearch9/_sync/client/ingest.py +766 -0
  68. elasticsearch9/_sync/client/license.py +400 -0
  69. elasticsearch9/_sync/client/logstash.py +176 -0
  70. elasticsearch9/_sync/client/migration.py +160 -0
  71. elasticsearch9/_sync/client/ml.py +5835 -0
  72. elasticsearch9/_sync/client/monitoring.py +100 -0
  73. elasticsearch9/_sync/client/nodes.py +543 -0
  74. elasticsearch9/_sync/client/query_rules.py +485 -0
  75. elasticsearch9/_sync/client/rollup.py +616 -0
  76. elasticsearch9/_sync/client/search_application.py +574 -0
  77. elasticsearch9/_sync/client/searchable_snapshots.py +313 -0
  78. elasticsearch9/_sync/client/security.py +4688 -0
  79. elasticsearch9/_sync/client/shutdown.py +268 -0
  80. elasticsearch9/_sync/client/simulate.py +145 -0
  81. elasticsearch9/_sync/client/slm.py +559 -0
  82. elasticsearch9/_sync/client/snapshot.py +1338 -0
  83. elasticsearch9/_sync/client/sql.py +469 -0
  84. elasticsearch9/_sync/client/ssl.py +76 -0
  85. elasticsearch9/_sync/client/synonyms.py +413 -0
  86. elasticsearch9/_sync/client/tasks.py +295 -0
  87. elasticsearch9/_sync/client/text_structure.py +664 -0
  88. elasticsearch9/_sync/client/transform.py +922 -0
  89. elasticsearch9/_sync/client/utils.py +475 -0
  90. elasticsearch9/_sync/client/watcher.py +894 -0
  91. elasticsearch9/_sync/client/xpack.py +134 -0
  92. elasticsearch9/_utils.py +34 -0
  93. elasticsearch9/_version.py +18 -0
  94. elasticsearch9/client.py +126 -0
  95. elasticsearch9/compat.py +79 -0
  96. elasticsearch9/dsl/__init__.py +203 -0
  97. elasticsearch9/dsl/_async/__init__.py +16 -0
  98. elasticsearch9/dsl/_async/document.py +522 -0
  99. elasticsearch9/dsl/_async/faceted_search.py +50 -0
  100. elasticsearch9/dsl/_async/index.py +639 -0
  101. elasticsearch9/dsl/_async/mapping.py +49 -0
  102. elasticsearch9/dsl/_async/search.py +237 -0
  103. elasticsearch9/dsl/_async/update_by_query.py +47 -0
  104. elasticsearch9/dsl/_sync/__init__.py +16 -0
  105. elasticsearch9/dsl/_sync/document.py +514 -0
  106. elasticsearch9/dsl/_sync/faceted_search.py +50 -0
  107. elasticsearch9/dsl/_sync/index.py +597 -0
  108. elasticsearch9/dsl/_sync/mapping.py +49 -0
  109. elasticsearch9/dsl/_sync/search.py +230 -0
  110. elasticsearch9/dsl/_sync/update_by_query.py +45 -0
  111. elasticsearch9/dsl/aggs.py +3734 -0
  112. elasticsearch9/dsl/analysis.py +341 -0
  113. elasticsearch9/dsl/async_connections.py +37 -0
  114. elasticsearch9/dsl/connections.py +142 -0
  115. elasticsearch9/dsl/document.py +20 -0
  116. elasticsearch9/dsl/document_base.py +444 -0
  117. elasticsearch9/dsl/exceptions.py +32 -0
  118. elasticsearch9/dsl/faceted_search.py +28 -0
  119. elasticsearch9/dsl/faceted_search_base.py +489 -0
  120. elasticsearch9/dsl/field.py +4392 -0
  121. elasticsearch9/dsl/function.py +180 -0
  122. elasticsearch9/dsl/index.py +23 -0
  123. elasticsearch9/dsl/index_base.py +178 -0
  124. elasticsearch9/dsl/mapping.py +19 -0
  125. elasticsearch9/dsl/mapping_base.py +219 -0
  126. elasticsearch9/dsl/query.py +2822 -0
  127. elasticsearch9/dsl/response/__init__.py +388 -0
  128. elasticsearch9/dsl/response/aggs.py +100 -0
  129. elasticsearch9/dsl/response/hit.py +53 -0
  130. elasticsearch9/dsl/search.py +20 -0
  131. elasticsearch9/dsl/search_base.py +1053 -0
  132. elasticsearch9/dsl/serializer.py +34 -0
  133. elasticsearch9/dsl/types.py +6453 -0
  134. elasticsearch9/dsl/update_by_query.py +19 -0
  135. elasticsearch9/dsl/update_by_query_base.py +149 -0
  136. elasticsearch9/dsl/utils.py +687 -0
  137. elasticsearch9/dsl/wrappers.py +144 -0
  138. elasticsearch9/exceptions.py +133 -0
  139. elasticsearch9/helpers/__init__.py +41 -0
  140. elasticsearch9/helpers/actions.py +875 -0
  141. elasticsearch9/helpers/errors.py +40 -0
  142. elasticsearch9/helpers/vectorstore/__init__.py +62 -0
  143. elasticsearch9/helpers/vectorstore/_async/__init__.py +16 -0
  144. elasticsearch9/helpers/vectorstore/_async/_utils.py +39 -0
  145. elasticsearch9/helpers/vectorstore/_async/embedding_service.py +89 -0
  146. elasticsearch9/helpers/vectorstore/_async/strategies.py +487 -0
  147. elasticsearch9/helpers/vectorstore/_async/vectorstore.py +421 -0
  148. elasticsearch9/helpers/vectorstore/_sync/__init__.py +16 -0
  149. elasticsearch9/helpers/vectorstore/_sync/_utils.py +39 -0
  150. elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +89 -0
  151. elasticsearch9/helpers/vectorstore/_sync/strategies.py +487 -0
  152. elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +421 -0
  153. elasticsearch9/helpers/vectorstore/_utils.py +116 -0
  154. elasticsearch9/py.typed +0 -0
  155. elasticsearch9/serializer.py +250 -0
  156. elasticsearch9-9.0.0.dist-info/METADATA +175 -0
  157. elasticsearch9-9.0.0.dist-info/RECORD +160 -0
  158. elasticsearch9-9.0.0.dist-info/WHEEL +4 -0
  159. elasticsearch9-9.0.0.dist-info/licenses/LICENSE +176 -0
  160. elasticsearch9-9.0.0.dist-info/licenses/NOTICE +2 -0
@@ -0,0 +1,922 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ import typing as t
19
+
20
+ from elastic_transport import ObjectApiResponse
21
+
22
+ from ._base import NamespacedClient
23
+ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
24
+
25
+
26
+ class TransformClient(NamespacedClient):
27
+
28
+ @_rewrite_parameters()
29
+ async def delete_transform(
30
+ self,
31
+ *,
32
+ transform_id: str,
33
+ delete_dest_index: t.Optional[bool] = None,
34
+ error_trace: t.Optional[bool] = None,
35
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
36
+ force: t.Optional[bool] = None,
37
+ human: t.Optional[bool] = None,
38
+ pretty: t.Optional[bool] = None,
39
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
40
+ ) -> ObjectApiResponse[t.Any]:
41
+ """
42
+ .. raw:: html
43
+
44
+ <p>Delete a transform.</p>
45
+
46
+
47
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-delete-transform>`_
48
+
49
+ :param transform_id: Identifier for the transform.
50
+ :param delete_dest_index: If this value is true, the destination index is deleted
51
+ together with the transform. If false, the destination index will not be
52
+ deleted
53
+ :param force: If this value is false, the transform must be stopped before it
54
+ can be deleted. If true, the transform is deleted regardless of its current
55
+ state.
56
+ :param timeout: Period to wait for a response. If no response is received before
57
+ the timeout expires, the request fails and returns an error.
58
+ """
59
+ if transform_id in SKIP_IN_PATH:
60
+ raise ValueError("Empty value passed for parameter 'transform_id'")
61
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
62
+ __path = f'/_transform/{__path_parts["transform_id"]}'
63
+ __query: t.Dict[str, t.Any] = {}
64
+ if delete_dest_index is not None:
65
+ __query["delete_dest_index"] = delete_dest_index
66
+ if error_trace is not None:
67
+ __query["error_trace"] = error_trace
68
+ if filter_path is not None:
69
+ __query["filter_path"] = filter_path
70
+ if force is not None:
71
+ __query["force"] = force
72
+ if human is not None:
73
+ __query["human"] = human
74
+ if pretty is not None:
75
+ __query["pretty"] = pretty
76
+ if timeout is not None:
77
+ __query["timeout"] = timeout
78
+ __headers = {"accept": "application/json"}
79
+ return await self.perform_request( # type: ignore[return-value]
80
+ "DELETE",
81
+ __path,
82
+ params=__query,
83
+ headers=__headers,
84
+ endpoint_id="transform.delete_transform",
85
+ path_parts=__path_parts,
86
+ )
87
+
88
+ @_rewrite_parameters(
89
+ parameter_aliases={"from": "from_"},
90
+ )
91
+ async def get_transform(
92
+ self,
93
+ *,
94
+ transform_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
95
+ allow_no_match: t.Optional[bool] = None,
96
+ error_trace: t.Optional[bool] = None,
97
+ exclude_generated: t.Optional[bool] = None,
98
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
99
+ from_: t.Optional[int] = None,
100
+ human: t.Optional[bool] = None,
101
+ pretty: t.Optional[bool] = None,
102
+ size: t.Optional[int] = None,
103
+ ) -> ObjectApiResponse[t.Any]:
104
+ """
105
+ .. raw:: html
106
+
107
+ <p>Get transforms.
108
+ Get configuration information for transforms.</p>
109
+
110
+
111
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-get-transform>`_
112
+
113
+ :param transform_id: Identifier for the transform. It can be a transform identifier
114
+ or a wildcard expression. You can get information for all transforms by using
115
+ `_all`, by specifying `*` as the `<transform_id>`, or by omitting the `<transform_id>`.
116
+ :param allow_no_match: Specifies what to do when the request: 1. Contains wildcard
117
+ expressions and there are no transforms that match. 2. Contains the _all
118
+ string or no identifiers and there are no matches. 3. Contains wildcard expressions
119
+ and there are only partial matches. If this parameter is false, the request
120
+ returns a 404 status code when there are no matches or only partial matches.
121
+ :param exclude_generated: Excludes fields that were automatically added when
122
+ creating the transform. This allows the configuration to be in an acceptable
123
+ format to be retrieved and then added to another cluster.
124
+ :param from_: Skips the specified number of transforms.
125
+ :param size: Specifies the maximum number of transforms to obtain.
126
+ """
127
+ __path_parts: t.Dict[str, str]
128
+ if transform_id not in SKIP_IN_PATH:
129
+ __path_parts = {"transform_id": _quote(transform_id)}
130
+ __path = f'/_transform/{__path_parts["transform_id"]}'
131
+ else:
132
+ __path_parts = {}
133
+ __path = "/_transform"
134
+ __query: t.Dict[str, t.Any] = {}
135
+ if allow_no_match is not None:
136
+ __query["allow_no_match"] = allow_no_match
137
+ if error_trace is not None:
138
+ __query["error_trace"] = error_trace
139
+ if exclude_generated is not None:
140
+ __query["exclude_generated"] = exclude_generated
141
+ if filter_path is not None:
142
+ __query["filter_path"] = filter_path
143
+ if from_ is not None:
144
+ __query["from"] = from_
145
+ if human is not None:
146
+ __query["human"] = human
147
+ if pretty is not None:
148
+ __query["pretty"] = pretty
149
+ if size is not None:
150
+ __query["size"] = size
151
+ __headers = {"accept": "application/json"}
152
+ return await self.perform_request( # type: ignore[return-value]
153
+ "GET",
154
+ __path,
155
+ params=__query,
156
+ headers=__headers,
157
+ endpoint_id="transform.get_transform",
158
+ path_parts=__path_parts,
159
+ )
160
+
161
+ @_rewrite_parameters(
162
+ parameter_aliases={"from": "from_"},
163
+ )
164
+ async def get_transform_stats(
165
+ self,
166
+ *,
167
+ transform_id: t.Union[str, t.Sequence[str]],
168
+ allow_no_match: t.Optional[bool] = None,
169
+ error_trace: t.Optional[bool] = None,
170
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
171
+ from_: t.Optional[int] = None,
172
+ human: t.Optional[bool] = None,
173
+ pretty: t.Optional[bool] = None,
174
+ size: t.Optional[int] = None,
175
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
176
+ ) -> ObjectApiResponse[t.Any]:
177
+ """
178
+ .. raw:: html
179
+
180
+ <p>Get transform stats.</p>
181
+ <p>Get usage information for transforms.</p>
182
+
183
+
184
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-get-transform-stats>`_
185
+
186
+ :param transform_id: Identifier for the transform. It can be a transform identifier
187
+ or a wildcard expression. You can get information for all transforms by using
188
+ `_all`, by specifying `*` as the `<transform_id>`, or by omitting the `<transform_id>`.
189
+ :param allow_no_match: Specifies what to do when the request: 1. Contains wildcard
190
+ expressions and there are no transforms that match. 2. Contains the _all
191
+ string or no identifiers and there are no matches. 3. Contains wildcard expressions
192
+ and there are only partial matches. If this parameter is false, the request
193
+ returns a 404 status code when there are no matches or only partial matches.
194
+ :param from_: Skips the specified number of transforms.
195
+ :param size: Specifies the maximum number of transforms to obtain.
196
+ :param timeout: Controls the time to wait for the stats
197
+ """
198
+ if transform_id in SKIP_IN_PATH:
199
+ raise ValueError("Empty value passed for parameter 'transform_id'")
200
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
201
+ __path = f'/_transform/{__path_parts["transform_id"]}/_stats'
202
+ __query: t.Dict[str, t.Any] = {}
203
+ if allow_no_match is not None:
204
+ __query["allow_no_match"] = allow_no_match
205
+ if error_trace is not None:
206
+ __query["error_trace"] = error_trace
207
+ if filter_path is not None:
208
+ __query["filter_path"] = filter_path
209
+ if from_ is not None:
210
+ __query["from"] = from_
211
+ if human is not None:
212
+ __query["human"] = human
213
+ if pretty is not None:
214
+ __query["pretty"] = pretty
215
+ if size is not None:
216
+ __query["size"] = size
217
+ if timeout is not None:
218
+ __query["timeout"] = timeout
219
+ __headers = {"accept": "application/json"}
220
+ return await self.perform_request( # type: ignore[return-value]
221
+ "GET",
222
+ __path,
223
+ params=__query,
224
+ headers=__headers,
225
+ endpoint_id="transform.get_transform_stats",
226
+ path_parts=__path_parts,
227
+ )
228
+
229
+ @_rewrite_parameters(
230
+ body_fields=(
231
+ "description",
232
+ "dest",
233
+ "frequency",
234
+ "latest",
235
+ "pivot",
236
+ "retention_policy",
237
+ "settings",
238
+ "source",
239
+ "sync",
240
+ ),
241
+ )
242
+ async def preview_transform(
243
+ self,
244
+ *,
245
+ transform_id: t.Optional[str] = None,
246
+ description: t.Optional[str] = None,
247
+ dest: t.Optional[t.Mapping[str, t.Any]] = None,
248
+ error_trace: t.Optional[bool] = None,
249
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
250
+ frequency: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
251
+ human: t.Optional[bool] = None,
252
+ latest: t.Optional[t.Mapping[str, t.Any]] = None,
253
+ pivot: t.Optional[t.Mapping[str, t.Any]] = None,
254
+ pretty: t.Optional[bool] = None,
255
+ retention_policy: t.Optional[t.Mapping[str, t.Any]] = None,
256
+ settings: t.Optional[t.Mapping[str, t.Any]] = None,
257
+ source: t.Optional[t.Mapping[str, t.Any]] = None,
258
+ sync: t.Optional[t.Mapping[str, t.Any]] = None,
259
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
260
+ body: t.Optional[t.Dict[str, t.Any]] = None,
261
+ ) -> ObjectApiResponse[t.Any]:
262
+ """
263
+ .. raw:: html
264
+
265
+ <p>Preview a transform.
266
+ Generates a preview of the results that you will get when you create a transform with the same configuration.</p>
267
+ <p>It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
268
+ generates a list of mappings and settings for the destination index. These values are determined based on the field
269
+ types of the source index and the transform aggregations.</p>
270
+
271
+
272
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-preview-transform>`_
273
+
274
+ :param transform_id: Identifier for the transform to preview. If you specify
275
+ this path parameter, you cannot provide transform configuration details in
276
+ the request body.
277
+ :param description: Free text description of the transform.
278
+ :param dest: The destination for the transform.
279
+ :param frequency: The interval between checks for changes in the source indices
280
+ when the transform is running continuously. Also determines the retry interval
281
+ in the event of transient failures while the transform is searching or indexing.
282
+ The minimum value is 1s and the maximum is 1h.
283
+ :param latest: The latest method transforms the data by finding the latest document
284
+ for each unique key.
285
+ :param pivot: The pivot method transforms the data by aggregating and grouping
286
+ it. These objects define the group by fields and the aggregation to reduce
287
+ the data.
288
+ :param retention_policy: Defines a retention policy for the transform. Data that
289
+ meets the defined criteria is deleted from the destination index.
290
+ :param settings: Defines optional transform settings.
291
+ :param source: The source of the data for the transform.
292
+ :param sync: Defines the properties transforms require to run continuously.
293
+ :param timeout: Period to wait for a response. If no response is received before
294
+ the timeout expires, the request fails and returns an error.
295
+ """
296
+ __path_parts: t.Dict[str, str]
297
+ if transform_id not in SKIP_IN_PATH:
298
+ __path_parts = {"transform_id": _quote(transform_id)}
299
+ __path = f'/_transform/{__path_parts["transform_id"]}/_preview'
300
+ else:
301
+ __path_parts = {}
302
+ __path = "/_transform/_preview"
303
+ __query: t.Dict[str, t.Any] = {}
304
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
305
+ if error_trace is not None:
306
+ __query["error_trace"] = error_trace
307
+ if filter_path is not None:
308
+ __query["filter_path"] = filter_path
309
+ if human is not None:
310
+ __query["human"] = human
311
+ if pretty is not None:
312
+ __query["pretty"] = pretty
313
+ if timeout is not None:
314
+ __query["timeout"] = timeout
315
+ if not __body:
316
+ if description is not None:
317
+ __body["description"] = description
318
+ if dest is not None:
319
+ __body["dest"] = dest
320
+ if frequency is not None:
321
+ __body["frequency"] = frequency
322
+ if latest is not None:
323
+ __body["latest"] = latest
324
+ if pivot is not None:
325
+ __body["pivot"] = pivot
326
+ if retention_policy is not None:
327
+ __body["retention_policy"] = retention_policy
328
+ if settings is not None:
329
+ __body["settings"] = settings
330
+ if source is not None:
331
+ __body["source"] = source
332
+ if sync is not None:
333
+ __body["sync"] = sync
334
+ if not __body:
335
+ __body = None # type: ignore[assignment]
336
+ __headers = {"accept": "application/json"}
337
+ if __body is not None:
338
+ __headers["content-type"] = "application/json"
339
+ return await self.perform_request( # type: ignore[return-value]
340
+ "POST",
341
+ __path,
342
+ params=__query,
343
+ headers=__headers,
344
+ body=__body,
345
+ endpoint_id="transform.preview_transform",
346
+ path_parts=__path_parts,
347
+ )
348
+
349
+ @_rewrite_parameters(
350
+ body_fields=(
351
+ "dest",
352
+ "source",
353
+ "description",
354
+ "frequency",
355
+ "latest",
356
+ "meta",
357
+ "pivot",
358
+ "retention_policy",
359
+ "settings",
360
+ "sync",
361
+ ),
362
+ parameter_aliases={"_meta": "meta"},
363
+ )
364
+ async def put_transform(
365
+ self,
366
+ *,
367
+ transform_id: str,
368
+ dest: t.Optional[t.Mapping[str, t.Any]] = None,
369
+ source: t.Optional[t.Mapping[str, t.Any]] = None,
370
+ defer_validation: t.Optional[bool] = None,
371
+ description: t.Optional[str] = None,
372
+ error_trace: t.Optional[bool] = None,
373
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
374
+ frequency: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
375
+ human: t.Optional[bool] = None,
376
+ latest: t.Optional[t.Mapping[str, t.Any]] = None,
377
+ meta: t.Optional[t.Mapping[str, t.Any]] = None,
378
+ pivot: t.Optional[t.Mapping[str, t.Any]] = None,
379
+ pretty: t.Optional[bool] = None,
380
+ retention_policy: t.Optional[t.Mapping[str, t.Any]] = None,
381
+ settings: t.Optional[t.Mapping[str, t.Any]] = None,
382
+ sync: t.Optional[t.Mapping[str, t.Any]] = None,
383
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
384
+ body: t.Optional[t.Dict[str, t.Any]] = None,
385
+ ) -> ObjectApiResponse[t.Any]:
386
+ """
387
+ .. raw:: html
388
+
389
+ <p>Create a transform.
390
+ Creates a transform.</p>
391
+ <p>A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
392
+ a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
393
+ unique row per entity.</p>
394
+ <p>You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
395
+ you choose to use the pivot method for your transform, the entities are defined by the set of <code>group_by</code> fields in
396
+ the pivot object. If you choose to use the latest method, the entities are defined by the <code>unique_key</code> field values
397
+ in the latest object.</p>
398
+ <p>You must have <code>create_index</code>, <code>index</code>, and <code>read</code> privileges on the destination index and <code>read</code> and
399
+ <code>view_index_metadata</code> privileges on the source indices. When Elasticsearch security features are enabled, the
400
+ transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
401
+ those roles do not have the required privileges on the source and destination indices, the transform fails when it
402
+ attempts unauthorized operations.</p>
403
+ <p>NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
404
+ <code>.transform-internal*</code> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
405
+ not give users any privileges on <code>.transform-internal*</code> indices. If you used transforms prior to 7.5, also do not
406
+ give users any privileges on <code>.data-frame-internal*</code> indices.</p>
407
+
408
+
409
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-put-transform>`_
410
+
411
+ :param transform_id: Identifier for the transform. This identifier can contain
412
+ lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
413
+ It has a 64 character limit and must start and end with alphanumeric characters.
414
+ :param dest: The destination for the transform.
415
+ :param source: The source of the data for the transform.
416
+ :param defer_validation: When the transform is created, a series of validations
417
+ occur to ensure its success. For example, there is a check for the existence
418
+ of the source indices and a check that the destination index is not part
419
+ of the source index pattern. You can use this parameter to skip the checks,
420
+ for example when the source index does not exist until after the transform
421
+ is created. The validations are always run when you start the transform,
422
+ however, with the exception of privilege checks.
423
+ :param description: Free text description of the transform.
424
+ :param frequency: The interval between checks for changes in the source indices
425
+ when the transform is running continuously. Also determines the retry interval
426
+ in the event of transient failures while the transform is searching or indexing.
427
+ The minimum value is `1s` and the maximum is `1h`.
428
+ :param latest: The latest method transforms the data by finding the latest document
429
+ for each unique key.
430
+ :param meta: Defines optional transform metadata.
431
+ :param pivot: The pivot method transforms the data by aggregating and grouping
432
+ it. These objects define the group by fields and the aggregation to reduce
433
+ the data.
434
+ :param retention_policy: Defines a retention policy for the transform. Data that
435
+ meets the defined criteria is deleted from the destination index.
436
+ :param settings: Defines optional transform settings.
437
+ :param sync: Defines the properties transforms require to run continuously.
438
+ :param timeout: Period to wait for a response. If no response is received before
439
+ the timeout expires, the request fails and returns an error.
440
+ """
441
+ if transform_id in SKIP_IN_PATH:
442
+ raise ValueError("Empty value passed for parameter 'transform_id'")
443
+ if dest is None and body is None:
444
+ raise ValueError("Empty value passed for parameter 'dest'")
445
+ if source is None and body is None:
446
+ raise ValueError("Empty value passed for parameter 'source'")
447
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
448
+ __path = f'/_transform/{__path_parts["transform_id"]}'
449
+ __query: t.Dict[str, t.Any] = {}
450
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
451
+ if defer_validation is not None:
452
+ __query["defer_validation"] = defer_validation
453
+ if error_trace is not None:
454
+ __query["error_trace"] = error_trace
455
+ if filter_path is not None:
456
+ __query["filter_path"] = filter_path
457
+ if human is not None:
458
+ __query["human"] = human
459
+ if pretty is not None:
460
+ __query["pretty"] = pretty
461
+ if timeout is not None:
462
+ __query["timeout"] = timeout
463
+ if not __body:
464
+ if dest is not None:
465
+ __body["dest"] = dest
466
+ if source is not None:
467
+ __body["source"] = source
468
+ if description is not None:
469
+ __body["description"] = description
470
+ if frequency is not None:
471
+ __body["frequency"] = frequency
472
+ if latest is not None:
473
+ __body["latest"] = latest
474
+ if meta is not None:
475
+ __body["_meta"] = meta
476
+ if pivot is not None:
477
+ __body["pivot"] = pivot
478
+ if retention_policy is not None:
479
+ __body["retention_policy"] = retention_policy
480
+ if settings is not None:
481
+ __body["settings"] = settings
482
+ if sync is not None:
483
+ __body["sync"] = sync
484
+ __headers = {"accept": "application/json", "content-type": "application/json"}
485
+ return await self.perform_request( # type: ignore[return-value]
486
+ "PUT",
487
+ __path,
488
+ params=__query,
489
+ headers=__headers,
490
+ body=__body,
491
+ endpoint_id="transform.put_transform",
492
+ path_parts=__path_parts,
493
+ )
494
+
495
+ @_rewrite_parameters()
496
+ async def reset_transform(
497
+ self,
498
+ *,
499
+ transform_id: str,
500
+ error_trace: t.Optional[bool] = None,
501
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
502
+ force: t.Optional[bool] = None,
503
+ human: t.Optional[bool] = None,
504
+ pretty: t.Optional[bool] = None,
505
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
506
+ ) -> ObjectApiResponse[t.Any]:
507
+ """
508
+ .. raw:: html
509
+
510
+ <p>Reset a transform.</p>
511
+ <p>Before you can reset it, you must stop it; alternatively, use the <code>force</code> query parameter.
512
+ If the destination index was created by the transform, it is deleted.</p>
513
+
514
+
515
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-reset-transform>`_
516
+
517
+ :param transform_id: Identifier for the transform. This identifier can contain
518
+ lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
519
+ It has a 64 character limit and must start and end with alphanumeric characters.
520
+ :param force: If this value is `true`, the transform is reset regardless of its
521
+ current state. If it's `false`, the transform must be stopped before it can
522
+ be reset.
523
+ :param timeout: Period to wait for a response. If no response is received before
524
+ the timeout expires, the request fails and returns an error.
525
+ """
526
+ if transform_id in SKIP_IN_PATH:
527
+ raise ValueError("Empty value passed for parameter 'transform_id'")
528
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
529
+ __path = f'/_transform/{__path_parts["transform_id"]}/_reset'
530
+ __query: t.Dict[str, t.Any] = {}
531
+ if error_trace is not None:
532
+ __query["error_trace"] = error_trace
533
+ if filter_path is not None:
534
+ __query["filter_path"] = filter_path
535
+ if force is not None:
536
+ __query["force"] = force
537
+ if human is not None:
538
+ __query["human"] = human
539
+ if pretty is not None:
540
+ __query["pretty"] = pretty
541
+ if timeout is not None:
542
+ __query["timeout"] = timeout
543
+ __headers = {"accept": "application/json"}
544
+ return await self.perform_request( # type: ignore[return-value]
545
+ "POST",
546
+ __path,
547
+ params=__query,
548
+ headers=__headers,
549
+ endpoint_id="transform.reset_transform",
550
+ path_parts=__path_parts,
551
+ )
552
+
553
+ @_rewrite_parameters()
554
+ async def schedule_now_transform(
555
+ self,
556
+ *,
557
+ transform_id: str,
558
+ error_trace: t.Optional[bool] = None,
559
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
560
+ human: t.Optional[bool] = None,
561
+ pretty: t.Optional[bool] = None,
562
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
563
+ ) -> ObjectApiResponse[t.Any]:
564
+ """
565
+ .. raw:: html
566
+
567
+ <p>Schedule a transform to start now.</p>
568
+ <p>Instantly run a transform to process data.
569
+ If you run this API, the transform will process the new data instantly,
570
+ without waiting for the configured frequency interval. After the API is called,
571
+ the transform will be processed again at <code>now + frequency</code> unless the API
572
+ is called again in the meantime.</p>
573
+
574
+
575
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-schedule-now-transform>`_
576
+
577
+ :param transform_id: Identifier for the transform.
578
+ :param timeout: Controls the time to wait for the scheduling to take place
579
+ """
580
+ if transform_id in SKIP_IN_PATH:
581
+ raise ValueError("Empty value passed for parameter 'transform_id'")
582
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
583
+ __path = f'/_transform/{__path_parts["transform_id"]}/_schedule_now'
584
+ __query: t.Dict[str, t.Any] = {}
585
+ if error_trace is not None:
586
+ __query["error_trace"] = error_trace
587
+ if filter_path is not None:
588
+ __query["filter_path"] = filter_path
589
+ if human is not None:
590
+ __query["human"] = human
591
+ if pretty is not None:
592
+ __query["pretty"] = pretty
593
+ if timeout is not None:
594
+ __query["timeout"] = timeout
595
+ __headers = {"accept": "application/json"}
596
+ return await self.perform_request( # type: ignore[return-value]
597
+ "POST",
598
+ __path,
599
+ params=__query,
600
+ headers=__headers,
601
+ endpoint_id="transform.schedule_now_transform",
602
+ path_parts=__path_parts,
603
+ )
604
+
605
+ @_rewrite_parameters(
606
+ parameter_aliases={"from": "from_"},
607
+ )
608
+ async def start_transform(
609
+ self,
610
+ *,
611
+ transform_id: str,
612
+ error_trace: t.Optional[bool] = None,
613
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
614
+ from_: t.Optional[str] = None,
615
+ human: t.Optional[bool] = None,
616
+ pretty: t.Optional[bool] = None,
617
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
618
+ ) -> ObjectApiResponse[t.Any]:
619
+ """
620
+ .. raw:: html
621
+
622
+ <p>Start a transform.</p>
623
+ <p>When you start a transform, it creates the destination index if it does not already exist. The <code>number_of_shards</code> is
624
+ set to <code>1</code> and the <code>auto_expand_replicas</code> is set to <code>0-1</code>. If it is a pivot transform, it deduces the mapping
625
+ definitions for the destination index from the source indices and the transform aggregations. If fields in the
626
+ destination index are derived from scripts (as in the case of <code>scripted_metric</code> or <code>bucket_script</code> aggregations),
627
+ the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
628
+ mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
629
+ start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
630
+ in a pivot transform.</p>
631
+ <p>When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
632
+ created the transform, they occur when you start the transform—​with the exception of privilege checks. When
633
+ Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
634
+ time of creation and uses those same roles. If those roles do not have the required privileges on the source and
635
+ destination indices, the transform fails when it attempts unauthorized operations.</p>
636
+
637
+
638
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-start-transform>`_
639
+
640
+ :param transform_id: Identifier for the transform.
641
+ :param from_: Restricts the set of transformed entities to those changed after
642
+ this time. Relative times like now-30d are supported. Only applicable for
643
+ continuous transforms.
644
+ :param timeout: Period to wait for a response. If no response is received before
645
+ the timeout expires, the request fails and returns an error.
646
+ """
647
+ if transform_id in SKIP_IN_PATH:
648
+ raise ValueError("Empty value passed for parameter 'transform_id'")
649
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
650
+ __path = f'/_transform/{__path_parts["transform_id"]}/_start'
651
+ __query: t.Dict[str, t.Any] = {}
652
+ if error_trace is not None:
653
+ __query["error_trace"] = error_trace
654
+ if filter_path is not None:
655
+ __query["filter_path"] = filter_path
656
+ if from_ is not None:
657
+ __query["from"] = from_
658
+ if human is not None:
659
+ __query["human"] = human
660
+ if pretty is not None:
661
+ __query["pretty"] = pretty
662
+ if timeout is not None:
663
+ __query["timeout"] = timeout
664
+ __headers = {"accept": "application/json"}
665
+ return await self.perform_request( # type: ignore[return-value]
666
+ "POST",
667
+ __path,
668
+ params=__query,
669
+ headers=__headers,
670
+ endpoint_id="transform.start_transform",
671
+ path_parts=__path_parts,
672
+ )
673
+
674
+ @_rewrite_parameters()
675
+ async def stop_transform(
676
+ self,
677
+ *,
678
+ transform_id: str,
679
+ allow_no_match: t.Optional[bool] = None,
680
+ error_trace: t.Optional[bool] = None,
681
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
682
+ force: t.Optional[bool] = None,
683
+ human: t.Optional[bool] = None,
684
+ pretty: t.Optional[bool] = None,
685
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
686
+ wait_for_checkpoint: t.Optional[bool] = None,
687
+ wait_for_completion: t.Optional[bool] = None,
688
+ ) -> ObjectApiResponse[t.Any]:
689
+ """
690
+ .. raw:: html
691
+
692
+ <p>Stop transforms.
693
+ Stops one or more transforms.</p>
694
+
695
+
696
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-stop-transform>`_
697
+
698
+ :param transform_id: Identifier for the transform. To stop multiple transforms,
699
+ use a comma-separated list or a wildcard expression. To stop all transforms,
700
+ use `_all` or `*` as the identifier.
701
+ :param allow_no_match: Specifies what to do when the request: contains wildcard
702
+ expressions and there are no transforms that match; contains the `_all` string
703
+ or no identifiers and there are no matches; contains wildcard expressions
704
+ and there are only partial matches. If it is true, the API returns a successful
705
+ acknowledgement message when there are no matches. When there are only partial
706
+ matches, the API stops the appropriate transforms. If it is false, the request
707
+ returns a 404 status code when there are no matches or only partial matches.
708
+ :param force: If it is true, the API forcefully stops the transforms.
709
+ :param timeout: Period to wait for a response when `wait_for_completion` is `true`.
710
+ If no response is received before the timeout expires, the request returns
711
+ a timeout exception. However, the request continues processing and eventually
712
+ moves the transform to a STOPPED state.
713
+ :param wait_for_checkpoint: If it is true, the transform does not completely
714
+ stop until the current checkpoint is completed. If it is false, the transform
715
+ stops as soon as possible.
716
+ :param wait_for_completion: If it is true, the API blocks until the indexer state
717
+ completely stops. If it is false, the API returns immediately and the indexer
718
+ is stopped asynchronously in the background.
719
+ """
720
+ if transform_id in SKIP_IN_PATH:
721
+ raise ValueError("Empty value passed for parameter 'transform_id'")
722
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
723
+ __path = f'/_transform/{__path_parts["transform_id"]}/_stop'
724
+ __query: t.Dict[str, t.Any] = {}
725
+ if allow_no_match is not None:
726
+ __query["allow_no_match"] = allow_no_match
727
+ if error_trace is not None:
728
+ __query["error_trace"] = error_trace
729
+ if filter_path is not None:
730
+ __query["filter_path"] = filter_path
731
+ if force is not None:
732
+ __query["force"] = force
733
+ if human is not None:
734
+ __query["human"] = human
735
+ if pretty is not None:
736
+ __query["pretty"] = pretty
737
+ if timeout is not None:
738
+ __query["timeout"] = timeout
739
+ if wait_for_checkpoint is not None:
740
+ __query["wait_for_checkpoint"] = wait_for_checkpoint
741
+ if wait_for_completion is not None:
742
+ __query["wait_for_completion"] = wait_for_completion
743
+ __headers = {"accept": "application/json"}
744
+ return await self.perform_request( # type: ignore[return-value]
745
+ "POST",
746
+ __path,
747
+ params=__query,
748
+ headers=__headers,
749
+ endpoint_id="transform.stop_transform",
750
+ path_parts=__path_parts,
751
+ )
752
+
753
+ @_rewrite_parameters(
754
+ body_fields=(
755
+ "description",
756
+ "dest",
757
+ "frequency",
758
+ "meta",
759
+ "retention_policy",
760
+ "settings",
761
+ "source",
762
+ "sync",
763
+ ),
764
+ parameter_aliases={"_meta": "meta"},
765
+ )
766
+ async def update_transform(
767
+ self,
768
+ *,
769
+ transform_id: str,
770
+ defer_validation: t.Optional[bool] = None,
771
+ description: t.Optional[str] = None,
772
+ dest: t.Optional[t.Mapping[str, t.Any]] = None,
773
+ error_trace: t.Optional[bool] = None,
774
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
775
+ frequency: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
776
+ human: t.Optional[bool] = None,
777
+ meta: t.Optional[t.Mapping[str, t.Any]] = None,
778
+ pretty: t.Optional[bool] = None,
779
+ retention_policy: t.Optional[t.Union[None, t.Mapping[str, t.Any]]] = None,
780
+ settings: t.Optional[t.Mapping[str, t.Any]] = None,
781
+ source: t.Optional[t.Mapping[str, t.Any]] = None,
782
+ sync: t.Optional[t.Mapping[str, t.Any]] = None,
783
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
784
+ body: t.Optional[t.Dict[str, t.Any]] = None,
785
+ ) -> ObjectApiResponse[t.Any]:
786
+ """
787
+ .. raw:: html
788
+
789
+ <p>Update a transform.
790
+ Updates certain properties of a transform.</p>
791
+ <p>All updated properties except <code>description</code> do not take effect until after the transform starts the next checkpoint,
792
+ thus there is data consistency in each checkpoint. To use this API, you must have <code>read</code> and <code>view_index_metadata</code>
793
+ privileges for the source indices. You must also have <code>index</code> and <code>read</code> privileges for the destination index. When
794
+ Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
795
+ time of update and runs with those privileges.</p>
796
+
797
+
798
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-update-transform>`_
799
+
800
+ :param transform_id: Identifier for the transform.
801
+ :param defer_validation: When true, deferrable validations are not run. This
802
+ behavior may be desired if the source index does not exist until after the
803
+ transform is created.
804
+ :param description: Free text description of the transform.
805
+ :param dest: The destination for the transform.
806
+ :param frequency: The interval between checks for changes in the source indices
807
+ when the transform is running continuously. Also determines the retry interval
808
+ in the event of transient failures while the transform is searching or indexing.
809
+ The minimum value is 1s and the maximum is 1h.
810
+ :param meta: Defines optional transform metadata.
811
+ :param retention_policy: Defines a retention policy for the transform. Data that
812
+ meets the defined criteria is deleted from the destination index.
813
+ :param settings: Defines optional transform settings.
814
+ :param source: The source of the data for the transform.
815
+ :param sync: Defines the properties transforms require to run continuously.
816
+ :param timeout: Period to wait for a response. If no response is received before
817
+ the timeout expires, the request fails and returns an error.
818
+ """
819
+ if transform_id in SKIP_IN_PATH:
820
+ raise ValueError("Empty value passed for parameter 'transform_id'")
821
+ __path_parts: t.Dict[str, str] = {"transform_id": _quote(transform_id)}
822
+ __path = f'/_transform/{__path_parts["transform_id"]}/_update'
823
+ __query: t.Dict[str, t.Any] = {}
824
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
825
+ if defer_validation is not None:
826
+ __query["defer_validation"] = defer_validation
827
+ if error_trace is not None:
828
+ __query["error_trace"] = error_trace
829
+ if filter_path is not None:
830
+ __query["filter_path"] = filter_path
831
+ if human is not None:
832
+ __query["human"] = human
833
+ if pretty is not None:
834
+ __query["pretty"] = pretty
835
+ if timeout is not None:
836
+ __query["timeout"] = timeout
837
+ if not __body:
838
+ if description is not None:
839
+ __body["description"] = description
840
+ if dest is not None:
841
+ __body["dest"] = dest
842
+ if frequency is not None:
843
+ __body["frequency"] = frequency
844
+ if meta is not None:
845
+ __body["_meta"] = meta
846
+ if retention_policy is not None:
847
+ __body["retention_policy"] = retention_policy
848
+ if settings is not None:
849
+ __body["settings"] = settings
850
+ if source is not None:
851
+ __body["source"] = source
852
+ if sync is not None:
853
+ __body["sync"] = sync
854
+ __headers = {"accept": "application/json", "content-type": "application/json"}
855
+ return await self.perform_request( # type: ignore[return-value]
856
+ "POST",
857
+ __path,
858
+ params=__query,
859
+ headers=__headers,
860
+ body=__body,
861
+ endpoint_id="transform.update_transform",
862
+ path_parts=__path_parts,
863
+ )
864
+
865
+ @_rewrite_parameters()
866
+ async def upgrade_transforms(
867
+ self,
868
+ *,
869
+ dry_run: t.Optional[bool] = None,
870
+ error_trace: t.Optional[bool] = None,
871
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
872
+ human: t.Optional[bool] = None,
873
+ pretty: t.Optional[bool] = None,
874
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
875
+ ) -> ObjectApiResponse[t.Any]:
876
+ """
877
+ .. raw:: html
878
+
879
+ <p>Upgrade all transforms.</p>
880
+ <p>Transforms are compatible across minor versions and between supported major versions.
881
+ However, over time, the format of transform configuration information may change.
882
+ This API identifies transforms that have a legacy configuration format and upgrades them to the latest version.
883
+ It also cleans up the internal data structures that store the transform state and checkpoints.
884
+ The upgrade does not affect the source and destination indices.
885
+ The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged.</p>
886
+ <p>If a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue.
887
+ Resolve the issue then re-run the process again.
888
+ A summary is returned when the upgrade is finished.</p>
889
+ <p>To ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster.
890
+ You may want to perform a recent cluster backup prior to the upgrade.</p>
891
+
892
+
893
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-transform-upgrade-transforms>`_
894
+
895
+ :param dry_run: When true, the request checks for updates but does not run them.
896
+ :param timeout: Period to wait for a response. If no response is received before
897
+ the timeout expires, the request fails and returns an error.
898
+ """
899
+ __path_parts: t.Dict[str, str] = {}
900
+ __path = "/_transform/_upgrade"
901
+ __query: t.Dict[str, t.Any] = {}
902
+ if dry_run is not None:
903
+ __query["dry_run"] = dry_run
904
+ if error_trace is not None:
905
+ __query["error_trace"] = error_trace
906
+ if filter_path is not None:
907
+ __query["filter_path"] = filter_path
908
+ if human is not None:
909
+ __query["human"] = human
910
+ if pretty is not None:
911
+ __query["pretty"] = pretty
912
+ if timeout is not None:
913
+ __query["timeout"] = timeout
914
+ __headers = {"accept": "application/json"}
915
+ return await self.perform_request( # type: ignore[return-value]
916
+ "POST",
917
+ __path,
918
+ params=__query,
919
+ headers=__headers,
920
+ endpoint_id="transform.upgrade_transforms",
921
+ path_parts=__path_parts,
922
+ )