elasticsearch9 9.1.2__py3-none-any.whl → 9.1.3__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.
- elasticsearch9/_async/client/__init__.py +67 -65
- elasticsearch9/_async/client/async_search.py +3 -3
- elasticsearch9/_async/client/autoscaling.py +8 -4
- elasticsearch9/_async/client/cat.py +40 -2
- elasticsearch9/_async/client/ccr.py +10 -10
- elasticsearch9/_async/client/cluster.py +34 -33
- elasticsearch9/_async/client/connector.py +42 -41
- elasticsearch9/_async/client/dangling_indices.py +8 -12
- elasticsearch9/_async/client/enrich.py +10 -10
- elasticsearch9/_async/client/eql.py +10 -10
- elasticsearch9/_async/client/esql.py +16 -16
- elasticsearch9/_async/client/features.py +6 -6
- elasticsearch9/_async/client/fleet.py +8 -12
- elasticsearch9/_async/client/graph.py +3 -7
- elasticsearch9/_async/client/ilm.py +20 -28
- elasticsearch9/_async/client/indices.py +140 -160
- elasticsearch9/_async/client/inference.py +30 -126
- elasticsearch9/_async/client/ingest.py +9 -9
- elasticsearch9/_async/client/license.py +5 -7
- elasticsearch9/_async/client/logstash.py +4 -4
- elasticsearch9/_async/client/migration.py +6 -6
- elasticsearch9/_async/client/ml.py +125 -85
- elasticsearch9/_async/client/monitoring.py +4 -3
- elasticsearch9/_async/client/nodes.py +15 -15
- elasticsearch9/_async/client/query_rules.py +16 -16
- elasticsearch9/_async/client/rollup.py +21 -21
- elasticsearch9/_async/client/search_application.py +19 -19
- elasticsearch9/_async/client/searchable_snapshots.py +10 -10
- elasticsearch9/_async/client/security.py +8 -7
- elasticsearch9/_async/client/shutdown.py +9 -4
- elasticsearch9/_async/client/simulate.py +4 -4
- elasticsearch9/_async/client/slm.py +18 -22
- elasticsearch9/_async/client/snapshot.py +20 -20
- elasticsearch9/_async/client/sql.py +10 -10
- elasticsearch9/_async/client/streams.py +6 -6
- elasticsearch9/_async/client/synonyms.py +10 -10
- elasticsearch9/_async/client/tasks.py +8 -8
- elasticsearch9/_async/client/text_structure.py +13 -9
- elasticsearch9/_async/client/transform.py +51 -12
- elasticsearch9/_async/client/utils.py +4 -2
- elasticsearch9/_async/client/watcher.py +26 -26
- elasticsearch9/_async/client/xpack.py +6 -5
- elasticsearch9/_sync/client/__init__.py +69 -65
- elasticsearch9/_sync/client/async_search.py +3 -3
- elasticsearch9/_sync/client/autoscaling.py +8 -4
- elasticsearch9/_sync/client/cat.py +40 -2
- elasticsearch9/_sync/client/ccr.py +10 -10
- elasticsearch9/_sync/client/cluster.py +34 -33
- elasticsearch9/_sync/client/connector.py +42 -41
- elasticsearch9/_sync/client/dangling_indices.py +8 -12
- elasticsearch9/_sync/client/enrich.py +10 -10
- elasticsearch9/_sync/client/eql.py +10 -10
- elasticsearch9/_sync/client/esql.py +16 -16
- elasticsearch9/_sync/client/features.py +6 -6
- elasticsearch9/_sync/client/fleet.py +8 -12
- elasticsearch9/_sync/client/graph.py +3 -7
- elasticsearch9/_sync/client/ilm.py +20 -28
- elasticsearch9/_sync/client/indices.py +140 -160
- elasticsearch9/_sync/client/inference.py +30 -126
- elasticsearch9/_sync/client/ingest.py +9 -9
- elasticsearch9/_sync/client/license.py +5 -7
- elasticsearch9/_sync/client/logstash.py +4 -4
- elasticsearch9/_sync/client/migration.py +6 -6
- elasticsearch9/_sync/client/ml.py +125 -85
- elasticsearch9/_sync/client/monitoring.py +4 -3
- elasticsearch9/_sync/client/nodes.py +15 -15
- elasticsearch9/_sync/client/query_rules.py +16 -16
- elasticsearch9/_sync/client/rollup.py +21 -21
- elasticsearch9/_sync/client/search_application.py +19 -19
- elasticsearch9/_sync/client/searchable_snapshots.py +10 -10
- elasticsearch9/_sync/client/security.py +8 -7
- elasticsearch9/_sync/client/shutdown.py +9 -4
- elasticsearch9/_sync/client/simulate.py +4 -4
- elasticsearch9/_sync/client/slm.py +18 -22
- elasticsearch9/_sync/client/snapshot.py +20 -20
- elasticsearch9/_sync/client/sql.py +10 -10
- elasticsearch9/_sync/client/streams.py +6 -6
- elasticsearch9/_sync/client/synonyms.py +10 -10
- elasticsearch9/_sync/client/tasks.py +8 -8
- elasticsearch9/_sync/client/text_structure.py +13 -9
- elasticsearch9/_sync/client/transform.py +51 -12
- elasticsearch9/_sync/client/utils.py +16 -2
- elasticsearch9/_sync/client/watcher.py +26 -26
- elasticsearch9/_sync/client/xpack.py +6 -5
- elasticsearch9/_version.py +2 -2
- elasticsearch9/dsl/_async/document.py +4 -5
- elasticsearch9/dsl/_async/index.py +1 -1
- elasticsearch9/dsl/_async/search.py +2 -3
- elasticsearch9/dsl/_sync/document.py +4 -5
- elasticsearch9/dsl/_sync/index.py +1 -1
- elasticsearch9/dsl/_sync/search.py +2 -3
- elasticsearch9/dsl/aggs.py +3 -3
- elasticsearch9/dsl/async_connections.py +1 -2
- elasticsearch9/dsl/connections.py +1 -2
- elasticsearch9/dsl/document_base.py +1 -1
- elasticsearch9/dsl/field.py +1 -9
- elasticsearch9/dsl/query.py +24 -5
- elasticsearch9/dsl/serializer.py +1 -2
- elasticsearch9/dsl/types.py +11 -43
- elasticsearch9/dsl/utils.py +1 -2
- elasticsearch9/esql/esql.py +1 -1
- elasticsearch9/esql/functions.py +2 -2
- elasticsearch9/helpers/vectorstore/__init__.py +7 -7
- elasticsearch9/helpers/vectorstore/_async/_utils.py +1 -1
- elasticsearch9/helpers/vectorstore/_async/embedding_service.py +2 -2
- elasticsearch9/helpers/vectorstore/_async/strategies.py +3 -3
- elasticsearch9/helpers/vectorstore/_async/vectorstore.py +5 -5
- elasticsearch9/helpers/vectorstore/_sync/_utils.py +1 -1
- elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +2 -2
- elasticsearch9/helpers/vectorstore/_sync/strategies.py +3 -3
- elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +5 -5
- {elasticsearch9-9.1.2.dist-info → elasticsearch9-9.1.3.dist-info}/METADATA +1 -1
- elasticsearch9-9.1.3.dist-info/RECORD +165 -0
- {elasticsearch9-9.1.2.dist-info → elasticsearch9-9.1.3.dist-info}/WHEEL +1 -1
- elasticsearch9-9.1.2.dist-info/RECORD +0 -165
- {elasticsearch9-9.1.2.dist-info → elasticsearch9-9.1.3.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch9-9.1.2.dist-info → elasticsearch9-9.1.3.dist-info}/licenses/NOTICE +0 -0
|
@@ -39,8 +39,8 @@ class WatcherClient(NamespacedClient):
|
|
|
39
39
|
"""
|
|
40
40
|
.. raw:: html
|
|
41
41
|
|
|
42
|
-
<p>Acknowledge a watch
|
|
43
|
-
Acknowledging a watch enables you to manually throttle the execution of the watch's actions.</p>
|
|
42
|
+
<p>Acknowledge a watch.</p>
|
|
43
|
+
<p>Acknowledging a watch enables you to manually throttle the execution of the watch's actions.</p>
|
|
44
44
|
<p>The acknowledgement state of an action is stored in the <code>status.actions.<id>.ack.state</code> structure.</p>
|
|
45
45
|
<p>IMPORTANT: If the specified watch is currently being executed, this API will return an error
|
|
46
46
|
The reason for this behavior is to prevent overwriting the watch status from a watch execution.</p>
|
|
@@ -101,8 +101,8 @@ class WatcherClient(NamespacedClient):
|
|
|
101
101
|
"""
|
|
102
102
|
.. raw:: html
|
|
103
103
|
|
|
104
|
-
<p>Activate a watch
|
|
105
|
-
A watch can be either active or inactive.</p>
|
|
104
|
+
<p>Activate a watch.</p>
|
|
105
|
+
<p>A watch can be either active or inactive.</p>
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-activate-watch>`_
|
|
@@ -145,8 +145,8 @@ class WatcherClient(NamespacedClient):
|
|
|
145
145
|
"""
|
|
146
146
|
.. raw:: html
|
|
147
147
|
|
|
148
|
-
<p>Deactivate a watch
|
|
149
|
-
A watch can be either active or inactive.</p>
|
|
148
|
+
<p>Deactivate a watch.</p>
|
|
149
|
+
<p>A watch can be either active or inactive.</p>
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-deactivate-watch>`_
|
|
@@ -189,8 +189,8 @@ class WatcherClient(NamespacedClient):
|
|
|
189
189
|
"""
|
|
190
190
|
.. raw:: html
|
|
191
191
|
|
|
192
|
-
<p>Delete a watch
|
|
193
|
-
When the watch is removed, the document representing the watch in the <code>.watches</code> index is gone and it will never be run again.</p>
|
|
192
|
+
<p>Delete a watch.</p>
|
|
193
|
+
<p>When the watch is removed, the document representing the watch in the <code>.watches</code> index is gone and it will never be run again.</p>
|
|
194
194
|
<p>Deleting a watch does not delete any watch execution records related to this watch from the watch history.</p>
|
|
195
195
|
<p>IMPORTANT: Deleting a watch must be done by using only this API.
|
|
196
196
|
Do not delete the watch directly from the <code>.watches</code> index using the Elasticsearch delete document API
|
|
@@ -266,8 +266,8 @@ class WatcherClient(NamespacedClient):
|
|
|
266
266
|
"""
|
|
267
267
|
.. raw:: html
|
|
268
268
|
|
|
269
|
-
<p>Run a watch
|
|
270
|
-
This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.</p>
|
|
269
|
+
<p>Run a watch.</p>
|
|
270
|
+
<p>This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.</p>
|
|
271
271
|
<p>For testing and debugging purposes, you also have fine-grained control on how the watch runs.
|
|
272
272
|
You can run the watch without running all of its actions or alternatively by simulating them.
|
|
273
273
|
You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs.</p>
|
|
@@ -362,8 +362,8 @@ class WatcherClient(NamespacedClient):
|
|
|
362
362
|
"""
|
|
363
363
|
.. raw:: html
|
|
364
364
|
|
|
365
|
-
<p>Get Watcher index settings
|
|
366
|
-
Get settings for the Watcher internal index (<code>.watches</code>).
|
|
365
|
+
<p>Get Watcher index settings.</p>
|
|
366
|
+
<p>Get settings for the Watcher internal index (<code>.watches</code>).
|
|
367
367
|
Only a subset of settings are shown, for example <code>index.auto_expand_replicas</code> and <code>index.number_of_replicas</code>.</p>
|
|
368
368
|
|
|
369
369
|
|
|
@@ -476,8 +476,8 @@ class WatcherClient(NamespacedClient):
|
|
|
476
476
|
"""
|
|
477
477
|
.. raw:: html
|
|
478
478
|
|
|
479
|
-
<p>Create or update a watch
|
|
480
|
-
When a watch is registered, a new document that represents the watch is added to the <code>.watches</code> index and its trigger is immediately registered with the relevant trigger engine.
|
|
479
|
+
<p>Create or update a watch.</p>
|
|
480
|
+
<p>When a watch is registered, a new document that represents the watch is added to the <code>.watches</code> index and its trigger is immediately registered with the relevant trigger engine.
|
|
481
481
|
Typically for the <code>schedule</code> trigger, the scheduler is the trigger engine.</p>
|
|
482
482
|
<p>IMPORTANT: You must use Kibana or this API to create a watch.
|
|
483
483
|
Do not add a watch directly to the <code>.watches</code> index by using the Elasticsearch index API.
|
|
@@ -494,9 +494,9 @@ class WatcherClient(NamespacedClient):
|
|
|
494
494
|
:param active: The initial state of the watch. The default value is `true`, which
|
|
495
495
|
means the watch is active by default.
|
|
496
496
|
:param condition: The condition that defines if the actions should be run.
|
|
497
|
-
:param if_primary_term:
|
|
497
|
+
:param if_primary_term: Only update the watch if the last operation that has
|
|
498
498
|
changed the watch has the specified primary term
|
|
499
|
-
:param if_seq_no:
|
|
499
|
+
:param if_seq_no: Only update the watch if the last operation that has changed
|
|
500
500
|
the watch has the specified sequence number
|
|
501
501
|
:param input: The input that defines the input that loads the data for the watch.
|
|
502
502
|
:param metadata: Metadata JSON that will be copied into the history entries.
|
|
@@ -591,8 +591,8 @@ class WatcherClient(NamespacedClient):
|
|
|
591
591
|
"""
|
|
592
592
|
.. raw:: html
|
|
593
593
|
|
|
594
|
-
<p>Query watches
|
|
595
|
-
Get all registered watches in a paginated manner and optionally filter watches by a query.</p>
|
|
594
|
+
<p>Query watches.</p>
|
|
595
|
+
<p>Get all registered watches in a paginated manner and optionally filter watches by a query.</p>
|
|
596
596
|
<p>Note that only the <code>_id</code> and <code>metadata.*</code> fields are queryable or sortable.</p>
|
|
597
597
|
|
|
598
598
|
|
|
@@ -667,8 +667,8 @@ class WatcherClient(NamespacedClient):
|
|
|
667
667
|
"""
|
|
668
668
|
.. raw:: html
|
|
669
669
|
|
|
670
|
-
<p>Start the watch service
|
|
671
|
-
Start the Watcher service if it is not already running.</p>
|
|
670
|
+
<p>Start the watch service.</p>
|
|
671
|
+
<p>Start the Watcher service if it is not already running.</p>
|
|
672
672
|
|
|
673
673
|
|
|
674
674
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start>`_
|
|
@@ -732,8 +732,8 @@ class WatcherClient(NamespacedClient):
|
|
|
732
732
|
"""
|
|
733
733
|
.. raw:: html
|
|
734
734
|
|
|
735
|
-
<p>Get Watcher statistics
|
|
736
|
-
This API always returns basic metrics.
|
|
735
|
+
<p>Get Watcher statistics.</p>
|
|
736
|
+
<p>This API always returns basic metrics.
|
|
737
737
|
You retrieve more metrics by using the metric parameter.</p>
|
|
738
738
|
|
|
739
739
|
|
|
@@ -784,8 +784,8 @@ class WatcherClient(NamespacedClient):
|
|
|
784
784
|
"""
|
|
785
785
|
.. raw:: html
|
|
786
786
|
|
|
787
|
-
<p>Stop the watch service
|
|
788
|
-
Stop the Watcher service if it is running.</p>
|
|
787
|
+
<p>Stop the watch service.</p>
|
|
788
|
+
<p>Stop the Watcher service if it is running.</p>
|
|
789
789
|
|
|
790
790
|
|
|
791
791
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop>`_
|
|
@@ -840,8 +840,8 @@ class WatcherClient(NamespacedClient):
|
|
|
840
840
|
"""
|
|
841
841
|
.. raw:: html
|
|
842
842
|
|
|
843
|
-
<p>Update Watcher index settings
|
|
844
|
-
Update settings for the Watcher internal index (<code>.watches</code>).
|
|
843
|
+
<p>Update Watcher index settings.</p>
|
|
844
|
+
<p>Update settings for the Watcher internal index (<code>.watches</code>).
|
|
845
845
|
Only a subset of settings can be modified.
|
|
846
846
|
This includes <code>index.auto_expand_replicas</code>, <code>index.number_of_replicas</code>, <code>index.routing.allocation.exclude.*</code>,
|
|
847
847
|
<code>index.routing.allocation.include.*</code> and <code>index.routing.allocation.require.*</code>.
|
|
@@ -45,8 +45,8 @@ class XPackClient(NamespacedClient):
|
|
|
45
45
|
"""
|
|
46
46
|
.. raw:: html
|
|
47
47
|
|
|
48
|
-
<p>Get information
|
|
49
|
-
The information provided by the API includes:</p>
|
|
48
|
+
<p>Get information.</p>
|
|
49
|
+
<p>The information provided by the API includes:</p>
|
|
50
50
|
<ul>
|
|
51
51
|
<li>Build information including the build number and timestamp.</li>
|
|
52
52
|
<li>License information about the currently installed license.</li>
|
|
@@ -56,7 +56,8 @@ class XPackClient(NamespacedClient):
|
|
|
56
56
|
|
|
57
57
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info>`_
|
|
58
58
|
|
|
59
|
-
:param accept_enterprise: If this
|
|
59
|
+
:param accept_enterprise: If used, this otherwise ignored parameter must be set
|
|
60
|
+
to true
|
|
60
61
|
:param categories: A comma-separated list of the information categories to include
|
|
61
62
|
in the response. For example, `build,license,features`.
|
|
62
63
|
"""
|
|
@@ -98,8 +99,8 @@ class XPackClient(NamespacedClient):
|
|
|
98
99
|
"""
|
|
99
100
|
.. raw:: html
|
|
100
101
|
|
|
101
|
-
<p>Get usage information
|
|
102
|
-
Get information about the features that are currently enabled and available under the current license.
|
|
102
|
+
<p>Get usage information.</p>
|
|
103
|
+
<p>Get information about the features that are currently enabled and available under the current license.
|
|
103
104
|
The API also provides some usage statistics.</p>
|
|
104
105
|
|
|
105
106
|
|
|
@@ -84,9 +84,9 @@ from .utils import (
|
|
|
84
84
|
CLIENT_META_SERVICE,
|
|
85
85
|
SKIP_IN_PATH,
|
|
86
86
|
Stability,
|
|
87
|
+
_availability_warning,
|
|
87
88
|
_quote,
|
|
88
89
|
_rewrite_parameters,
|
|
89
|
-
_stability_warning,
|
|
90
90
|
client_node_configs,
|
|
91
91
|
is_requests_http_auth,
|
|
92
92
|
is_requests_node_class,
|
|
@@ -502,6 +502,7 @@ class Elasticsearch(BaseClient):
|
|
|
502
502
|
"""
|
|
503
503
|
__path = "/"
|
|
504
504
|
__query: t.Dict[str, t.Any] = {}
|
|
505
|
+
__path_parts: t.Dict[str, str] = {}
|
|
505
506
|
if error_trace is not None:
|
|
506
507
|
__query["error_trace"] = error_trace
|
|
507
508
|
if filter_path is not None:
|
|
@@ -512,7 +513,14 @@ class Elasticsearch(BaseClient):
|
|
|
512
513
|
__query["pretty"] = pretty
|
|
513
514
|
__headers = {"accept": "application/json"}
|
|
514
515
|
try:
|
|
515
|
-
self.perform_request(
|
|
516
|
+
self.perform_request(
|
|
517
|
+
"HEAD",
|
|
518
|
+
__path,
|
|
519
|
+
params=__query,
|
|
520
|
+
headers=__headers,
|
|
521
|
+
endpoint_id="ping",
|
|
522
|
+
path_parts=__path_parts,
|
|
523
|
+
)
|
|
516
524
|
return True
|
|
517
525
|
except (ApiError, TransportError):
|
|
518
526
|
return False
|
|
@@ -557,8 +565,8 @@ class Elasticsearch(BaseClient):
|
|
|
557
565
|
"""
|
|
558
566
|
.. raw:: html
|
|
559
567
|
|
|
560
|
-
<p>Bulk index or delete documents
|
|
561
|
-
Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
|
|
568
|
+
<p>Bulk index or delete documents.</p>
|
|
569
|
+
<p>Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
|
|
562
570
|
This reduces overhead and can greatly increase indexing speed.</p>
|
|
563
571
|
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:</p>
|
|
564
572
|
<ul>
|
|
@@ -763,8 +771,8 @@ class Elasticsearch(BaseClient):
|
|
|
763
771
|
"""
|
|
764
772
|
.. raw:: html
|
|
765
773
|
|
|
766
|
-
<p>Clear a scrolling search
|
|
767
|
-
Clear the search context and results for a scrolling search.</p>
|
|
774
|
+
<p>Clear a scrolling search.</p>
|
|
775
|
+
<p>Clear the search context and results for a scrolling search.</p>
|
|
768
776
|
|
|
769
777
|
|
|
770
778
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
|
|
@@ -817,8 +825,8 @@ class Elasticsearch(BaseClient):
|
|
|
817
825
|
"""
|
|
818
826
|
.. raw:: html
|
|
819
827
|
|
|
820
|
-
<p>Close a point in time
|
|
821
|
-
A point in time must be opened explicitly before being used in search requests.
|
|
828
|
+
<p>Close a point in time.</p>
|
|
829
|
+
<p>A point in time must be opened explicitly before being used in search requests.
|
|
822
830
|
The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
|
|
823
831
|
A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
|
|
824
832
|
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
|
|
@@ -845,11 +853,7 @@ class Elasticsearch(BaseClient):
|
|
|
845
853
|
if not __body:
|
|
846
854
|
if id is not None:
|
|
847
855
|
__body["id"] = id
|
|
848
|
-
|
|
849
|
-
__body = None # type: ignore[assignment]
|
|
850
|
-
__headers = {"accept": "application/json"}
|
|
851
|
-
if __body is not None:
|
|
852
|
-
__headers["content-type"] = "application/json"
|
|
856
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
853
857
|
return self.perform_request( # type: ignore[return-value]
|
|
854
858
|
"DELETE",
|
|
855
859
|
__path,
|
|
@@ -898,8 +902,8 @@ class Elasticsearch(BaseClient):
|
|
|
898
902
|
"""
|
|
899
903
|
.. raw:: html
|
|
900
904
|
|
|
901
|
-
<p>Count search results
|
|
902
|
-
Get the number of documents matching a query.</p>
|
|
905
|
+
<p>Count search results.</p>
|
|
906
|
+
<p>Get the number of documents matching a query.</p>
|
|
903
907
|
<p>The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body.
|
|
904
908
|
The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
|
|
905
909
|
<p>The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.</p>
|
|
@@ -1635,11 +1639,11 @@ class Elasticsearch(BaseClient):
|
|
|
1635
1639
|
self,
|
|
1636
1640
|
*,
|
|
1637
1641
|
task_id: str,
|
|
1642
|
+
requests_per_second: float,
|
|
1638
1643
|
error_trace: t.Optional[bool] = None,
|
|
1639
1644
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1640
1645
|
human: t.Optional[bool] = None,
|
|
1641
1646
|
pretty: t.Optional[bool] = None,
|
|
1642
|
-
requests_per_second: t.Optional[float] = None,
|
|
1643
1647
|
) -> ObjectApiResponse[t.Any]:
|
|
1644
1648
|
"""
|
|
1645
1649
|
.. raw:: html
|
|
@@ -1657,9 +1661,13 @@ class Elasticsearch(BaseClient):
|
|
|
1657
1661
|
"""
|
|
1658
1662
|
if task_id in SKIP_IN_PATH:
|
|
1659
1663
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
1664
|
+
if requests_per_second is None:
|
|
1665
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
1660
1666
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
1661
1667
|
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
1662
1668
|
__query: t.Dict[str, t.Any] = {}
|
|
1669
|
+
if requests_per_second is not None:
|
|
1670
|
+
__query["requests_per_second"] = requests_per_second
|
|
1663
1671
|
if error_trace is not None:
|
|
1664
1672
|
__query["error_trace"] = error_trace
|
|
1665
1673
|
if filter_path is not None:
|
|
@@ -1668,8 +1676,6 @@ class Elasticsearch(BaseClient):
|
|
|
1668
1676
|
__query["human"] = human
|
|
1669
1677
|
if pretty is not None:
|
|
1670
1678
|
__query["pretty"] = pretty
|
|
1671
|
-
if requests_per_second is not None:
|
|
1672
|
-
__query["requests_per_second"] = requests_per_second
|
|
1673
1679
|
__headers = {"accept": "application/json"}
|
|
1674
1680
|
return self.perform_request( # type: ignore[return-value]
|
|
1675
1681
|
"POST",
|
|
@@ -1695,8 +1701,8 @@ class Elasticsearch(BaseClient):
|
|
|
1695
1701
|
"""
|
|
1696
1702
|
.. raw:: html
|
|
1697
1703
|
|
|
1698
|
-
<p>Delete a script or search template
|
|
1699
|
-
Deletes a stored script or search template.</p>
|
|
1704
|
+
<p>Delete a script or search template.</p>
|
|
1705
|
+
<p>Deletes a stored script or search template.</p>
|
|
1700
1706
|
|
|
1701
1707
|
|
|
1702
1708
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
|
|
@@ -2007,8 +2013,8 @@ class Elasticsearch(BaseClient):
|
|
|
2007
2013
|
"""
|
|
2008
2014
|
.. raw:: html
|
|
2009
2015
|
|
|
2010
|
-
<p>Explain a document match result
|
|
2011
|
-
Get information about why a specific document matches, or doesn't match, a query.
|
|
2016
|
+
<p>Explain a document match result.</p>
|
|
2017
|
+
<p>Get information about why a specific document matches, or doesn't match, a query.
|
|
2012
2018
|
It computes a score explanation for a query and a specific document.</p>
|
|
2013
2019
|
|
|
2014
2020
|
|
|
@@ -2411,8 +2417,8 @@ class Elasticsearch(BaseClient):
|
|
|
2411
2417
|
"""
|
|
2412
2418
|
.. raw:: html
|
|
2413
2419
|
|
|
2414
|
-
<p>Get a script or search template
|
|
2415
|
-
Retrieves a stored script or search template.</p>
|
|
2420
|
+
<p>Get a script or search template.</p>
|
|
2421
|
+
<p>Retrieves a stored script or search template.</p>
|
|
2416
2422
|
|
|
2417
2423
|
|
|
2418
2424
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
|
|
@@ -2648,8 +2654,8 @@ class Elasticsearch(BaseClient):
|
|
|
2648
2654
|
"""
|
|
2649
2655
|
.. raw:: html
|
|
2650
2656
|
|
|
2651
|
-
<p>Get the cluster health
|
|
2652
|
-
Get a report with the health status of an Elasticsearch cluster.
|
|
2657
|
+
<p>Get the cluster health.</p>
|
|
2658
|
+
<p>Get a report with the health status of an Elasticsearch cluster.
|
|
2653
2659
|
The report contains a list of indicators that compose Elasticsearch functionality.</p>
|
|
2654
2660
|
<p>Each indicator has a health status of: green, unknown, yellow or red.
|
|
2655
2661
|
The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
|
|
@@ -2820,13 +2826,11 @@ class Elasticsearch(BaseClient):
|
|
|
2820
2826
|
"id": "elkbee"
|
|
2821
2827
|
}
|
|
2822
2828
|
}
|
|
2823
|
-
|
|
2824
|
-
In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
|
|
2825
|
-
If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).
|
|
2826
|
-
|
|
2827
|
-
A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
|
|
2828
|
-
Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.
|
|
2829
2829
|
</code></pre>
|
|
2830
|
+
<p>In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1.
|
|
2831
|
+
If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code).</p>
|
|
2832
|
+
<p>A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used.
|
|
2833
|
+
Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order.</p>
|
|
2830
2834
|
|
|
2831
2835
|
|
|
2832
2836
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create>`_
|
|
@@ -2961,8 +2965,8 @@ class Elasticsearch(BaseClient):
|
|
|
2961
2965
|
"""
|
|
2962
2966
|
.. raw:: html
|
|
2963
2967
|
|
|
2964
|
-
<p>Get cluster info
|
|
2965
|
-
Get basic build, version, and cluster information.
|
|
2968
|
+
<p>Get cluster info.</p>
|
|
2969
|
+
<p>Get basic build, version, and cluster information.
|
|
2966
2970
|
::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
|
|
2967
2971
|
|
|
2968
2972
|
|
|
@@ -3656,8 +3660,8 @@ class Elasticsearch(BaseClient):
|
|
|
3656
3660
|
"""
|
|
3657
3661
|
.. raw:: html
|
|
3658
3662
|
|
|
3659
|
-
<p>Create or update a script or search template
|
|
3660
|
-
Creates or updates a stored script or search template.</p>
|
|
3663
|
+
<p>Create or update a script or search template.</p>
|
|
3664
|
+
<p>Creates or updates a stored script or search template.</p>
|
|
3661
3665
|
|
|
3662
3666
|
|
|
3663
3667
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
|
|
@@ -3991,11 +3995,11 @@ class Elasticsearch(BaseClient):
|
|
|
3991
3995
|
self,
|
|
3992
3996
|
*,
|
|
3993
3997
|
task_id: str,
|
|
3998
|
+
requests_per_second: float,
|
|
3994
3999
|
error_trace: t.Optional[bool] = None,
|
|
3995
4000
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3996
4001
|
human: t.Optional[bool] = None,
|
|
3997
4002
|
pretty: t.Optional[bool] = None,
|
|
3998
|
-
requests_per_second: t.Optional[float] = None,
|
|
3999
4003
|
) -> ObjectApiResponse[t.Any]:
|
|
4000
4004
|
"""
|
|
4001
4005
|
.. raw:: html
|
|
@@ -4019,9 +4023,13 @@ class Elasticsearch(BaseClient):
|
|
|
4019
4023
|
"""
|
|
4020
4024
|
if task_id in SKIP_IN_PATH:
|
|
4021
4025
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
4026
|
+
if requests_per_second is None:
|
|
4027
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
4022
4028
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
4023
4029
|
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
|
|
4024
4030
|
__query: t.Dict[str, t.Any] = {}
|
|
4031
|
+
if requests_per_second is not None:
|
|
4032
|
+
__query["requests_per_second"] = requests_per_second
|
|
4025
4033
|
if error_trace is not None:
|
|
4026
4034
|
__query["error_trace"] = error_trace
|
|
4027
4035
|
if filter_path is not None:
|
|
@@ -4030,8 +4038,6 @@ class Elasticsearch(BaseClient):
|
|
|
4030
4038
|
__query["human"] = human
|
|
4031
4039
|
if pretty is not None:
|
|
4032
4040
|
__query["pretty"] = pretty
|
|
4033
|
-
if requests_per_second is not None:
|
|
4034
|
-
__query["requests_per_second"] = requests_per_second
|
|
4035
4041
|
__headers = {"accept": "application/json"}
|
|
4036
4042
|
return self.perform_request( # type: ignore[return-value]
|
|
4037
4043
|
"POST",
|
|
@@ -4101,11 +4107,7 @@ class Elasticsearch(BaseClient):
|
|
|
4101
4107
|
__body["params"] = params
|
|
4102
4108
|
if source is not None:
|
|
4103
4109
|
__body["source"] = source
|
|
4104
|
-
|
|
4105
|
-
__body = None # type: ignore[assignment]
|
|
4106
|
-
__headers = {"accept": "application/json"}
|
|
4107
|
-
if __body is not None:
|
|
4108
|
-
__headers["content-type"] = "application/json"
|
|
4110
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4109
4111
|
return self.perform_request( # type: ignore[return-value]
|
|
4110
4112
|
"POST",
|
|
4111
4113
|
__path,
|
|
@@ -4119,7 +4121,7 @@ class Elasticsearch(BaseClient):
|
|
|
4119
4121
|
@_rewrite_parameters(
|
|
4120
4122
|
body_fields=("context", "context_setup", "script"),
|
|
4121
4123
|
)
|
|
4122
|
-
@
|
|
4124
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
4123
4125
|
def scripts_painless_execute(
|
|
4124
4126
|
self,
|
|
4125
4127
|
*,
|
|
@@ -4188,11 +4190,7 @@ class Elasticsearch(BaseClient):
|
|
|
4188
4190
|
__body["context_setup"] = context_setup
|
|
4189
4191
|
if script is not None:
|
|
4190
4192
|
__body["script"] = script
|
|
4191
|
-
|
|
4192
|
-
__body = None # type: ignore[assignment]
|
|
4193
|
-
__headers = {"accept": "application/json"}
|
|
4194
|
-
if __body is not None:
|
|
4195
|
-
__headers["content-type"] = "application/json"
|
|
4193
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4196
4194
|
return self.perform_request( # type: ignore[return-value]
|
|
4197
4195
|
"POST",
|
|
4198
4196
|
__path,
|
|
@@ -5144,11 +5142,19 @@ class Elasticsearch(BaseClient):
|
|
|
5144
5142
|
|
|
5145
5143
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt>`_
|
|
5146
5144
|
|
|
5147
|
-
:param index:
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
:param
|
|
5145
|
+
:param index: A list of indices, data streams, or aliases to search. It supports
|
|
5146
|
+
wildcards (`*`). To search all data streams and indices, omit this parameter
|
|
5147
|
+
or use `*` or `_all`. To search a remote cluster, use the `<cluster>:<target>`
|
|
5148
|
+
syntax.
|
|
5149
|
+
:param field: A field that contains the geospatial data to return. It must be
|
|
5150
|
+
a `geo_point` or `geo_shape` field. The field must have doc values enabled.
|
|
5151
|
+
It cannot be a nested field. NOTE: Vector tiles do not natively support geometry
|
|
5152
|
+
collections. For `geometrycollection` values in a `geo_shape` field, the
|
|
5153
|
+
API returns a hits layer feature for each element of the collection. This
|
|
5154
|
+
behavior may change in a future release.
|
|
5155
|
+
:param zoom: The zoom level of the vector tile to search. It accepts `0` to `29`.
|
|
5156
|
+
:param x: The X coordinate for the vector tile to search.
|
|
5157
|
+
:param y: The Y coordinate for the vector tile to search.
|
|
5152
5158
|
:param aggs: Sub-aggregations for the geotile_grid. It supports the following
|
|
5153
5159
|
aggregation types: - `avg` - `boxplot` - `cardinality` - `extended stats`
|
|
5154
5160
|
- `max` - `median absolute deviation` - `min` - `percentile` - `percentile-rank`
|
|
@@ -5623,11 +5629,7 @@ class Elasticsearch(BaseClient):
|
|
|
5623
5629
|
__body["string"] = string
|
|
5624
5630
|
if timeout is not None:
|
|
5625
5631
|
__body["timeout"] = timeout
|
|
5626
|
-
|
|
5627
|
-
__body = None # type: ignore[assignment]
|
|
5628
|
-
__headers = {"accept": "application/json"}
|
|
5629
|
-
if __body is not None:
|
|
5630
|
-
__headers["content-type"] = "application/json"
|
|
5632
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
5631
5633
|
return self.perform_request( # type: ignore[return-value]
|
|
5632
5634
|
"POST",
|
|
5633
5635
|
__path,
|
|
@@ -6062,8 +6064,8 @@ class Elasticsearch(BaseClient):
|
|
|
6062
6064
|
"""
|
|
6063
6065
|
.. raw:: html
|
|
6064
6066
|
|
|
6065
|
-
<p>Update documents
|
|
6066
|
-
Updates documents that match the specified query.
|
|
6067
|
+
<p>Update documents.</p>
|
|
6068
|
+
<p>Updates documents that match the specified query.
|
|
6067
6069
|
If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.</p>
|
|
6068
6070
|
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
|
|
6069
6071
|
<ul>
|
|
@@ -6342,11 +6344,11 @@ class Elasticsearch(BaseClient):
|
|
|
6342
6344
|
self,
|
|
6343
6345
|
*,
|
|
6344
6346
|
task_id: str,
|
|
6347
|
+
requests_per_second: float,
|
|
6345
6348
|
error_trace: t.Optional[bool] = None,
|
|
6346
6349
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
6347
6350
|
human: t.Optional[bool] = None,
|
|
6348
6351
|
pretty: t.Optional[bool] = None,
|
|
6349
|
-
requests_per_second: t.Optional[float] = None,
|
|
6350
6352
|
) -> ObjectApiResponse[t.Any]:
|
|
6351
6353
|
"""
|
|
6352
6354
|
.. raw:: html
|
|
@@ -6364,9 +6366,13 @@ class Elasticsearch(BaseClient):
|
|
|
6364
6366
|
"""
|
|
6365
6367
|
if task_id in SKIP_IN_PATH:
|
|
6366
6368
|
raise ValueError("Empty value passed for parameter 'task_id'")
|
|
6369
|
+
if requests_per_second is None:
|
|
6370
|
+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
|
|
6367
6371
|
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
|
|
6368
6372
|
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
|
|
6369
6373
|
__query: t.Dict[str, t.Any] = {}
|
|
6374
|
+
if requests_per_second is not None:
|
|
6375
|
+
__query["requests_per_second"] = requests_per_second
|
|
6370
6376
|
if error_trace is not None:
|
|
6371
6377
|
__query["error_trace"] = error_trace
|
|
6372
6378
|
if filter_path is not None:
|
|
@@ -6375,8 +6381,6 @@ class Elasticsearch(BaseClient):
|
|
|
6375
6381
|
__query["human"] = human
|
|
6376
6382
|
if pretty is not None:
|
|
6377
6383
|
__query["pretty"] = pretty
|
|
6378
|
-
if requests_per_second is not None:
|
|
6379
|
-
__query["requests_per_second"] = requests_per_second
|
|
6380
6384
|
__headers = {"accept": "application/json"}
|
|
6381
6385
|
return self.perform_request( # type: ignore[return-value]
|
|
6382
6386
|
"POST",
|
|
@@ -357,7 +357,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
357
357
|
:param allow_partial_search_results: Indicate if an error should be returned
|
|
358
358
|
if there is a partial search failure or timeout
|
|
359
359
|
:param analyze_wildcard: Specify whether wildcard and prefix queries should be
|
|
360
|
-
analyzed
|
|
360
|
+
analyzed
|
|
361
361
|
:param analyzer: The analyzer to use for the query string
|
|
362
362
|
:param batched_reduce_size: Affects how often partial results become available,
|
|
363
363
|
which happens whenever shard results are reduced. A partial reduction is
|
|
@@ -373,7 +373,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
373
373
|
values for field names matching these patterns in the hits.fields property
|
|
374
374
|
of the response.
|
|
375
375
|
:param expand_wildcards: Whether to expand wildcard expression to concrete indices
|
|
376
|
-
that are open, closed or both
|
|
376
|
+
that are open, closed or both
|
|
377
377
|
:param explain: If true, returns detailed information about score computation
|
|
378
378
|
as part of a hit.
|
|
379
379
|
:param ext: Configuration of search extensions defined by Elasticsearch plugins.
|
|
@@ -406,7 +406,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
406
406
|
you cannot specify an <index> in the request path.
|
|
407
407
|
:param post_filter:
|
|
408
408
|
:param preference: Specify the node or shard the operation should be performed
|
|
409
|
-
on
|
|
409
|
+
on
|
|
410
410
|
:param profile:
|
|
411
411
|
:param q: Query in the Lucene query string syntax
|
|
412
412
|
:param query: Defines the search definition using the Query DSL.
|
|
@@ -20,7 +20,11 @@ import typing as t
|
|
|
20
20
|
from elastic_transport import ObjectApiResponse
|
|
21
21
|
|
|
22
22
|
from ._base import NamespacedClient
|
|
23
|
-
from .utils import
|
|
23
|
+
from .utils import (
|
|
24
|
+
SKIP_IN_PATH,
|
|
25
|
+
_quote,
|
|
26
|
+
_rewrite_parameters,
|
|
27
|
+
)
|
|
24
28
|
|
|
25
29
|
|
|
26
30
|
class AutoscalingClient(NamespacedClient):
|
|
@@ -46,7 +50,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
46
50
|
|
|
47
51
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-delete-autoscaling-policy>`_
|
|
48
52
|
|
|
49
|
-
:param name:
|
|
53
|
+
:param name: Name of the autoscaling policy
|
|
50
54
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
51
55
|
no response is received before the timeout expires, the request fails and
|
|
52
56
|
returns an error.
|
|
@@ -153,7 +157,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
153
157
|
|
|
154
158
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity>`_
|
|
155
159
|
|
|
156
|
-
:param name:
|
|
160
|
+
:param name: Name of the autoscaling policy
|
|
157
161
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
158
162
|
no response is received before the timeout expires, the request fails and
|
|
159
163
|
returns an error.
|
|
@@ -208,7 +212,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
208
212
|
|
|
209
213
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-put-autoscaling-policy>`_
|
|
210
214
|
|
|
211
|
-
:param name:
|
|
215
|
+
:param name: Name of the autoscaling policy
|
|
212
216
|
:param policy:
|
|
213
217
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
214
218
|
no response is received before the timeout expires, the request fails and
|