elasticsearch 8.17.1__py3-none-any.whl → 8.18.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 (139) hide show
  1. elasticsearch/__init__.py +2 -2
  2. elasticsearch/_async/client/__init__.py +2146 -859
  3. elasticsearch/_async/client/_base.py +0 -1
  4. elasticsearch/_async/client/async_search.py +44 -29
  5. elasticsearch/_async/client/autoscaling.py +32 -26
  6. elasticsearch/_async/client/cat.py +244 -169
  7. elasticsearch/_async/client/ccr.py +268 -128
  8. elasticsearch/_async/client/cluster.py +191 -164
  9. elasticsearch/_async/client/connector.py +212 -116
  10. elasticsearch/_async/client/dangling_indices.py +22 -16
  11. elasticsearch/_async/client/enrich.py +51 -11
  12. elasticsearch/_async/client/eql.py +54 -13
  13. elasticsearch/_async/client/esql.py +352 -4
  14. elasticsearch/_async/client/features.py +37 -27
  15. elasticsearch/_async/client/fleet.py +22 -10
  16. elasticsearch/_async/client/graph.py +10 -9
  17. elasticsearch/_async/client/ilm.py +108 -77
  18. elasticsearch/_async/client/indices.py +1112 -677
  19. elasticsearch/_async/client/inference.py +1875 -133
  20. elasticsearch/_async/client/ingest.py +83 -50
  21. elasticsearch/_async/client/license.py +90 -38
  22. elasticsearch/_async/client/logstash.py +20 -9
  23. elasticsearch/_async/client/migration.py +26 -17
  24. elasticsearch/_async/client/ml.py +642 -365
  25. elasticsearch/_async/client/monitoring.py +6 -3
  26. elasticsearch/_async/client/nodes.py +51 -53
  27. elasticsearch/_async/client/query_rules.py +59 -33
  28. elasticsearch/_async/client/rollup.py +124 -86
  29. elasticsearch/_async/client/search_application.py +60 -32
  30. elasticsearch/_async/client/searchable_snapshots.py +25 -12
  31. elasticsearch/_async/client/security.py +896 -558
  32. elasticsearch/_async/client/shutdown.py +34 -36
  33. elasticsearch/_async/client/simulate.py +22 -28
  34. elasticsearch/_async/client/slm.py +65 -40
  35. elasticsearch/_async/client/snapshot.py +190 -213
  36. elasticsearch/_async/client/sql.py +43 -22
  37. elasticsearch/_async/client/ssl.py +17 -18
  38. elasticsearch/_async/client/synonyms.py +58 -37
  39. elasticsearch/_async/client/tasks.py +77 -48
  40. elasticsearch/_async/client/text_structure.py +65 -56
  41. elasticsearch/_async/client/transform.py +124 -93
  42. elasticsearch/_async/client/watcher.py +116 -72
  43. elasticsearch/_async/client/xpack.py +18 -9
  44. elasticsearch/_async/helpers.py +1 -2
  45. elasticsearch/_sync/client/__init__.py +2146 -859
  46. elasticsearch/_sync/client/_base.py +0 -1
  47. elasticsearch/_sync/client/async_search.py +44 -29
  48. elasticsearch/_sync/client/autoscaling.py +32 -26
  49. elasticsearch/_sync/client/cat.py +244 -169
  50. elasticsearch/_sync/client/ccr.py +268 -128
  51. elasticsearch/_sync/client/cluster.py +191 -164
  52. elasticsearch/_sync/client/connector.py +212 -116
  53. elasticsearch/_sync/client/dangling_indices.py +22 -16
  54. elasticsearch/_sync/client/enrich.py +51 -11
  55. elasticsearch/_sync/client/eql.py +54 -13
  56. elasticsearch/_sync/client/esql.py +352 -4
  57. elasticsearch/_sync/client/features.py +37 -27
  58. elasticsearch/_sync/client/fleet.py +22 -10
  59. elasticsearch/_sync/client/graph.py +10 -9
  60. elasticsearch/_sync/client/ilm.py +108 -77
  61. elasticsearch/_sync/client/indices.py +1112 -677
  62. elasticsearch/_sync/client/inference.py +1875 -133
  63. elasticsearch/_sync/client/ingest.py +83 -50
  64. elasticsearch/_sync/client/license.py +90 -38
  65. elasticsearch/_sync/client/logstash.py +20 -9
  66. elasticsearch/_sync/client/migration.py +26 -17
  67. elasticsearch/_sync/client/ml.py +642 -365
  68. elasticsearch/_sync/client/monitoring.py +6 -3
  69. elasticsearch/_sync/client/nodes.py +51 -53
  70. elasticsearch/_sync/client/query_rules.py +59 -33
  71. elasticsearch/_sync/client/rollup.py +124 -86
  72. elasticsearch/_sync/client/search_application.py +60 -32
  73. elasticsearch/_sync/client/searchable_snapshots.py +25 -12
  74. elasticsearch/_sync/client/security.py +896 -558
  75. elasticsearch/_sync/client/shutdown.py +34 -36
  76. elasticsearch/_sync/client/simulate.py +22 -28
  77. elasticsearch/_sync/client/slm.py +65 -40
  78. elasticsearch/_sync/client/snapshot.py +190 -213
  79. elasticsearch/_sync/client/sql.py +43 -22
  80. elasticsearch/_sync/client/ssl.py +17 -18
  81. elasticsearch/_sync/client/synonyms.py +58 -37
  82. elasticsearch/_sync/client/tasks.py +77 -48
  83. elasticsearch/_sync/client/text_structure.py +65 -56
  84. elasticsearch/_sync/client/transform.py +124 -93
  85. elasticsearch/_sync/client/utils.py +1 -4
  86. elasticsearch/_sync/client/watcher.py +116 -72
  87. elasticsearch/_sync/client/xpack.py +18 -9
  88. elasticsearch/_version.py +1 -1
  89. elasticsearch/client.py +2 -0
  90. elasticsearch/dsl/__init__.py +203 -0
  91. elasticsearch/dsl/_async/__init__.py +16 -0
  92. elasticsearch/dsl/_async/document.py +522 -0
  93. elasticsearch/dsl/_async/faceted_search.py +50 -0
  94. elasticsearch/dsl/_async/index.py +639 -0
  95. elasticsearch/dsl/_async/mapping.py +49 -0
  96. elasticsearch/dsl/_async/search.py +233 -0
  97. elasticsearch/dsl/_async/update_by_query.py +47 -0
  98. elasticsearch/dsl/_sync/__init__.py +16 -0
  99. elasticsearch/dsl/_sync/document.py +514 -0
  100. elasticsearch/dsl/_sync/faceted_search.py +50 -0
  101. elasticsearch/dsl/_sync/index.py +597 -0
  102. elasticsearch/dsl/_sync/mapping.py +49 -0
  103. elasticsearch/dsl/_sync/search.py +226 -0
  104. elasticsearch/dsl/_sync/update_by_query.py +45 -0
  105. elasticsearch/dsl/aggs.py +3730 -0
  106. elasticsearch/dsl/analysis.py +341 -0
  107. elasticsearch/dsl/async_connections.py +37 -0
  108. elasticsearch/dsl/connections.py +142 -0
  109. elasticsearch/dsl/document.py +20 -0
  110. elasticsearch/dsl/document_base.py +444 -0
  111. elasticsearch/dsl/exceptions.py +32 -0
  112. elasticsearch/dsl/faceted_search.py +28 -0
  113. elasticsearch/dsl/faceted_search_base.py +489 -0
  114. elasticsearch/dsl/field.py +4254 -0
  115. elasticsearch/dsl/function.py +180 -0
  116. elasticsearch/dsl/index.py +23 -0
  117. elasticsearch/dsl/index_base.py +178 -0
  118. elasticsearch/dsl/mapping.py +19 -0
  119. elasticsearch/dsl/mapping_base.py +219 -0
  120. elasticsearch/dsl/query.py +2816 -0
  121. elasticsearch/dsl/response/__init__.py +388 -0
  122. elasticsearch/dsl/response/aggs.py +100 -0
  123. elasticsearch/dsl/response/hit.py +53 -0
  124. elasticsearch/dsl/search.py +20 -0
  125. elasticsearch/dsl/search_base.py +1040 -0
  126. elasticsearch/dsl/serializer.py +34 -0
  127. elasticsearch/dsl/types.py +6471 -0
  128. elasticsearch/dsl/update_by_query.py +19 -0
  129. elasticsearch/dsl/update_by_query_base.py +149 -0
  130. elasticsearch/dsl/utils.py +687 -0
  131. elasticsearch/dsl/wrappers.py +119 -0
  132. elasticsearch/helpers/actions.py +1 -1
  133. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
  134. {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/METADATA +12 -2
  135. elasticsearch-8.18.0.dist-info/RECORD +161 -0
  136. elasticsearch-8.17.1.dist-info/RECORD +0 -119
  137. {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/WHEEL +0 -0
  138. {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/LICENSE +0 -0
  139. {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/NOTICE +0 -0
@@ -53,24 +53,26 @@ class TextStructureClient(NamespacedClient):
53
53
  timestamp_format: t.Optional[str] = None,
54
54
  ) -> ObjectApiResponse[t.Any]:
55
55
  """
56
- Find the structure of a text field. Find the structure of a text field in an
57
- Elasticsearch index. This API provides a starting point for extracting further
58
- information from log messages already ingested into Elasticsearch. For example,
59
- if you have ingested data into a very simple index that has just `@timestamp`
60
- and message fields, you can use this API to see what common structure exists
61
- in the message field. The response from the API contains: * Sample messages.
62
- * Statistics that reveal the most common values for all fields detected within
63
- the text and basic numeric statistics for numeric fields. * Information about
64
- the structure of the text, which is useful when you write ingest configurations
65
- to index it or similarly formatted text. * Appropriate mappings for an Elasticsearch
66
- index, which you could use to ingest the text. All this information can be calculated
67
- by the structure finder with no guidance. However, you can optionally override
68
- some of the decisions about the text structure by specifying one or more query
69
- parameters. If the structure finder produces unexpected results, specify the
70
- `explain` query parameter and an explanation will appear in the response. It
71
- helps determine why the returned structure was chosen.
56
+ .. raw:: html
72
57
 
73
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/find-field-structure.html>`_
58
+ <p>Find the structure of a text field.
59
+ Find the structure of a text field in an Elasticsearch index.</p>
60
+ <p>This API provides a starting point for extracting further information from log messages already ingested into Elasticsearch.
61
+ For example, if you have ingested data into a very simple index that has just <code>@timestamp</code> and message fields, you can use this API to see what common structure exists in the message field.</p>
62
+ <p>The response from the API contains:</p>
63
+ <ul>
64
+ <li>Sample messages.</li>
65
+ <li>Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.</li>
66
+ <li>Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.</li>
67
+ <li>Appropriate mappings for an Elasticsearch index, which you could use to ingest the text.</li>
68
+ </ul>
69
+ <p>All this information can be calculated by the structure finder with no guidance.
70
+ However, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.</p>
71
+ <p>If the structure finder produces unexpected results, specify the <code>explain</code> query parameter and an explanation will appear in the response.
72
+ It helps determine why the returned structure was chosen.</p>
73
+
74
+
75
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/find-field-structure.html>`_
74
76
 
75
77
  :param field: The field that should be analyzed.
76
78
  :param index: The name of the index that contains the analyzed field.
@@ -237,25 +239,27 @@ class TextStructureClient(NamespacedClient):
237
239
  body: t.Optional[t.Dict[str, t.Any]] = None,
238
240
  ) -> ObjectApiResponse[t.Any]:
239
241
  """
240
- Find the structure of text messages. Find the structure of a list of text messages.
241
- The messages must contain data that is suitable to be ingested into Elasticsearch.
242
- This API provides a starting point for ingesting data into Elasticsearch in a
243
- format that is suitable for subsequent use with other Elastic Stack functionality.
244
- Use this API rather than the find text structure API if your input text has already
245
- been split up into separate messages by some other process. The response from
246
- the API contains: * Sample messages. * Statistics that reveal the most common
247
- values for all fields detected within the text and basic numeric statistics for
248
- numeric fields. * Information about the structure of the text, which is useful
249
- when you write ingest configurations to index it or similarly formatted text.
250
- Appropriate mappings for an Elasticsearch index, which you could use to ingest
251
- the text. All this information can be calculated by the structure finder with
252
- no guidance. However, you can optionally override some of the decisions about
253
- the text structure by specifying one or more query parameters. If the structure
254
- finder produces unexpected results, specify the `explain` query parameter and
255
- an explanation will appear in the response. It helps determine why the returned
256
- structure was chosen.
242
+ .. raw:: html
243
+
244
+ <p>Find the structure of text messages.
245
+ Find the structure of a list of text messages.
246
+ The messages must contain data that is suitable to be ingested into Elasticsearch.</p>
247
+ <p>This API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.
248
+ Use this API rather than the find text structure API if your input text has already been split up into separate messages by some other process.</p>
249
+ <p>The response from the API contains:</p>
250
+ <ul>
251
+ <li>Sample messages.</li>
252
+ <li>Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.</li>
253
+ <li>Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.
254
+ Appropriate mappings for an Elasticsearch index, which you could use to ingest the text.</li>
255
+ </ul>
256
+ <p>All this information can be calculated by the structure finder with no guidance.
257
+ However, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.</p>
258
+ <p>If the structure finder produces unexpected results, specify the <code>explain</code> query parameter and an explanation will appear in the response.
259
+ It helps determine why the returned structure was chosen.</p>
260
+
257
261
 
258
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/find-message-structure.html>`_
262
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/find-message-structure.html>`_
259
263
 
260
264
  :param messages: The list of messages you want to analyze.
261
265
  :param column_names: If the format is `delimited`, you can specify the column
@@ -410,24 +414,26 @@ class TextStructureClient(NamespacedClient):
410
414
  timestamp_format: t.Optional[str] = None,
411
415
  ) -> ObjectApiResponse[t.Any]:
412
416
  """
413
- Find the structure of a text file. The text file must contain data that is suitable
414
- to be ingested into Elasticsearch. This API provides a starting point for ingesting
415
- data into Elasticsearch in a format that is suitable for subsequent use with
416
- other Elastic Stack functionality. Unlike other Elasticsearch endpoints, the
417
- data that is posted to this endpoint does not need to be UTF-8 encoded and in
418
- JSON format. It must, however, be text; binary text formats are not currently
419
- supported. The size is limited to the Elasticsearch HTTP receive buffer size,
420
- which defaults to 100 Mb. The response from the API contains: * A couple of messages
421
- from the beginning of the text. * Statistics that reveal the most common values
422
- for all fields detected within the text and basic numeric statistics for numeric
423
- fields. * Information about the structure of the text, which is useful when you
424
- write ingest configurations to index it or similarly formatted text. * Appropriate
425
- mappings for an Elasticsearch index, which you could use to ingest the text.
426
- All this information can be calculated by the structure finder with no guidance.
427
- However, you can optionally override some of the decisions about the text structure
428
- by specifying one or more query parameters.
417
+ .. raw:: html
429
418
 
430
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/find-structure.html>`_
419
+ <p>Find the structure of a text file.
420
+ The text file must contain data that is suitable to be ingested into Elasticsearch.</p>
421
+ <p>This API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality.
422
+ Unlike other Elasticsearch endpoints, the data that is posted to this endpoint does not need to be UTF-8 encoded and in JSON format.
423
+ It must, however, be text; binary text formats are not currently supported.
424
+ The size is limited to the Elasticsearch HTTP receive buffer size, which defaults to 100 Mb.</p>
425
+ <p>The response from the API contains:</p>
426
+ <ul>
427
+ <li>A couple of messages from the beginning of the text.</li>
428
+ <li>Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields.</li>
429
+ <li>Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text.</li>
430
+ <li>Appropriate mappings for an Elasticsearch index, which you could use to ingest the text.</li>
431
+ </ul>
432
+ <p>All this information can be calculated by the structure finder with no guidance.
433
+ However, you can optionally override some of the decisions about the text structure by specifying one or more query parameters.</p>
434
+
435
+
436
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/find-structure.html>`_
431
437
 
432
438
  :param text_files:
433
439
  :param charset: The text's character set. It must be a character set that is
@@ -607,11 +613,14 @@ class TextStructureClient(NamespacedClient):
607
613
  body: t.Optional[t.Dict[str, t.Any]] = None,
608
614
  ) -> ObjectApiResponse[t.Any]:
609
615
  """
610
- Test a Grok pattern. Test a Grok pattern on one or more lines of text. The API
611
- indicates whether the lines match the pattern together with the offsets and lengths
612
- of the matched substrings.
616
+ .. raw:: html
617
+
618
+ <p>Test a Grok pattern.
619
+ Test a Grok pattern on one or more lines of text.
620
+ The API indicates whether the lines match the pattern together with the offsets and lengths of the matched substrings.</p>
621
+
613
622
 
614
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/test-grok-pattern.html>`_
623
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/test-grok-pattern.html>`_
615
624
 
616
625
  :param grok_pattern: The Grok pattern to run on the text.
617
626
  :param text: The lines of text to run the Grok pattern on.
@@ -39,9 +39,12 @@ class TransformClient(NamespacedClient):
39
39
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
40
40
  ) -> ObjectApiResponse[t.Any]:
41
41
  """
42
- Delete a transform. Deletes a transform.
42
+ .. raw:: html
43
43
 
44
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-transform.html>`_
44
+ <p>Delete a transform.</p>
45
+
46
+
47
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-transform.html>`_
45
48
 
46
49
  :param transform_id: Identifier for the transform.
47
50
  :param delete_dest_index: If this value is true, the destination index is deleted
@@ -99,9 +102,13 @@ class TransformClient(NamespacedClient):
99
102
  size: t.Optional[int] = None,
100
103
  ) -> ObjectApiResponse[t.Any]:
101
104
  """
102
- Get transforms. Retrieves configuration information for transforms.
105
+ .. raw:: html
106
+
107
+ <p>Get transforms.
108
+ Get configuration information for transforms.</p>
103
109
 
104
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-transform.html>`_
110
+
111
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-transform.html>`_
105
112
 
106
113
  :param transform_id: Identifier for the transform. It can be a transform identifier
107
114
  or a wildcard expression. You can get information for all transforms by using
@@ -168,9 +175,13 @@ class TransformClient(NamespacedClient):
168
175
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
169
176
  ) -> ObjectApiResponse[t.Any]:
