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.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2146 -859
- elasticsearch/_async/client/_base.py +0 -1
- elasticsearch/_async/client/async_search.py +44 -29
- elasticsearch/_async/client/autoscaling.py +32 -26
- elasticsearch/_async/client/cat.py +244 -169
- elasticsearch/_async/client/ccr.py +268 -128
- elasticsearch/_async/client/cluster.py +191 -164
- elasticsearch/_async/client/connector.py +212 -116
- elasticsearch/_async/client/dangling_indices.py +22 -16
- elasticsearch/_async/client/enrich.py +51 -11
- elasticsearch/_async/client/eql.py +54 -13
- elasticsearch/_async/client/esql.py +352 -4
- elasticsearch/_async/client/features.py +37 -27
- elasticsearch/_async/client/fleet.py +22 -10
- elasticsearch/_async/client/graph.py +10 -9
- elasticsearch/_async/client/ilm.py +108 -77
- elasticsearch/_async/client/indices.py +1112 -677
- elasticsearch/_async/client/inference.py +1875 -133
- elasticsearch/_async/client/ingest.py +83 -50
- elasticsearch/_async/client/license.py +90 -38
- elasticsearch/_async/client/logstash.py +20 -9
- elasticsearch/_async/client/migration.py +26 -17
- elasticsearch/_async/client/ml.py +642 -365
- elasticsearch/_async/client/monitoring.py +6 -3
- elasticsearch/_async/client/nodes.py +51 -53
- elasticsearch/_async/client/query_rules.py +59 -33
- elasticsearch/_async/client/rollup.py +124 -86
- elasticsearch/_async/client/search_application.py +60 -32
- elasticsearch/_async/client/searchable_snapshots.py +25 -12
- elasticsearch/_async/client/security.py +896 -558
- elasticsearch/_async/client/shutdown.py +34 -36
- elasticsearch/_async/client/simulate.py +22 -28
- elasticsearch/_async/client/slm.py +65 -40
- elasticsearch/_async/client/snapshot.py +190 -213
- elasticsearch/_async/client/sql.py +43 -22
- elasticsearch/_async/client/ssl.py +17 -18
- elasticsearch/_async/client/synonyms.py +58 -37
- elasticsearch/_async/client/tasks.py +77 -48
- elasticsearch/_async/client/text_structure.py +65 -56
- elasticsearch/_async/client/transform.py +124 -93
- elasticsearch/_async/client/watcher.py +116 -72
- elasticsearch/_async/client/xpack.py +18 -9
- elasticsearch/_async/helpers.py +1 -2
- elasticsearch/_sync/client/__init__.py +2146 -859
- elasticsearch/_sync/client/_base.py +0 -1
- elasticsearch/_sync/client/async_search.py +44 -29
- elasticsearch/_sync/client/autoscaling.py +32 -26
- elasticsearch/_sync/client/cat.py +244 -169
- elasticsearch/_sync/client/ccr.py +268 -128
- elasticsearch/_sync/client/cluster.py +191 -164
- elasticsearch/_sync/client/connector.py +212 -116
- elasticsearch/_sync/client/dangling_indices.py +22 -16
- elasticsearch/_sync/client/enrich.py +51 -11
- elasticsearch/_sync/client/eql.py +54 -13
- elasticsearch/_sync/client/esql.py +352 -4
- elasticsearch/_sync/client/features.py +37 -27
- elasticsearch/_sync/client/fleet.py +22 -10
- elasticsearch/_sync/client/graph.py +10 -9
- elasticsearch/_sync/client/ilm.py +108 -77
- elasticsearch/_sync/client/indices.py +1112 -677
- elasticsearch/_sync/client/inference.py +1875 -133
- elasticsearch/_sync/client/ingest.py +83 -50
- elasticsearch/_sync/client/license.py +90 -38
- elasticsearch/_sync/client/logstash.py +20 -9
- elasticsearch/_sync/client/migration.py +26 -17
- elasticsearch/_sync/client/ml.py +642 -365
- elasticsearch/_sync/client/monitoring.py +6 -3
- elasticsearch/_sync/client/nodes.py +51 -53
- elasticsearch/_sync/client/query_rules.py +59 -33
- elasticsearch/_sync/client/rollup.py +124 -86
- elasticsearch/_sync/client/search_application.py +60 -32
- elasticsearch/_sync/client/searchable_snapshots.py +25 -12
- elasticsearch/_sync/client/security.py +896 -558
- elasticsearch/_sync/client/shutdown.py +34 -36
- elasticsearch/_sync/client/simulate.py +22 -28
- elasticsearch/_sync/client/slm.py +65 -40
- elasticsearch/_sync/client/snapshot.py +190 -213
- elasticsearch/_sync/client/sql.py +43 -22
- elasticsearch/_sync/client/ssl.py +17 -18
- elasticsearch/_sync/client/synonyms.py +58 -37
- elasticsearch/_sync/client/tasks.py +77 -48
- elasticsearch/_sync/client/text_structure.py +65 -56
- elasticsearch/_sync/client/transform.py +124 -93
- elasticsearch/_sync/client/utils.py +1 -4
- elasticsearch/_sync/client/watcher.py +116 -72
- elasticsearch/_sync/client/xpack.py +18 -9
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- elasticsearch/dsl/__init__.py +203 -0
- elasticsearch/dsl/_async/__init__.py +16 -0
- elasticsearch/dsl/_async/document.py +522 -0
- elasticsearch/dsl/_async/faceted_search.py +50 -0
- elasticsearch/dsl/_async/index.py +639 -0
- elasticsearch/dsl/_async/mapping.py +49 -0
- elasticsearch/dsl/_async/search.py +233 -0
- elasticsearch/dsl/_async/update_by_query.py +47 -0
- elasticsearch/dsl/_sync/__init__.py +16 -0
- elasticsearch/dsl/_sync/document.py +514 -0
- elasticsearch/dsl/_sync/faceted_search.py +50 -0
- elasticsearch/dsl/_sync/index.py +597 -0
- elasticsearch/dsl/_sync/mapping.py +49 -0
- elasticsearch/dsl/_sync/search.py +226 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3730 -0
- elasticsearch/dsl/analysis.py +341 -0
- elasticsearch/dsl/async_connections.py +37 -0
- elasticsearch/dsl/connections.py +142 -0
- elasticsearch/dsl/document.py +20 -0
- elasticsearch/dsl/document_base.py +444 -0
- elasticsearch/dsl/exceptions.py +32 -0
- elasticsearch/dsl/faceted_search.py +28 -0
- elasticsearch/dsl/faceted_search_base.py +489 -0
- elasticsearch/dsl/field.py +4254 -0
- elasticsearch/dsl/function.py +180 -0
- elasticsearch/dsl/index.py +23 -0
- elasticsearch/dsl/index_base.py +178 -0
- elasticsearch/dsl/mapping.py +19 -0
- elasticsearch/dsl/mapping_base.py +219 -0
- elasticsearch/dsl/query.py +2816 -0
- elasticsearch/dsl/response/__init__.py +388 -0
- elasticsearch/dsl/response/aggs.py +100 -0
- elasticsearch/dsl/response/hit.py +53 -0
- elasticsearch/dsl/search.py +20 -0
- elasticsearch/dsl/search_base.py +1040 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6471 -0
- elasticsearch/dsl/update_by_query.py +19 -0
- elasticsearch/dsl/update_by_query_base.py +149 -0
- elasticsearch/dsl/utils.py +687 -0
- elasticsearch/dsl/wrappers.py +119 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/METADATA +12 -2
- elasticsearch-8.18.0.dist-info/RECORD +161 -0
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/LICENSE +0 -0
- {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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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.
|
|
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
|
-
|
|
42
|
+
.. raw:: html
|
|
43
43
|
|
|
44
|
-
|
|
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
|
-
|
|
105
|
+
.. raw:: html
|
|
106
|
+
|
|
107
|
+
<p>Get transforms.
|
|
108
|
+
Get configuration information for transforms.</p>
|
|
103
109
|
|
|
104
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
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
|
-
|
|
495
|
-
|
|
496
|
-
|
|
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.
|
|
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
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
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
|
-
|
|
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
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
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.
|
|
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
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
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(
|