170
177
  """
171
- Get transform stats. Retrieves usage information for transforms.
178
+ .. raw:: html
179
+
180
+ <p>Get transform stats.</p>
181
+ <p>Get usage information for transforms.</p>
182
+
172
183
 
173
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-transform-stats.html>`_
184
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-transform-stats.html>`_
174
185
 
175
186
  :param transform_id: Identifier for the transform. It can be a transform identifier
176
187
  or a wildcard expression. You can get information for all transforms by using
@@ -249,14 +260,16 @@ class TransformClient(NamespacedClient):
249
260
  body: t.Optional[t.Dict[str, t.Any]] = None,
250
261
  ) -> ObjectApiResponse[t.Any]:
251
262
  """
252
- Preview a transform. Generates a preview of the results that you will get when
253
- you create a transform with the same configuration. It returns a maximum of 100
254
- results. The calculations are based on all the current data in the source index.
255
- It also generates a list of mappings and settings for the destination index.
256
- These values are determined based on the field types of the source index and
257
- the transform aggregations.
263
+ .. raw:: html
258
264
 
259
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/preview-transform.html>`_
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/guide/en/elasticsearch/reference/8.18/preview-transform.html>`_
260
273
 
261
274
  :param transform_id: Identifier for the transform to preview. If you specify
262
275
  this path parameter, you cannot provide transform configuration details in
@@ -371,29 +384,29 @@ class TransformClient(NamespacedClient):
371
384
  body: t.Optional[t.Dict[str, t.Any]] = None,
372
385
  ) -> ObjectApiResponse[t.Any]:
373
386
  """
374
- Create a transform. Creates a transform. A transform copies data from source
375
- indices, transforms it, and persists it into an entity-centric destination index.
376
- You can also think of the destination index as a two-dimensional tabular data
377
- structure (known as a data frame). The ID for each document in the data frame
378
- is generated from a hash of the entity, so there is a unique row per entity.
379
- You must choose either the latest or pivot method for your transform; you cannot
380
- use both in a single transform. If you choose to use the pivot method for your
381
- transform, the entities are defined by the set of `group_by` fields in the pivot
382
- object. If you choose to use the latest method, the entities are defined by the
383
- `unique_key` field values in the latest object. You must have `create_index`,
384
- `index`, and `read` privileges on the destination index and `read` and `view_index_metadata`
385
- privileges on the source indices. When Elasticsearch security features are enabled,
386
- the transform remembers which roles the user that created it had at the time
387
- of creation and uses those same roles. If those roles do not have the required
388
- privileges on the source and destination indices, the transform fails when it
389
- attempts unauthorized operations. NOTE: You must use Kibana or this API to create
390
- a transform. Do not add a transform directly into any `.transform-internal*`
391
- indices using the Elasticsearch index API. If Elasticsearch security features
392
- are enabled, do not give users any privileges on `.transform-internal*` indices.
393
- If you used transforms prior to 7.5, also do not give users any privileges on
394
- `.data-frame-internal*` indices.
395
-
396
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-transform.html>`_
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/guide/en/elasticsearch/reference/8.18/put-transform.html>`_
397
410
 
398
411
  :param transform_id: Identifier for the transform. This identifier can contain
399
412
  lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
@@ -489,13 +502,17 @@ class TransformClient(NamespacedClient):
489
502
  force: t.Optional[bool] = None,
490
503
  human: t.Optional[bool] = None,
491
504
  pretty: t.Optional[bool] = None,
505
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
492
506
  ) -> ObjectApiResponse[t.Any]:
493
507
  """
494
- Reset a transform. Resets a transform. Before you can reset it, you must stop
495
- it; alternatively, use the `force` query parameter. If the destination index
496
- was created by the transform, it is deleted.
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
+
497
514
 
498
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/reset-transform.html>`_
515
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/reset-transform.html>`_
499
516
 
500
517
  :param transform_id: Identifier for the transform. This identifier can contain
501
518
  lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
@@ -503,6 +520,8 @@ class TransformClient(NamespacedClient):
503
520
  :param force: If this value is `true`, the transform is reset regardless of its
504
521
  current state. If it's `false`, the transform must be stopped before it can
505
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.
506
525
  """
507
526
  if transform_id in SKIP_IN_PATH:
508
527
  raise ValueError("Empty value passed for parameter 'transform_id'")
@@ -519,6 +538,8 @@ class TransformClient(NamespacedClient):
519
538
  __query["human"] = human
520
539
  if pretty is not None:
521
540
  __query["pretty"] = pretty
541
+ if timeout is not None:
542
+ __query["timeout"] = timeout
522
543
  __headers = {"accept": "application/json"}
523
544
  return self.perform_request( # type: ignore[return-value]
524
545
  "POST",
@@ -541,13 +562,17 @@ class TransformClient(NamespacedClient):
541
562
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
542
563
  ) -> ObjectApiResponse[t.Any]:
543
564
  """
544
- Schedule a transform to start now. Instantly runs a transform to process data.
545
- If you _schedule_now a transform, it will process the new data instantly, without
546
- waiting for the configured frequency interval. After _schedule_now API is called,
547
- the transform will be processed again at now + frequency unless _schedule_now
548
- API is called again in the meantime.
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>
549
573
 
550
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/schedule-now-transform.html>`_
574
+
575
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/schedule-now-transform.html>`_
551
576
 
552
577
  :param transform_id: Identifier for the transform.
553
578
  :param timeout: Controls the time to wait for the scheduling to take place
@@ -592,26 +617,25 @@ class TransformClient(NamespacedClient):
592
617
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
593
618
  ) -> ObjectApiResponse[t.Any]:
594
619
  """
595
- Start a transform. Starts a transform. When you start a transform, it creates
596
- the destination index if it does not already exist. The `number_of_shards` is
597
- set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform,
598
- it deduces the mapping definitions for the destination index from the source
599
- indices and the transform aggregations. If fields in the destination index are
600
- derived from scripts (as in the case of `scripted_metric` or `bucket_script`
601
- aggregations), the transform uses dynamic mappings unless an index template exists.
602
- If it is a latest transform, it does not deduce mapping definitions; it uses
603
- dynamic mappings. To use explicit mappings, create the destination index before
604
- you start the transform. Alternatively, you can create an index template, though
605
- it does not affect the deduced mappings in a pivot transform. When the transform
606
- starts, a series of validations occur to ensure its success. If you deferred
607
- validation when you created the transform, they occur when you start the transform—​with
608
- the exception of privilege checks. When Elasticsearch security features are enabled,
609
- the transform remembers which roles the user that created it had at the time
610
- of creation and uses those same roles. If those roles do not have the required
611
- privileges on the source and destination indices, the transform fails when it
612
- attempts unauthorized operations.
613
-
614
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-transform.html>`_
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/guide/en/elasticsearch/reference/8.18/start-transform.html>`_
615
639
 
616
640
  :param transform_id: Identifier for the transform.
617
641
  :param from_: Restricts the set of transformed entities to those changed after
@@ -663,9 +687,13 @@ class TransformClient(NamespacedClient):
663
687
  wait_for_completion: t.Optional[bool] = None,
664
688
  ) -> ObjectApiResponse[t.Any]:
665
689
  """
666
- Stop transforms. Stops one or more transforms.
690
+ .. raw:: html
691
+
692
+ <p>Stop transforms.
693
+ Stops one or more transforms.</p>
694
+
667
695
 
668
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/stop-transform.html>`_
696
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/stop-transform.html>`_
669
697
 
670
698
  :param transform_id: Identifier for the transform. To stop multiple transforms,
671
699
  use a comma-separated list or a wildcard expression. To stop all transforms,
@@ -756,16 +784,18 @@ class TransformClient(NamespacedClient):
756
784
  body: t.Optional[t.Dict[str, t.Any]] = None,
757
785
  ) -> ObjectApiResponse[t.Any]:
758
786
  """
759
- Update a transform. Updates certain properties of a transform. All updated properties
760
- except `description` do not take effect until after the transform starts the
761
- next checkpoint, thus there is data consistency in each checkpoint. To use this
762
- API, you must have `read` and `view_index_metadata` privileges for the source
763
- indices. You must also have `index` and `read` privileges for the destination
764
- index. When Elasticsearch security features are enabled, the transform remembers
765
- which roles the user who updated it had at the time of update and runs with those
766
- privileges.
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
+
767
797
 
768
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-transform.html>`_
798
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/update-transform.html>`_
769
799
 
770
800
  :param transform_id: Identifier for the transform.
771
801
  :param defer_validation: When true, deferrable validations are not run. This
@@ -844,22 +874,23 @@ class TransformClient(NamespacedClient):
844
874
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
845
875
  ) -> ObjectApiResponse[t.Any]:
846
876
  """
847
- Upgrade all transforms. Transforms are compatible across minor versions and between
848
- supported major versions. However, over time, the format of transform configuration
849
- information may change. This API identifies transforms that have a legacy configuration
850
- format and upgrades them to the latest version. It also cleans up the internal
851
- data structures that store the transform state and checkpoints. The upgrade does
852
- not affect the source and destination indices. The upgrade also does not affect
853
- the roles that transforms use when Elasticsearch security features are enabled;
854
- the role used to read source data and write to the destination index remains
855
- unchanged. If a transform upgrade step fails, the upgrade stops and an error
856
- is returned about the underlying issue. Resolve the issue then re-run the process
857
- again. A summary is returned when the upgrade is finished. To ensure continuous
858
- transforms remain running during a major version upgrade of the cluster – for
859
- example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading
860
- the cluster. You may want to perform a recent cluster backup prior to the upgrade.
861
-
862
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/upgrade-transforms.html>`_
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/guide/en/elasticsearch/reference/8.18/upgrade-transforms.html>`_
863
894
 
864
895
  :param dry_run: When true, the request checks for updates but does not run them.
865
896
  :param timeout: Period to wait for a response. If no response is received before
@@ -134,7 +134,6 @@ def client_node_configs(
134
134
 
135
135
  def apply_node_options(node_config: NodeConfig) -> NodeConfig:
136
136
  """Needs special handling of headers since .replace() wipes out existing headers"""
137
- nonlocal node_options
138
137
  headers = node_config.headers.copy() # type: ignore[attr-defined]
139
138
 
140
139
  headers_to_add = node_options.pop("headers", ())
@@ -232,7 +231,7 @@ def host_mapping_to_node_config(host: Mapping[str, Union[str, int]]) -> NodeConf
232
231
  )
233
232
  options["path_prefix"] = options.pop("url_prefix")
234
233
 
235
- return NodeConfig(**options) # type: ignore
234
+ return NodeConfig(**options) # type: ignore[arg-type]
236
235
 
237
236
 
238
237
  def cloud_id_to_node_configs(cloud_id: str) -> List[NodeConfig]:
@@ -343,8 +342,6 @@ def _rewrite_parameters(
343
342
  def wrapper(api: F) -> F:
344
343
  @wraps(api)
345
344
  def wrapped(*args: Any, **kwargs: Any) -> Any:
346
- nonlocal api, body_name, body_fields
347
-
348
345
  # Let's give a nicer error message when users pass positional arguments.
349
346
  if len(args) >= 2:
350
347
  raise TypeError(