elasticsearch 8.17.2__py3-none-any.whl → 8.18.1__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/_async/client/__init__.py +174 -79
- elasticsearch/_async/client/_base.py +0 -1
- elasticsearch/_async/client/async_search.py +12 -8
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +26 -26
- elasticsearch/_async/client/ccr.py +186 -72
- elasticsearch/_async/client/cluster.py +38 -19
- elasticsearch/_async/client/connector.py +30 -30
- elasticsearch/_async/client/dangling_indices.py +3 -3
- elasticsearch/_async/client/enrich.py +26 -5
- elasticsearch/_async/client/eql.py +32 -4
- elasticsearch/_async/client/esql.py +62 -6
- elasticsearch/_async/client/features.py +12 -2
- elasticsearch/_async/client/fleet.py +8 -2
- elasticsearch/_async/client/graph.py +1 -1
- elasticsearch/_async/client/ilm.py +23 -22
- elasticsearch/_async/client/indices.py +424 -132
- elasticsearch/_async/client/inference.py +1906 -61
- elasticsearch/_async/client/ingest.py +32 -38
- elasticsearch/_async/client/license.py +51 -16
- elasticsearch/_async/client/logstash.py +3 -3
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +144 -115
- elasticsearch/_async/client/monitoring.py +1 -1
- elasticsearch/_async/client/nodes.py +9 -27
- elasticsearch/_async/client/query_rules.py +8 -8
- elasticsearch/_async/client/rollup.py +8 -8
- elasticsearch/_async/client/search_application.py +13 -13
- elasticsearch/_async/client/searchable_snapshots.py +4 -4
- elasticsearch/_async/client/security.py +71 -71
- elasticsearch/_async/client/shutdown.py +3 -10
- elasticsearch/_async/client/simulate.py +6 -6
- elasticsearch/_async/client/slm.py +9 -9
- elasticsearch/_async/client/snapshot.py +13 -17
- elasticsearch/_async/client/sql.py +6 -6
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +7 -7
- elasticsearch/_async/client/tasks.py +3 -9
- elasticsearch/_async/client/text_structure.py +4 -4
- elasticsearch/_async/client/transform.py +30 -28
- elasticsearch/_async/client/watcher.py +22 -14
- elasticsearch/_async/client/xpack.py +2 -2
- elasticsearch/_async/helpers.py +0 -1
- elasticsearch/_sync/client/__init__.py +174 -79
- elasticsearch/_sync/client/_base.py +0 -1
- elasticsearch/_sync/client/async_search.py +12 -8
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +26 -26
- elasticsearch/_sync/client/ccr.py +186 -72
- elasticsearch/_sync/client/cluster.py +38 -19
- elasticsearch/_sync/client/connector.py +30 -30
- elasticsearch/_sync/client/dangling_indices.py +3 -3
- elasticsearch/_sync/client/enrich.py +26 -5
- elasticsearch/_sync/client/eql.py +32 -4
- elasticsearch/_sync/client/esql.py +62 -6
- elasticsearch/_sync/client/features.py +12 -2
- elasticsearch/_sync/client/fleet.py +8 -2
- elasticsearch/_sync/client/graph.py +1 -1
- elasticsearch/_sync/client/ilm.py +23 -22
- elasticsearch/_sync/client/indices.py +424 -132
- elasticsearch/_sync/client/inference.py +1906 -61
- elasticsearch/_sync/client/ingest.py +32 -38
- elasticsearch/_sync/client/license.py +51 -16
- elasticsearch/_sync/client/logstash.py +3 -3
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +144 -115
- elasticsearch/_sync/client/monitoring.py +1 -1
- elasticsearch/_sync/client/nodes.py +9 -27
- elasticsearch/_sync/client/query_rules.py +8 -8
- elasticsearch/_sync/client/rollup.py +8 -8
- elasticsearch/_sync/client/search_application.py +13 -13
- elasticsearch/_sync/client/searchable_snapshots.py +4 -4
- elasticsearch/_sync/client/security.py +71 -71
- elasticsearch/_sync/client/shutdown.py +3 -10
- elasticsearch/_sync/client/simulate.py +6 -6
- elasticsearch/_sync/client/slm.py +9 -9
- elasticsearch/_sync/client/snapshot.py +13 -17
- elasticsearch/_sync/client/sql.py +6 -6
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +7 -7
- elasticsearch/_sync/client/tasks.py +3 -9
- elasticsearch/_sync/client/text_structure.py +4 -4
- elasticsearch/_sync/client/transform.py +30 -28
- elasticsearch/_sync/client/utils.py +0 -3
- elasticsearch/_sync/client/watcher.py +22 -14
- elasticsearch/_sync/client/xpack.py +2 -2
- elasticsearch/_version.py +1 -1
- 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 +4392 -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 +2822 -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 +6509 -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-8.17.2.dist-info → elasticsearch-8.18.1.dist-info}/METADATA +14 -2
- elasticsearch-8.18.1.dist-info/RECORD +163 -0
- elasticsearch-8.18.1.dist-info/licenses/LICENSE.txt +175 -0
- elasticsearch-8.18.1.dist-info/licenses/NOTICE.txt +559 -0
- elasticsearch-8.17.2.dist-info/RECORD +0 -119
- {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.1.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.1.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.2.dist-info → elasticsearch-8.18.1.dist-info}/licenses/NOTICE +0 -0
|
@@ -57,23 +57,40 @@ class IndicesClient(NamespacedClient):
|
|
|
57
57
|
"""
|
|
58
58
|
.. raw:: html
|
|
59
59
|
|
|
60
|
-
<p>Add an index block
|
|
61
|
-
|
|
60
|
+
<p>Add an index block.</p>
|
|
61
|
+
<p>Add an index block to an index.
|
|
62
|
+
Index blocks limit the operations allowed on an index by blocking specific operation types.</p>
|
|
62
63
|
|
|
63
64
|
|
|
64
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
65
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/index-modules-blocks.html#add-index-block>`_
|
|
65
66
|
|
|
66
|
-
:param index: A comma
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
:param
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
:param index: A comma-separated list or wildcard expression of index names used
|
|
68
|
+
to limit the request. By default, you must explicitly name the indices you
|
|
69
|
+
are adding blocks to. To allow the adding of blocks to indices with `_all`,
|
|
70
|
+
`*`, or other wildcard expressions, change the `action.destructive_requires_name`
|
|
71
|
+
setting to `false`. You can update this setting in the `elasticsearch.yml`
|
|
72
|
+
file or by using the cluster update settings API.
|
|
73
|
+
:param block: The block type to add to the index.
|
|
74
|
+
:param allow_no_indices: If `false`, the request returns an error if any wildcard
|
|
75
|
+
expression, index alias, or `_all` value targets only missing or closed indices.
|
|
76
|
+
This behavior applies even if the request targets other open indices. For
|
|
77
|
+
example, a request targeting `foo*,bar*` returns an error if an index starts
|
|
78
|
+
with `foo` but no index starts with `bar`.
|
|
79
|
+
:param expand_wildcards: The type of index that wildcard patterns can match.
|
|
80
|
+
If the request can target data streams, this argument determines whether
|
|
81
|
+
wildcard expressions match hidden data streams. It supports comma-separated
|
|
82
|
+
values, such as `open,hidden`.
|
|
83
|
+
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
84
|
+
a missing or closed index.
|
|
85
|
+
:param master_timeout: The period to wait for the master node. If the master
|
|
86
|
+
node is not available before the timeout expires, the request fails and returns
|
|
87
|
+
an error. It can also be set to `-1` to indicate that the request should
|
|
88
|
+
never timeout.
|
|
89
|
+
:param timeout: The period to wait for a response from all relevant nodes in
|
|
90
|
+
the cluster after updating the cluster metadata. If no response is received
|
|
91
|
+
before the timeout expires, the cluster metadata update still applies but
|
|
92
|
+
the response will indicate that it was not completely acknowledged. It can
|
|
93
|
+
also be set to `-1` to indicate that the request should never timeout.
|
|
77
94
|
"""
|
|
78
95
|
if index in SKIP_IN_PATH:
|
|
79
96
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
@@ -156,7 +173,7 @@ class IndicesClient(NamespacedClient):
|
|
|
156
173
|
The <code>_analyze</code> endpoint without a specified index will always use <code>10000</code> as its limit.</p>
|
|
157
174
|
|
|
158
175
|
|
|
159
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
176
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-analyze.html>`_
|
|
160
177
|
|
|
161
178
|
:param index: Index used to derive the analyzer. If specified, the `analyzer`
|
|
162
179
|
or field parameter overrides this value. If no index is specified or the
|
|
@@ -230,6 +247,51 @@ class IndicesClient(NamespacedClient):
|
|
|
230
247
|
path_parts=__path_parts,
|
|
231
248
|
)
|
|
232
249
|
|
|
250
|
+
@_rewrite_parameters()
|
|
251
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
252
|
+
def cancel_migrate_reindex(
|
|
253
|
+
self,
|
|
254
|
+
*,
|
|
255
|
+
index: t.Union[str, t.Sequence[str]],
|
|
256
|
+
error_trace: t.Optional[bool] = None,
|
|
257
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
258
|
+
human: t.Optional[bool] = None,
|
|
259
|
+
pretty: t.Optional[bool] = None,
|
|
260
|
+
) -> ObjectApiResponse[t.Any]:
|
|
261
|
+
"""
|
|
262
|
+
.. raw:: html
|
|
263
|
+
|
|
264
|
+
<p>Cancel a migration reindex operation.</p>
|
|
265
|
+
<p>Cancel a migration reindex attempt for a data stream or index.</p>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/migrate-data-stream.html>`_
|
|
269
|
+
|
|
270
|
+
:param index: The index or data stream name
|
|
271
|
+
"""
|
|
272
|
+
if index in SKIP_IN_PATH:
|
|
273
|
+
raise ValueError("Empty value passed for parameter 'index'")
|
|
274
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
275
|
+
__path = f'/_migration/reindex/{__path_parts["index"]}/_cancel'
|
|
276
|
+
__query: t.Dict[str, t.Any] = {}
|
|
277
|
+
if error_trace is not None:
|
|
278
|
+
__query["error_trace"] = error_trace
|
|
279
|
+
if filter_path is not None:
|
|
280
|
+
__query["filter_path"] = filter_path
|
|
281
|
+
if human is not None:
|
|
282
|
+
__query["human"] = human
|
|
283
|
+
if pretty is not None:
|
|
284
|
+
__query["pretty"] = pretty
|
|
285
|
+
__headers = {"accept": "application/json"}
|
|
286
|
+
return self.perform_request( # type: ignore[return-value]
|
|
287
|
+
"POST",
|
|
288
|
+
__path,
|
|
289
|
+
params=__query,
|
|
290
|
+
headers=__headers,
|
|
291
|
+
endpoint_id="indices.cancel_migrate_reindex",
|
|
292
|
+
path_parts=__path_parts,
|
|
293
|
+
)
|
|
294
|
+
|
|
233
295
|
@_rewrite_parameters()
|
|
234
296
|
def clear_cache(
|
|
235
297
|
self,
|
|
@@ -265,7 +327,7 @@ class IndicesClient(NamespacedClient):
|
|
|
265
327
|
To clear the cache only of specific fields, use the <code>fields</code> parameter.</p>
|
|
266
328
|
|
|
267
329
|
|
|
268
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
330
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-clearcache.html>`_
|
|
269
331
|
|
|
270
332
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
271
333
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -387,7 +449,7 @@ class IndicesClient(NamespacedClient):
|
|
|
387
449
|
<p>Because the clone operation creates a new index to clone the shards to, the wait for active shards setting on index creation applies to the clone index action as well.</p>
|
|
388
450
|
|
|
389
451
|
|
|
390
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
452
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-clone-index.html>`_
|
|
391
453
|
|
|
392
454
|
:param index: Name of the source index to clone.
|
|
393
455
|
:param target: Name of the target index to create.
|
|
@@ -491,7 +553,7 @@ class IndicesClient(NamespacedClient):
|
|
|
491
553
|
Closing indices can be turned off with the cluster settings API by setting <code>cluster.indices.close.enable</code> to <code>false</code>.</p>
|
|
492
554
|
|
|
493
555
|
|
|
494
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
556
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-close.html>`_
|
|
495
557
|
|
|
496
558
|
:param index: Comma-separated list or wildcard expression of index names used
|
|
497
559
|
to limit the request.
|
|
@@ -592,7 +654,7 @@ class IndicesClient(NamespacedClient):
|
|
|
592
654
|
Note that changing this setting will also affect the <code>wait_for_active_shards</code> value on all subsequent write operations.</p>
|
|
593
655
|
|
|
594
656
|
|
|
595
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
657
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-create-index.html>`_
|
|
596
658
|
|
|
597
659
|
:param index: Name of the index you wish to create.
|
|
598
660
|
:param aliases: Aliases for the index.
|
|
@@ -665,12 +727,11 @@ class IndicesClient(NamespacedClient):
|
|
|
665
727
|
"""
|
|
666
728
|
.. raw:: html
|
|
667
729
|
|
|
668
|
-
<p>Create a data stream
|
|
669
|
-
|
|
670
|
-
You must have a matching index template with data stream enabled.</p>
|
|
730
|
+
<p>Create a data stream.</p>
|
|
731
|
+
<p>You must have a matching index template with data stream enabled.</p>
|
|
671
732
|
|
|
672
733
|
|
|
673
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
734
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-create-data-stream.html>`_
|
|
674
735
|
|
|
675
736
|
:param name: Name of the data stream, which must meet the following criteria:
|
|
676
737
|
Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`,
|
|
@@ -710,6 +771,71 @@ class IndicesClient(NamespacedClient):
|
|
|
710
771
|
path_parts=__path_parts,
|
|
711
772
|
)
|
|
712
773
|
|
|
774
|
+
@_rewrite_parameters(
|
|
775
|
+
body_name="create_from",
|
|
776
|
+
)
|
|
777
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
778
|
+
def create_from(
|
|
779
|
+
self,
|
|
780
|
+
*,
|
|
781
|
+
source: str,
|
|
782
|
+
dest: str,
|
|
783
|
+
create_from: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
784
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
785
|
+
error_trace: t.Optional[bool] = None,
|
|
786
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
787
|
+
human: t.Optional[bool] = None,
|
|
788
|
+
pretty: t.Optional[bool] = None,
|
|
789
|
+
) -> ObjectApiResponse[t.Any]:
|
|
790
|
+
"""
|
|
791
|
+
.. raw:: html
|
|
792
|
+
|
|
793
|
+
<p>Create an index from a source index.</p>
|
|
794
|
+
<p>Copy the mappings and settings from the source index to a destination index while allowing request settings and mappings to override the source values.</p>
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/migrate-data-stream.html>`_
|
|
798
|
+
|
|
799
|
+
:param source: The source index or data stream name
|
|
800
|
+
:param dest: The destination index or data stream name
|
|
801
|
+
:param create_from:
|
|
802
|
+
"""
|
|
803
|
+
if source in SKIP_IN_PATH:
|
|
804
|
+
raise ValueError("Empty value passed for parameter 'source'")
|
|
805
|
+
if dest in SKIP_IN_PATH:
|
|
806
|
+
raise ValueError("Empty value passed for parameter 'dest'")
|
|
807
|
+
if create_from is None and body is None:
|
|
808
|
+
raise ValueError(
|
|
809
|
+
"Empty value passed for parameters 'create_from' and 'body', one of them should be set."
|
|
810
|
+
)
|
|
811
|
+
elif create_from is not None and body is not None:
|
|
812
|
+
raise ValueError("Cannot set both 'create_from' and 'body'")
|
|
813
|
+
__path_parts: t.Dict[str, str] = {
|
|
814
|
+
"source": _quote(source),
|
|
815
|
+
"dest": _quote(dest),
|
|
816
|
+
}
|
|
817
|
+
__path = f'/_create_from/{__path_parts["source"]}/{__path_parts["dest"]}'
|
|
818
|
+
__query: t.Dict[str, t.Any] = {}
|
|
819
|
+
if error_trace is not None:
|
|
820
|
+
__query["error_trace"] = error_trace
|
|
821
|
+
if filter_path is not None:
|
|
822
|
+
__query["filter_path"] = filter_path
|
|
823
|
+
if human is not None:
|
|
824
|
+
__query["human"] = human
|
|
825
|
+
if pretty is not None:
|
|
826
|
+
__query["pretty"] = pretty
|
|
827
|
+
__body = create_from if create_from is not None else body
|
|
828
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
829
|
+
return self.perform_request( # type: ignore[return-value]
|
|
830
|
+
"PUT",
|
|
831
|
+
__path,
|
|
832
|
+
params=__query,
|
|
833
|
+
headers=__headers,
|
|
834
|
+
body=__body,
|
|
835
|
+
endpoint_id="indices.create_from",
|
|
836
|
+
path_parts=__path_parts,
|
|
837
|
+
)
|
|
838
|
+
|
|
713
839
|
@_rewrite_parameters()
|
|
714
840
|
def data_streams_stats(
|
|
715
841
|
self,
|
|
@@ -731,11 +857,11 @@ class IndicesClient(NamespacedClient):
|
|
|
731
857
|
"""
|
|
732
858
|
.. raw:: html
|
|
733
859
|
|
|
734
|
-
<p>Get data stream stats
|
|
735
|
-
|
|
860
|
+
<p>Get data stream stats.</p>
|
|
861
|
+
<p>Get statistics for one or more data streams.</p>
|
|
736
862
|
|
|
737
863
|
|
|
738
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
864
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-stream-stats-api.html>`_
|
|
739
865
|
|
|
740
866
|
:param name: Comma-separated list of data streams used to limit the request.
|
|
741
867
|
Wildcard expressions (`*`) are supported. To target all data streams in a
|
|
@@ -804,7 +930,7 @@ class IndicesClient(NamespacedClient):
|
|
|
804
930
|
You can then use the delete index API to delete the previous write index.</p>
|
|
805
931
|
|
|
806
932
|
|
|
807
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
933
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-index.html>`_
|
|
808
934
|
|
|
809
935
|
:param index: Comma-separated list of indices to delete. You cannot specify index
|
|
810
936
|
aliases. By default, this parameter does not support wildcards (`*`) or `_all`.
|
|
@@ -878,7 +1004,7 @@ class IndicesClient(NamespacedClient):
|
|
|
878
1004
|
Removes a data stream or index from an alias.</p>
|
|
879
1005
|
|
|
880
1006
|
|
|
881
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1007
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-alias.html>`_
|
|
882
1008
|
|
|
883
1009
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
884
1010
|
request. Supports wildcards (`*`).
|
|
@@ -946,7 +1072,7 @@ class IndicesClient(NamespacedClient):
|
|
|
946
1072
|
Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle.</p>
|
|
947
1073
|
|
|
948
1074
|
|
|
949
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1075
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-streams-delete-lifecycle.html>`_
|
|
950
1076
|
|
|
951
1077
|
:param name: A comma-separated list of data streams of which the data stream
|
|
952
1078
|
lifecycle will be deleted; use `*` to get all data streams
|
|
@@ -1010,7 +1136,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1010
1136
|
Deletes one or more data streams and their backing indices.</p>
|
|
1011
1137
|
|
|
1012
1138
|
|
|
1013
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1139
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-data-stream.html>`_
|
|
1014
1140
|
|
|
1015
1141
|
:param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions
|
|
1016
1142
|
are supported.
|
|
@@ -1068,7 +1194,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1068
1194
|
existing templates.</p>
|
|
1069
1195
|
|
|
1070
1196
|
|
|
1071
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1197
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-template.html>`_
|
|
1072
1198
|
|
|
1073
1199
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
1074
1200
|
Wildcard (*) expressions are supported.
|
|
@@ -1123,7 +1249,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1123
1249
|
<p>Delete a legacy index template.</p>
|
|
1124
1250
|
|
|
1125
1251
|
|
|
1126
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1252
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-template-v1.html>`_
|
|
1127
1253
|
|
|
1128
1254
|
:param name: The name of the legacy index template to delete. Wildcard (`*`)
|
|
1129
1255
|
expressions are supported.
|
|
@@ -1195,7 +1321,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1195
1321
|
The stored size of the <code>_id</code> field is likely underestimated while the <code>_source</code> field is overestimated.</p>
|
|
1196
1322
|
|
|
1197
1323
|
|
|
1198
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1324
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-disk-usage.html>`_
|
|
1199
1325
|
|
|
1200
1326
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
1201
1327
|
to limit the request. It’s recommended to execute this API with a single
|
|
@@ -1278,7 +1404,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1278
1404
|
The source index must be read only (<code>index.blocks.write: true</code>).</p>
|
|
1279
1405
|
|
|
1280
1406
|
|
|
1281
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1407
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-downsample-data-stream.html>`_
|
|
1282
1408
|
|
|
1283
1409
|
:param index: Name of the time series index to downsample.
|
|
1284
1410
|
:param target_index: Name of the index to create.
|
|
@@ -1350,7 +1476,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1350
1476
|
Check if one or more indices, index aliases, or data streams exist.</p>
|
|
1351
1477
|
|
|
1352
1478
|
|
|
1353
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1479
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-exists.html>`_
|
|
1354
1480
|
|
|
1355
1481
|
:param index: Comma-separated list of data streams, indices, and aliases. Supports
|
|
1356
1482
|
wildcards (`*`).
|
|
@@ -1428,11 +1554,11 @@ class IndicesClient(NamespacedClient):
|
|
|
1428
1554
|
"""
|
|
1429
1555
|
.. raw:: html
|
|
1430
1556
|
|
|
1431
|
-
<p>Check aliases
|
|
1432
|
-
|
|
1557
|
+
<p>Check aliases.</p>
|
|
1558
|
+
<p>Check if one or more data stream or index aliases exist.</p>
|
|
1433
1559
|
|
|
1434
1560
|
|
|
1435
|
-
`<https://www.elastic.co/
|
|
1561
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-exists-alias>`_
|
|
1436
1562
|
|
|
1437
1563
|
:param name: Comma-separated list of aliases to check. Supports wildcards (`*`).
|
|
1438
1564
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
@@ -1495,21 +1621,27 @@ class IndicesClient(NamespacedClient):
|
|
|
1495
1621
|
name: str,
|
|
1496
1622
|
error_trace: t.Optional[bool] = None,
|
|
1497
1623
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1624
|
+
flat_settings: t.Optional[bool] = None,
|
|
1498
1625
|
human: t.Optional[bool] = None,
|
|
1626
|
+
local: t.Optional[bool] = None,
|
|
1499
1627
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1500
1628
|
pretty: t.Optional[bool] = None,
|
|
1501
1629
|
) -> HeadApiResponse:
|
|
1502
1630
|
"""
|
|
1503
1631
|
.. raw:: html
|
|
1504
1632
|
|
|
1505
|
-
<p>Check index templates
|
|
1506
|
-
Check whether index templates exist.</p>
|
|
1633
|
+
<p>Check index templates.</p>
|
|
1634
|
+
<p>Check whether index templates exist.</p>
|
|
1507
1635
|
|
|
1508
1636
|
|
|
1509
|
-
`<https://www.elastic.co/
|
|
1637
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-exists-index-template>`_
|
|
1510
1638
|
|
|
1511
1639
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
1512
1640
|
Wildcard (*) expressions are supported.
|
|
1641
|
+
:param flat_settings: If true, returns settings in flat format.
|
|
1642
|
+
:param local: If true, the request retrieves information from the local node
|
|
1643
|
+
only. Defaults to false, which means information is retrieved from the master
|
|
1644
|
+
node.
|
|
1513
1645
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
1514
1646
|
no response is received before the timeout expires, the request fails and
|
|
1515
1647
|
returns an error.
|
|
@@ -1523,8 +1655,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1523
1655
|
__query["error_trace"] = error_trace
|
|
1524
1656
|
if filter_path is not None:
|
|
1525
1657
|
__query["filter_path"] = filter_path
|
|
1658
|
+
if flat_settings is not None:
|
|
1659
|
+
__query["flat_settings"] = flat_settings
|
|
1526
1660
|
if human is not None:
|
|
1527
1661
|
__query["human"] = human
|
|
1662
|
+
if local is not None:
|
|
1663
|
+
__query["local"] = local
|
|
1528
1664
|
if master_timeout is not None:
|
|
1529
1665
|
__query["master_timeout"] = master_timeout
|
|
1530
1666
|
if pretty is not None:
|
|
@@ -1561,7 +1697,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1561
1697
|
<p>IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
|
|
1562
1698
|
|
|
1563
1699
|
|
|
1564
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1700
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-template-exists-v1.html>`_
|
|
1565
1701
|
|
|
1566
1702
|
:param name: A comma-separated list of index template names used to limit the
|
|
1567
1703
|
request. Wildcard (`*`) expressions are supported.
|
|
@@ -1619,7 +1755,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1619
1755
|
Get information about an index or data stream's current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution.</p>
|
|
1620
1756
|
|
|
1621
1757
|
|
|
1622
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1758
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-streams-explain-lifecycle.html>`_
|
|
1623
1759
|
|
|
1624
1760
|
:param index: The name of the index to explain
|
|
1625
1761
|
:param include_defaults: indicates if the API should return the default values
|
|
@@ -1673,12 +1809,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1673
1809
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1674
1810
|
human: t.Optional[bool] = None,
|
|
1675
1811
|
ignore_unavailable: t.Optional[bool] = None,
|
|
1676
|
-
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1677
1812
|
pretty: t.Optional[bool] = None,
|
|
1678
|
-
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1679
|
-
wait_for_active_shards: t.Optional[
|
|
1680
|
-
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
|
|
1681
|
-
] = None,
|
|
1682
1813
|
) -> ObjectApiResponse[t.Any]:
|
|
1683
1814
|
"""
|
|
1684
1815
|
.. raw:: html
|
|
@@ -1691,7 +1822,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1691
1822
|
A given request will increment each count by a maximum value of 1, even if the request accesses the same field multiple times.</p>
|
|
1692
1823
|
|
|
1693
1824
|
|
|
1694
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1825
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/field-usage-stats.html>`_
|
|
1695
1826
|
|
|
1696
1827
|
:param index: Comma-separated list or wildcard expression of index names used
|
|
1697
1828
|
to limit the request.
|
|
@@ -1708,14 +1839,6 @@ class IndicesClient(NamespacedClient):
|
|
|
1708
1839
|
in the statistics.
|
|
1709
1840
|
:param ignore_unavailable: If `true`, missing or closed indices are not included
|
|
1710
1841
|
in the response.
|
|
1711
|
-
:param master_timeout: Period to wait for a connection to the master node. If
|
|
1712
|
-
no response is received before the timeout expires, the request fails and
|
|
1713
|
-
returns an error.
|
|
1714
|
-
:param timeout: Period to wait for a response. If no response is received before
|
|
1715
|
-
the timeout expires, the request fails and returns an error.
|
|
1716
|
-
:param wait_for_active_shards: The number of shard copies that must be active
|
|
1717
|
-
before proceeding with the operation. Set to all or any positive integer
|
|
1718
|
-
up to the total number of shards in the index (`number_of_replicas+1`).
|
|
1719
1842
|
"""
|
|
1720
1843
|
if index in SKIP_IN_PATH:
|
|
1721
1844
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
@@ -1736,14 +1859,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1736
1859
|
__query["human"] = human
|
|
1737
1860
|
if ignore_unavailable is not None:
|
|
1738
1861
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
1739
|
-
if master_timeout is not None:
|
|
1740
|
-
__query["master_timeout"] = master_timeout
|
|
1741
1862
|
if pretty is not None:
|
|
1742
1863
|
__query["pretty"] = pretty
|
|
1743
|
-
if timeout is not None:
|
|
1744
|
-
__query["timeout"] = timeout
|
|
1745
|
-
if wait_for_active_shards is not None:
|
|
1746
|
-
__query["wait_for_active_shards"] = wait_for_active_shards
|
|
1747
1864
|
__headers = {"accept": "application/json"}
|
|
1748
1865
|
return self.perform_request( # type: ignore[return-value]
|
|
1749
1866
|
"GET",
|
|
@@ -1790,7 +1907,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1790
1907
|
If you call the flush API after indexing some documents then a successful response indicates that Elasticsearch has flushed all the documents that were indexed before the flush API was called.</p>
|
|
1791
1908
|
|
|
1792
1909
|
|
|
1793
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1910
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-flush.html>`_
|
|
1794
1911
|
|
|
1795
1912
|
:param index: Comma-separated list of data streams, indices, and aliases to flush.
|
|
1796
1913
|
Supports wildcards (`*`). To flush all data streams and indices, omit this
|
|
@@ -1915,7 +2032,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1915
2032
|
</code></pre>
|
|
1916
2033
|
|
|
1917
2034
|
|
|
1918
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2035
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-forcemerge.html>`_
|
|
1919
2036
|
|
|
1920
2037
|
:param index: A comma-separated list of index names; use `_all` or empty string
|
|
1921
2038
|
to perform the operation on all indices
|
|
@@ -2013,7 +2130,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2013
2130
|
stream’s backing indices.</p>
|
|
2014
2131
|
|
|
2015
2132
|
|
|
2016
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2133
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-index.html>`_
|
|
2017
2134
|
|
|
2018
2135
|
:param index: Comma-separated list of data streams, indices, and index aliases
|
|
2019
2136
|
used to limit the request. Wildcard expressions (*) are supported.
|
|
@@ -2106,7 +2223,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2106
2223
|
Retrieves information for one or more data stream or index aliases.</p>
|
|
2107
2224
|
|
|
2108
2225
|
|
|
2109
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2226
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-alias.html>`_
|
|
2110
2227
|
|
|
2111
2228
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
2112
2229
|
request. Supports wildcards (`*`). To target all data streams and indices,
|
|
@@ -2188,11 +2305,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2188
2305
|
"""
|
|
2189
2306
|
.. raw:: html
|
|
2190
2307
|
|
|
2191
|
-
<p>Get data stream lifecycles
|
|
2192
|
-
|
|
2308
|
+
<p>Get data stream lifecycles.</p>
|
|
2309
|
+
<p>Get the data stream lifecycle configuration of one or more data streams.</p>
|
|
2193
2310
|
|
|
2194
2311
|
|
|
2195
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2312
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-streams-get-lifecycle.html>`_
|
|
2196
2313
|
|
|
2197
2314
|
:param name: Comma-separated list of data streams to limit the request. Supports
|
|
2198
2315
|
wildcards (`*`). To target all data streams, omit this parameter or use `*`
|
|
@@ -2250,7 +2367,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2250
2367
|
Get statistics about the data streams that are managed by a data stream lifecycle.</p>
|
|
2251
2368
|
|
|
2252
2369
|
|
|
2253
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2370
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-streams-get-lifecycle-stats.html>`_
|
|
2254
2371
|
"""
|
|
2255
2372
|
__path_parts: t.Dict[str, str] = {}
|
|
2256
2373
|
__path = "/_lifecycle/stats"
|
|
@@ -2297,11 +2414,11 @@ class IndicesClient(NamespacedClient):
|
|
|
2297
2414
|
"""
|
|
2298
2415
|
.. raw:: html
|
|
2299
2416
|
|
|
2300
|
-
<p>Get data streams
|
|
2301
|
-
|
|
2417
|
+
<p>Get data streams.</p>
|
|
2418
|
+
<p>Get information about one or more data streams.</p>
|
|
2302
2419
|
|
|
2303
2420
|
|
|
2304
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2421
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-data-stream.html>`_
|
|
2305
2422
|
|
|
2306
2423
|
:param name: Comma-separated list of data stream names used to limit the request.
|
|
2307
2424
|
Wildcard (`*`) expressions are supported. If omitted, all data streams are
|
|
@@ -2382,7 +2499,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2382
2499
|
<p>This API is useful if you don't need a complete mapping or if an index mapping contains a large number of fields.</p>
|
|
2383
2500
|
|
|
2384
2501
|
|
|
2385
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2502
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-field-mapping.html>`_
|
|
2386
2503
|
|
|
2387
2504
|
:param fields: Comma-separated list or wildcard expression of fields used to
|
|
2388
2505
|
limit returned information. Supports wildcards (`*`).
|
|
@@ -2463,7 +2580,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2463
2580
|
Get information about one or more index templates.</p>
|
|
2464
2581
|
|
|
2465
2582
|
|
|
2466
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2583
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-template.html>`_
|
|
2467
2584
|
|
|
2468
2585
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
2469
2586
|
Wildcard (*) expressions are supported.
|
|
@@ -2540,7 +2657,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2540
2657
|
For data streams, the API retrieves mappings for the stream’s backing indices.</p>
|
|
2541
2658
|
|
|
2542
2659
|
|
|
2543
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2660
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-mapping.html>`_
|
|
2544
2661
|
|
|
2545
2662
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2546
2663
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -2596,6 +2713,51 @@ class IndicesClient(NamespacedClient):
|
|
|
2596
2713
|
path_parts=__path_parts,
|
|
2597
2714
|
)
|
|
2598
2715
|
|
|
2716
|
+
@_rewrite_parameters()
|
|
2717
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
2718
|
+
def get_migrate_reindex_status(
|
|
2719
|
+
self,
|
|
2720
|
+
*,
|
|
2721
|
+
index: t.Union[str, t.Sequence[str]],
|
|
2722
|
+
error_trace: t.Optional[bool] = None,
|
|
2723
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2724
|
+
human: t.Optional[bool] = None,
|
|
2725
|
+
pretty: t.Optional[bool] = None,
|
|
2726
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2727
|
+
"""
|
|
2728
|
+
.. raw:: html
|
|
2729
|
+
|
|
2730
|
+
<p>Get the migration reindexing status.</p>
|
|
2731
|
+
<p>Get the status of a migration reindex attempt for a data stream or index.</p>
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/migrate-data-stream.html>`_
|
|
2735
|
+
|
|
2736
|
+
:param index: The index or data stream name.
|
|
2737
|
+
"""
|
|
2738
|
+
if index in SKIP_IN_PATH:
|
|
2739
|
+
raise ValueError("Empty value passed for parameter 'index'")
|
|
2740
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
2741
|
+
__path = f'/_migration/reindex/{__path_parts["index"]}/_status'
|
|
2742
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2743
|
+
if error_trace is not None:
|
|
2744
|
+
__query["error_trace"] = error_trace
|
|
2745
|
+
if filter_path is not None:
|
|
2746
|
+
__query["filter_path"] = filter_path
|
|
2747
|
+
if human is not None:
|
|
2748
|
+
__query["human"] = human
|
|
2749
|
+
if pretty is not None:
|
|
2750
|
+
__query["pretty"] = pretty
|
|
2751
|
+
__headers = {"accept": "application/json"}
|
|
2752
|
+
return self.perform_request( # type: ignore[return-value]
|
|
2753
|
+
"GET",
|
|
2754
|
+
__path,
|
|
2755
|
+
params=__query,
|
|
2756
|
+
headers=__headers,
|
|
2757
|
+
endpoint_id="indices.get_migrate_reindex_status",
|
|
2758
|
+
path_parts=__path_parts,
|
|
2759
|
+
)
|
|
2760
|
+
|
|
2599
2761
|
@_rewrite_parameters()
|
|
2600
2762
|
def get_settings(
|
|
2601
2763
|
self,
|
|
@@ -2629,7 +2791,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2629
2791
|
For data streams, it returns setting information for the stream's backing indices.</p>
|
|
2630
2792
|
|
|
2631
2793
|
|
|
2632
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2794
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-settings.html>`_
|
|
2633
2795
|
|
|
2634
2796
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2635
2797
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -2721,7 +2883,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2721
2883
|
<p>IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8.</p>
|
|
2722
2884
|
|
|
2723
2885
|
|
|
2724
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2886
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-template-v1.html>`_
|
|
2725
2887
|
|
|
2726
2888
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
2727
2889
|
Wildcard (`*`) expressions are supported. To return all index templates,
|
|
@@ -2765,6 +2927,62 @@ class IndicesClient(NamespacedClient):
|
|
|
2765
2927
|
path_parts=__path_parts,
|
|
2766
2928
|
)
|
|
2767
2929
|
|
|
2930
|
+
@_rewrite_parameters(
|
|
2931
|
+
body_name="reindex",
|
|
2932
|
+
)
|
|
2933
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
2934
|
+
def migrate_reindex(
|
|
2935
|
+
self,
|
|
2936
|
+
*,
|
|
2937
|
+
reindex: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2938
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
2939
|
+
error_trace: t.Optional[bool] = None,
|
|
2940
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2941
|
+
human: t.Optional[bool] = None,
|
|
2942
|
+
pretty: t.Optional[bool] = None,
|
|
2943
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2944
|
+
"""
|
|
2945
|
+
.. raw:: html
|
|
2946
|
+
|
|
2947
|
+
<p>Reindex legacy backing indices.</p>
|
|
2948
|
+
<p>Reindex all legacy backing indices for a data stream.
|
|
2949
|
+
This operation occurs in a persistent task.
|
|
2950
|
+
The persistent task ID is returned immediately and the reindexing work is completed in that task.</p>
|
|
2951
|
+
|
|
2952
|
+
|
|
2953
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/migrate-data-stream.html>`_
|
|
2954
|
+
|
|
2955
|
+
:param reindex:
|
|
2956
|
+
"""
|
|
2957
|
+
if reindex is None and body is None:
|
|
2958
|
+
raise ValueError(
|
|
2959
|
+
"Empty value passed for parameters 'reindex' and 'body', one of them should be set."
|
|
2960
|
+
)
|
|
2961
|
+
elif reindex is not None and body is not None:
|
|
2962
|
+
raise ValueError("Cannot set both 'reindex' and 'body'")
|
|
2963
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2964
|
+
__path = "/_migration/reindex"
|
|
2965
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2966
|
+
if error_trace is not None:
|
|
2967
|
+
__query["error_trace"] = error_trace
|
|
2968
|
+
if filter_path is not None:
|
|
2969
|
+
__query["filter_path"] = filter_path
|
|
2970
|
+
if human is not None:
|
|
2971
|
+
__query["human"] = human
|
|
2972
|
+
if pretty is not None:
|
|
2973
|
+
__query["pretty"] = pretty
|
|
2974
|
+
__body = reindex if reindex is not None else body
|
|
2975
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2976
|
+
return self.perform_request( # type: ignore[return-value]
|
|
2977
|
+
"POST",
|
|
2978
|
+
__path,
|
|
2979
|
+
params=__query,
|
|
2980
|
+
headers=__headers,
|
|
2981
|
+
body=__body,
|
|
2982
|
+
endpoint_id="indices.migrate_reindex",
|
|
2983
|
+
path_parts=__path_parts,
|
|
2984
|
+
)
|
|
2985
|
+
|
|
2768
2986
|
@_rewrite_parameters()
|
|
2769
2987
|
def migrate_to_data_stream(
|
|
2770
2988
|
self,
|
|
@@ -2793,7 +3011,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2793
3011
|
The write index for the alias becomes the write index for the stream.</p>
|
|
2794
3012
|
|
|
2795
3013
|
|
|
2796
|
-
`<https://www.elastic.co/
|
|
3014
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-migrate-to-data-stream>`_
|
|
2797
3015
|
|
|
2798
3016
|
:param name: Name of the index alias to convert to a data stream.
|
|
2799
3017
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -2849,7 +3067,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2849
3067
|
Performs one or more data stream modification actions in a single atomic operation.</p>
|
|
2850
3068
|
|
|
2851
3069
|
|
|
2852
|
-
`<https://www.elastic.co/
|
|
3070
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-modify-data-stream>`_
|
|
2853
3071
|
|
|
2854
3072
|
:param actions: Actions to perform.
|
|
2855
3073
|
"""
|
|
@@ -2928,7 +3146,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2928
3146
|
<p>Because opening or closing an index allocates its shards, the <code>wait_for_active_shards</code> setting on index creation applies to the <code>_open</code> and <code>_close</code> index actions as well.</p>
|
|
2929
3147
|
|
|
2930
3148
|
|
|
2931
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3149
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-open-close.html>`_
|
|
2932
3150
|
|
|
2933
3151
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2934
3152
|
to limit the request. Supports wildcards (`*`). By default, you must explicitly
|
|
@@ -3014,7 +3232,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3014
3232
|
This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.</p>
|
|
3015
3233
|
|
|
3016
3234
|
|
|
3017
|
-
`<https://www.elastic.co/
|
|
3235
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-promote-data-stream>`_
|
|
3018
3236
|
|
|
3019
3237
|
:param name: The name of the data stream
|
|
3020
3238
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -3080,7 +3298,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3080
3298
|
Adds a data stream or index to an alias.</p>
|
|
3081
3299
|
|
|
3082
3300
|
|
|
3083
|
-
`<https://www.elastic.co/
|
|
3301
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-put-alias>`_
|
|
3084
3302
|
|
|
3085
3303
|
:param index: Comma-separated list of data streams or indices to add. Supports
|
|
3086
3304
|
wildcards (`*`). Wildcard patterns that match both data streams and indices
|
|
@@ -3155,7 +3373,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3155
3373
|
)
|
|
3156
3374
|
|
|
3157
3375
|
@_rewrite_parameters(
|
|
3158
|
-
body_fields=("data_retention", "downsampling"),
|
|
3376
|
+
body_fields=("data_retention", "downsampling", "enabled"),
|
|
3159
3377
|
)
|
|
3160
3378
|
def put_data_lifecycle(
|
|
3161
3379
|
self,
|
|
@@ -3163,6 +3381,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3163
3381
|
name: t.Union[str, t.Sequence[str]],
|
|
3164
3382
|
data_retention: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3165
3383
|
downsampling: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3384
|
+
enabled: t.Optional[bool] = None,
|
|
3166
3385
|
error_trace: t.Optional[bool] = None,
|
|
3167
3386
|
expand_wildcards: t.Optional[
|
|
3168
3387
|
t.Union[
|
|
@@ -3186,7 +3405,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3186
3405
|
Update the data stream lifecycle of the specified data streams.</p>
|
|
3187
3406
|
|
|
3188
3407
|
|
|
3189
|
-
`<https://www.elastic.co/
|
|
3408
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-put-data-lifecycle>`_
|
|
3190
3409
|
|
|
3191
3410
|
:param name: Comma-separated list of data streams used to limit the request.
|
|
3192
3411
|
Supports wildcards (`*`). To target all data streams use `*` or `_all`.
|
|
@@ -3194,9 +3413,11 @@ class IndicesClient(NamespacedClient):
|
|
|
3194
3413
|
be stored at least for this time frame. Any time after this duration the
|
|
3195
3414
|
document could be deleted. When empty, every document in this data stream
|
|
3196
3415
|
will be stored indefinitely.
|
|
3197
|
-
:param downsampling:
|
|
3198
|
-
|
|
3199
|
-
|
|
3416
|
+
:param downsampling: The downsampling configuration to execute for the managed
|
|
3417
|
+
backing index after rollover.
|
|
3418
|
+
:param enabled: If defined, it turns data stream lifecycle on/off (`true`/`false`)
|
|
3419
|
+
for this data stream. A data stream lifecycle that's disabled (enabled: `false`)
|
|
3420
|
+
will have no effect on the data stream.
|
|
3200
3421
|
:param expand_wildcards: Type of data stream that wildcard patterns can match.
|
|
3201
3422
|
Supports comma-separated values, such as `open,hidden`. Valid values are:
|
|
3202
3423
|
`all`, `hidden`, `open`, `closed`, `none`.
|
|
@@ -3231,6 +3452,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3231
3452
|
__body["data_retention"] = data_retention
|
|
3232
3453
|
if downsampling is not None:
|
|
3233
3454
|
__body["downsampling"] = downsampling
|
|
3455
|
+
if enabled is not None:
|
|
3456
|
+
__body["enabled"] = enabled
|
|
3234
3457
|
if not __body:
|
|
3235
3458
|
__body = None # type: ignore[assignment]
|
|
3236
3459
|
__headers = {"accept": "application/json"}
|
|
@@ -3310,7 +3533,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3310
3533
|
If an entry already exists with the same key, then it is overwritten by the new definition.</p>
|
|
3311
3534
|
|
|
3312
3535
|
|
|
3313
|
-
`<https://www.elastic.co/
|
|
3536
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-put-index-template>`_
|
|
3314
3537
|
|
|
3315
3538
|
:param name: Index or template name
|
|
3316
3539
|
:param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
|
|
@@ -3493,7 +3716,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3493
3716
|
Instead, add an alias field to create an alternate field name.</p>
|
|
3494
3717
|
|
|
3495
3718
|
|
|
3496
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3719
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-put-mapping.html>`_
|
|
3497
3720
|
|
|
3498
3721
|
:param index: A comma-separated list of index names the mapping should be added
|
|
3499
3722
|
to (supports wildcards); use `_all` or omit to add the mapping on all indices.
|
|
@@ -3617,6 +3840,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3617
3840
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3618
3841
|
preserve_existing: t.Optional[bool] = None,
|
|
3619
3842
|
pretty: t.Optional[bool] = None,
|
|
3843
|
+
reopen: t.Optional[bool] = None,
|
|
3620
3844
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3621
3845
|
) -> ObjectApiResponse[t.Any]:
|
|
3622
3846
|
"""
|
|
@@ -3638,7 +3862,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3638
3862
|
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.</p>
|
|
3639
3863
|
|
|
3640
3864
|
|
|
3641
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3865
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-update-settings.html>`_
|
|
3642
3866
|
|
|
3643
3867
|
:param settings:
|
|
3644
3868
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
@@ -3659,6 +3883,9 @@ class IndicesClient(NamespacedClient):
|
|
|
3659
3883
|
no response is received before the timeout expires, the request fails and
|
|
3660
3884
|
returns an error.
|
|
3661
3885
|
:param preserve_existing: If `true`, existing index settings remain unchanged.
|
|
3886
|
+
:param reopen: Whether to close and reopen the index to apply non-dynamic settings.
|
|
3887
|
+
If set to `true` the indices to which the settings are being applied will
|
|
3888
|
+
be closed temporarily and then reopened in order to apply the changes.
|
|
3662
3889
|
:param timeout: Period to wait for a response. If no response is received before
|
|
3663
3890
|
the timeout expires, the request fails and returns an error.
|
|
3664
3891
|
"""
|
|
@@ -3696,6 +3923,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3696
3923
|
__query["preserve_existing"] = preserve_existing
|
|
3697
3924
|
if pretty is not None:
|
|
3698
3925
|
__query["pretty"] = pretty
|
|
3926
|
+
if reopen is not None:
|
|
3927
|
+
__query["reopen"] = reopen
|
|
3699
3928
|
if timeout is not None:
|
|
3700
3929
|
__query["timeout"] = timeout
|
|
3701
3930
|
__body = settings if settings is not None else body
|
|
@@ -3759,11 +3988,11 @@ class IndicesClient(NamespacedClient):
|
|
|
3759
3988
|
NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.</p>
|
|
3760
3989
|
|
|
3761
3990
|
|
|
3762
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3991
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-templates-v1.html>`_
|
|
3763
3992
|
|
|
3764
3993
|
:param name: The name of the template
|
|
3765
3994
|
:param aliases: Aliases for the index.
|
|
3766
|
-
:param cause:
|
|
3995
|
+
:param cause: User defined reason for creating/updating the index template
|
|
3767
3996
|
:param create: If true, this request cannot replace or update existing index
|
|
3768
3997
|
templates.
|
|
3769
3998
|
:param index_patterns: Array of wildcard expressions used to match the names
|
|
@@ -3861,7 +4090,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3861
4090
|
This means that if a shard copy completes a recovery and then Elasticsearch relocates it onto a different node then the information about the original recovery will not be shown in the recovery API.</p>
|
|
3862
4091
|
|
|
3863
4092
|
|
|
3864
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4093
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-recovery.html>`_
|
|
3865
4094
|
|
|
3866
4095
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
3867
4096
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -3935,7 +4164,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3935
4164
|
This option ensures the indexing operation waits for a periodic refresh before running the search.</p>
|
|
3936
4165
|
|
|
3937
4166
|
|
|
3938
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4167
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-refresh.html>`_
|
|
3939
4168
|
|
|
3940
4169
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
3941
4170
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -4001,6 +4230,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4001
4230
|
human: t.Optional[bool] = None,
|
|
4002
4231
|
ignore_unavailable: t.Optional[bool] = None,
|
|
4003
4232
|
pretty: t.Optional[bool] = None,
|
|
4233
|
+
resource: t.Optional[str] = None,
|
|
4004
4234
|
) -> ObjectApiResponse[t.Any]:
|
|
4005
4235
|
"""
|
|
4006
4236
|
.. raw:: html
|
|
@@ -4018,7 +4248,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4018
4248
|
This ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future.</p>
|
|
4019
4249
|
|
|
4020
4250
|
|
|
4021
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4251
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-reload-analyzers.html>`_
|
|
4022
4252
|
|
|
4023
4253
|
:param index: A comma-separated list of index names to reload analyzers for
|
|
4024
4254
|
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
|
|
@@ -4028,6 +4258,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4028
4258
|
that are open, closed or both.
|
|
4029
4259
|
:param ignore_unavailable: Whether specified concrete indices should be ignored
|
|
4030
4260
|
when unavailable (missing or closed)
|
|
4261
|
+
:param resource: Changed resource to reload analyzers from if applicable
|
|
4031
4262
|
"""
|
|
4032
4263
|
if index in SKIP_IN_PATH:
|
|
4033
4264
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
@@ -4048,6 +4279,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4048
4279
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
4049
4280
|
if pretty is not None:
|
|
4050
4281
|
__query["pretty"] = pretty
|
|
4282
|
+
if resource is not None:
|
|
4283
|
+
__query["resource"] = resource
|
|
4051
4284
|
__headers = {"accept": "application/json"}
|
|
4052
4285
|
return self.perform_request( # type: ignore[return-value]
|
|
4053
4286
|
"POST",
|
|
@@ -4062,7 +4295,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4062
4295
|
def resolve_cluster(
|
|
4063
4296
|
self,
|
|
4064
4297
|
*,
|
|
4065
|
-
name: t.Union[str, t.Sequence[str]],
|
|
4298
|
+
name: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4066
4299
|
allow_no_indices: t.Optional[bool] = None,
|
|
4067
4300
|
error_trace: t.Optional[bool] = None,
|
|
4068
4301
|
expand_wildcards: t.Optional[
|
|
@@ -4078,19 +4311,20 @@ class IndicesClient(NamespacedClient):
|
|
|
4078
4311
|
ignore_throttled: t.Optional[bool] = None,
|
|
4079
4312
|
ignore_unavailable: t.Optional[bool] = None,
|
|
4080
4313
|
pretty: t.Optional[bool] = None,
|
|
4314
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4081
4315
|
) -> ObjectApiResponse[t.Any]:
|
|
4082
4316
|
"""
|
|
4083
4317
|
.. raw:: html
|
|
4084
4318
|
|
|
4085
|
-
<p>Resolve the cluster
|
|
4086
|
-
Resolve the specified index expressions to return information about each cluster, including the local cluster, if included.
|
|
4087
|
-
|
|
4319
|
+
<p>Resolve the cluster.</p>
|
|
4320
|
+
<p>Resolve the specified index expressions to return information about each cluster, including the local "querying" cluster, if included.
|
|
4321
|
+
If no index expression is provided, the API will return information about all the remote clusters that are configured on the querying cluster.</p>
|
|
4088
4322
|
<p>This endpoint is useful before doing a cross-cluster search in order to determine which remote clusters should be included in a search.</p>
|
|
4089
4323
|
<p>You use the same index expression with this endpoint as you would for cross-cluster search.
|
|
4090
4324
|
Index and cluster exclusions are also supported with this endpoint.</p>
|
|
4091
4325
|
<p>For each cluster in the index expression, information is returned about:</p>
|
|
4092
4326
|
<ul>
|
|
4093
|
-
<li>Whether the querying ("local") cluster is currently connected to each remote cluster in the index expression
|
|
4327
|
+
<li>Whether the querying ("local") cluster is currently connected to each remote cluster specified in the index expression. Note that this endpoint actively attempts to contact the remote clusters, unlike the <code>remote/info</code> endpoint.</li>
|
|
4094
4328
|
<li>Whether each remote cluster is configured with <code>skip_unavailable</code> as <code>true</code> or <code>false</code>.</li>
|
|
4095
4329
|
<li>Whether there are any indices, aliases, or data streams on that cluster that match the index expression.</li>
|
|
4096
4330
|
<li>Whether the search is likely to have errors returned when you do the cross-cluster search (including any authorization errors if you do not have permission to query the index).</li>
|
|
@@ -4098,7 +4332,13 @@ class IndicesClient(NamespacedClient):
|
|
|
4098
4332
|
</ul>
|
|
4099
4333
|
<p>For example, <code>GET /_resolve/cluster/my-index-*,cluster*:my-index-*</code> returns information about the local cluster and all remotely configured clusters that start with the alias <code>cluster*</code>.
|
|
4100
4334
|
Each cluster returns information about whether it has any indices, aliases or data streams that match <code>my-index-*</code>.</p>
|
|
4101
|
-
<
|
|
4335
|
+
<h2>Note on backwards compatibility</h2>
|
|
4336
|
+
<p>The ability to query without an index expression was added in version 8.18, so when
|
|
4337
|
+
querying remote clusters older than that, the local cluster will send the index
|
|
4338
|
+
expression <code>dummy*</code> to those remote clusters. Thus, if an errors occur, you may see a reference
|
|
4339
|
+
to that index expression even though you didn't request it. If it causes a problem, you can
|
|
4340
|
+
instead include an index expression like <code>*:*</code> to bypass the issue.</p>
|
|
4341
|
+
<h2>Advantages of using this endpoint before a cross-cluster search</h2>
|
|
4102
4342
|
<p>You may want to exclude a cluster or index from a search when:</p>
|
|
4103
4343
|
<ul>
|
|
4104
4344
|
<li>A remote cluster is not currently connected and is configured with <code>skip_unavailable=false</code>. Running a cross-cluster search under those conditions will cause the entire search to fail.</li>
|
|
@@ -4106,31 +4346,60 @@ class IndicesClient(NamespacedClient):
|
|
|
4106
4346
|
<li>The index expression (combined with any query parameters you specify) will likely cause an exception to be thrown when you do the search. In these cases, the "error" field in the <code>_resolve/cluster</code> response will be present. (This is also where security/permission errors will be shown.)</li>
|
|
4107
4347
|
<li>A remote cluster is an older version that does not support the feature you want to use in your search.</li>
|
|
4108
4348
|
</ul>
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4349
|
+
<h2>Test availability of remote clusters</h2>
|
|
4350
|
+
<p>The <code>remote/info</code> endpoint is commonly used to test whether the "local" cluster (the cluster being queried) is connected to its remote clusters, but it does not necessarily reflect whether the remote cluster is available or not.
|
|
4351
|
+
The remote cluster may be available, while the local cluster is not currently connected to it.</p>
|
|
4352
|
+
<p>You can use the <code>_resolve/cluster</code> API to attempt to reconnect to remote clusters.
|
|
4353
|
+
For example with <code>GET _resolve/cluster</code> or <code>GET _resolve/cluster/*:*</code>.
|
|
4354
|
+
The <code>connected</code> field in the response will indicate whether it was successful.
|
|
4355
|
+
If a connection was (re-)established, this will also cause the <code>remote/info</code> endpoint to now indicate a connected status.</p>
|
|
4356
|
+
|
|
4357
|
+
|
|
4358
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-resolve-cluster-api.html>`_
|
|
4359
|
+
|
|
4360
|
+
:param name: A comma-separated list of names or index patterns for the indices,
|
|
4361
|
+
aliases, and data streams to resolve. Resources on remote clusters can be
|
|
4362
|
+
specified using the `<cluster>`:`<name>` syntax. Index and cluster exclusions
|
|
4363
|
+
(e.g., `-cluster1:*`) are also supported. If no index expression is specified,
|
|
4364
|
+
information about all remote clusters configured on the local cluster is
|
|
4365
|
+
returned without doing any index matching
|
|
4116
4366
|
:param allow_no_indices: If false, the request returns an error if any wildcard
|
|
4117
|
-
expression, index alias, or _all value targets only missing or closed indices.
|
|
4367
|
+
expression, index alias, or `_all` value targets only missing or closed indices.
|
|
4118
4368
|
This behavior applies even if the request targets other open indices. For
|
|
4119
|
-
example, a request targeting foo*,bar
|
|
4120
|
-
with foo but no index starts with bar
|
|
4369
|
+
example, a request targeting `foo*,bar*` returns an error if an index starts
|
|
4370
|
+
with `foo` but no index starts with `bar`. NOTE: This option is only supported
|
|
4371
|
+
when specifying an index expression. You will get an error if you specify
|
|
4372
|
+
index options to the `_resolve/cluster` API endpoint that takes no index
|
|
4373
|
+
expression.
|
|
4121
4374
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
4122
4375
|
request can target data streams, this argument determines whether wildcard
|
|
4123
4376
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
4124
4377
|
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
|
|
4125
|
-
|
|
4126
|
-
|
|
4378
|
+
NOTE: This option is only supported when specifying an index expression.
|
|
4379
|
+
You will get an error if you specify index options to the `_resolve/cluster`
|
|
4380
|
+
API endpoint that takes no index expression.
|
|
4381
|
+
:param ignore_throttled: If true, concrete, expanded, or aliased indices are
|
|
4382
|
+
ignored when frozen. NOTE: This option is only supported when specifying
|
|
4383
|
+
an index expression. You will get an error if you specify index options to
|
|
4384
|
+
the `_resolve/cluster` API endpoint that takes no index expression.
|
|
4127
4385
|
:param ignore_unavailable: If false, the request returns an error if it targets
|
|
4128
|
-
a missing or closed index.
|
|
4386
|
+
a missing or closed index. NOTE: This option is only supported when specifying
|
|
4387
|
+
an index expression. You will get an error if you specify index options to
|
|
4388
|
+
the `_resolve/cluster` API endpoint that takes no index expression.
|
|
4389
|
+
:param timeout: The maximum time to wait for remote clusters to respond. If a
|
|
4390
|
+
remote cluster does not respond within this timeout period, the API response
|
|
4391
|
+
will show the cluster as not connected and include an error message that
|
|
4392
|
+
the request timed out. The default timeout is unset and the query can take
|
|
4393
|
+
as long as the networking layer is configured to wait for remote clusters
|
|
4394
|
+
that are not responding (typically 30 seconds).
|
|
4129
4395
|
"""
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4396
|
+
__path_parts: t.Dict[str, str]
|
|
4397
|
+
if name not in SKIP_IN_PATH:
|
|
4398
|
+
__path_parts = {"name": _quote(name)}
|
|
4399
|
+
__path = f'/_resolve/cluster/{__path_parts["name"]}'
|
|
4400
|
+
else:
|
|
4401
|
+
__path_parts = {}
|
|
4402
|
+
__path = "/_resolve/cluster"
|
|
4134
4403
|
__query: t.Dict[str, t.Any] = {}
|
|
4135
4404
|
if allow_no_indices is not None:
|
|
4136
4405
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -4148,6 +4417,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4148
4417
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
4149
4418
|
if pretty is not None:
|
|
4150
4419
|
__query["pretty"] = pretty
|
|
4420
|
+
if timeout is not None:
|
|
4421
|
+
__query["timeout"] = timeout
|
|
4151
4422
|
__headers = {"accept": "application/json"}
|
|
4152
4423
|
return self.perform_request( # type: ignore[return-value]
|
|
4153
4424
|
"GET",
|
|
@@ -4186,7 +4457,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4186
4457
|
Multiple patterns and remote clusters are supported.</p>
|
|
4187
4458
|
|
|
4188
4459
|
|
|
4189
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4460
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-resolve-index-api.html>`_
|
|
4190
4461
|
|
|
4191
4462
|
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
|
|
4192
4463
|
and data streams to resolve. Resources on remote clusters can be specified
|
|
@@ -4246,6 +4517,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4246
4517
|
error_trace: t.Optional[bool] = None,
|
|
4247
4518
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4248
4519
|
human: t.Optional[bool] = None,
|
|
4520
|
+
lazy: t.Optional[bool] = None,
|
|
4249
4521
|
mappings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4250
4522
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4251
4523
|
pretty: t.Optional[bool] = None,
|
|
@@ -4287,7 +4559,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4287
4559
|
If you roll over the alias on May 7, 2099, the new index's name is <code>my-index-2099.05.07-000002</code>.</p>
|
|
4288
4560
|
|
|
4289
4561
|
|
|
4290
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4562
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-rollover-index.html>`_
|
|
4291
4563
|
|
|
4292
4564
|
:param alias: Name of the data stream or index alias to roll over.
|
|
4293
4565
|
:param new_index: Name of the index to create. Supports date math. Data streams
|
|
@@ -4302,6 +4574,9 @@ class IndicesClient(NamespacedClient):
|
|
|
4302
4574
|
conditions are satisfied.
|
|
4303
4575
|
:param dry_run: If `true`, checks whether the current index satisfies the specified
|
|
4304
4576
|
conditions but does not perform a rollover.
|
|
4577
|
+
:param lazy: If set to true, the rollover action will only mark a data stream
|
|
4578
|
+
to signal that it needs to be rolled over at the next write. Only allowed
|
|
4579
|
+
on data streams.
|
|
4305
4580
|
:param mappings: Mapping for fields in the index. If specified, this mapping
|
|
4306
4581
|
can include field names, field data types, and mapping paramaters.
|
|
4307
4582
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -4336,6 +4611,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4336
4611
|
__query["filter_path"] = filter_path
|
|
4337
4612
|
if human is not None:
|
|
4338
4613
|
__query["human"] = human
|
|
4614
|
+
if lazy is not None:
|
|
4615
|
+
__query["lazy"] = lazy
|
|
4339
4616
|
if master_timeout is not None:
|
|
4340
4617
|
__query["master_timeout"] = master_timeout
|
|
4341
4618
|
if pretty is not None:
|
|
@@ -4397,7 +4674,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4397
4674
|
For data streams, the API returns information about the stream's backing indices.</p>
|
|
4398
4675
|
|
|
4399
4676
|
|
|
4400
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4677
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-segments.html>`_
|
|
4401
4678
|
|
|
4402
4679
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
4403
4680
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -4489,7 +4766,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4489
4766
|
<p>By default, the API returns store information only for primary shards that are unassigned or have one or more unassigned replica shards.</p>
|
|
4490
4767
|
|
|
4491
4768
|
|
|
4492
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4769
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-shards-stores.html>`_
|
|
4493
4770
|
|
|
4494
4771
|
:param index: List of data streams, indices, and aliases used to limit the request.
|
|
4495
4772
|
:param allow_no_indices: If false, the request returns an error if any wildcard
|
|
@@ -4591,7 +4868,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4591
4868
|
</ul>
|
|
4592
4869
|
|
|
4593
4870
|
|
|
4594
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4871
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-shrink-index.html>`_
|
|
4595
4872
|
|
|
4596
4873
|
:param index: Name of the source index to shrink.
|
|
4597
4874
|
:param target: Name of the target index to create.
|
|
@@ -4656,6 +4933,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4656
4933
|
self,
|
|
4657
4934
|
*,
|
|
4658
4935
|
name: str,
|
|
4936
|
+
cause: t.Optional[str] = None,
|
|
4937
|
+
create: t.Optional[bool] = None,
|
|
4659
4938
|
error_trace: t.Optional[bool] = None,
|
|
4660
4939
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4661
4940
|
human: t.Optional[bool] = None,
|
|
@@ -4670,9 +4949,13 @@ class IndicesClient(NamespacedClient):
|
|
|
4670
4949
|
Get the index configuration that would be applied to the specified index from an existing index template.</p>
|
|
4671
4950
|
|
|
4672
4951
|
|
|
4673
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4952
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-simulate-index.html>`_
|
|
4674
4953
|
|
|
4675
4954
|
:param name: Name of the index to simulate
|
|
4955
|
+
:param cause: User defined reason for dry-run creating the new template for simulation
|
|
4956
|
+
purposes
|
|
4957
|
+
:param create: Whether the index template we optionally defined in the body should
|
|
4958
|
+
only be dry-run added if new or can also replace an existing one
|
|
4676
4959
|
:param include_defaults: If true, returns all relevant default configurations
|
|
4677
4960
|
for the index template.
|
|
4678
4961
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -4684,6 +4967,10 @@ class IndicesClient(NamespacedClient):
|
|
|
4684
4967
|
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
4685
4968
|
__path = f'/_index_template/_simulate_index/{__path_parts["name"]}'
|
|
4686
4969
|
__query: t.Dict[str, t.Any] = {}
|
|
4970
|
+
if cause is not None:
|
|
4971
|
+
__query["cause"] = cause
|
|
4972
|
+
if create is not None:
|
|
4973
|
+
__query["create"] = create
|
|
4687
4974
|
if error_trace is not None:
|
|
4688
4975
|
__query["error_trace"] = error_trace
|
|
4689
4976
|
if filter_path is not None:
|
|
@@ -4726,6 +5013,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4726
5013
|
*,
|
|
4727
5014
|
name: t.Optional[str] = None,
|
|
4728
5015
|
allow_auto_create: t.Optional[bool] = None,
|
|
5016
|
+
cause: t.Optional[str] = None,
|
|
4729
5017
|
composed_of: t.Optional[t.Sequence[str]] = None,
|
|
4730
5018
|
create: t.Optional[bool] = None,
|
|
4731
5019
|
data_stream: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -4751,7 +5039,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4751
5039
|
Get the index configuration that would be applied by a particular index template.</p>
|
|
4752
5040
|
|
|
4753
5041
|
|
|
4754
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5042
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-simulate-template.html>`_
|
|
4755
5043
|
|
|
4756
5044
|
:param name: Name of the index template to simulate. To test a template configuration
|
|
4757
5045
|
before you add it to the cluster, omit this parameter and specify the template
|
|
@@ -4762,6 +5050,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4762
5050
|
via `actions.auto_create_index`. If set to `false`, then indices or data
|
|
4763
5051
|
streams matching the template must always be explicitly created, and may
|
|
4764
5052
|
never be automatically created.
|
|
5053
|
+
:param cause: User defined reason for dry-run creating the new template for simulation
|
|
5054
|
+
purposes
|
|
4765
5055
|
:param composed_of: An ordered list of component template names. Component templates
|
|
4766
5056
|
are merged in the order specified, meaning that the last component template
|
|
4767
5057
|
specified has the highest precedence.
|
|
@@ -4806,6 +5096,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4806
5096
|
__path = "/_index_template/_simulate"
|
|
4807
5097
|
__query: t.Dict[str, t.Any] = {}
|
|
4808
5098
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
5099
|
+
if cause is not None:
|
|
5100
|
+
__query["cause"] = cause
|
|
4809
5101
|
if create is not None:
|
|
4810
5102
|
__query["create"] = create
|
|
4811
5103
|
if error_trace is not None:
|
|
@@ -4919,7 +5211,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4919
5211
|
</ul>
|
|
4920
5212
|
|
|
4921
5213
|
|
|
4922
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5214
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-split-index.html>`_
|
|
4923
5215
|
|
|
4924
5216
|
:param index: Name of the source index to split.
|
|
4925
5217
|
:param target: Name of the target index to create.
|
|
@@ -5021,7 +5313,7 @@ class IndicesClient(NamespacedClient):
|
|
|
5021
5313
|
Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed.</p>
|
|
5022
5314
|
|
|
5023
5315
|
|
|
5024
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5316
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-stats.html>`_
|
|
5025
5317
|
|
|
5026
5318
|
:param index: A comma-separated list of index names; use `_all` or empty string
|
|
5027
5319
|
to perform the operation on all indices
|
|
@@ -5128,7 +5420,7 @@ class IndicesClient(NamespacedClient):
|
|
|
5128
5420
|
When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.</p>
|
|
5129
5421
|
|
|
5130
5422
|
|
|
5131
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5423
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/unfreeze-index-api.html>`_
|
|
5132
5424
|
|
|
5133
5425
|
:param index: Identifier for the index.
|
|
5134
5426
|
:param allow_no_indices: If `false`, the request returns an error if any wildcard
|
|
@@ -5206,7 +5498,7 @@ class IndicesClient(NamespacedClient):
|
|
|
5206
5498
|
Adds a data stream or index to an alias.</p>
|
|
5207
5499
|
|
|
5208
5500
|
|
|
5209
|
-
`<https://www.elastic.co/
|
|
5501
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-update-aliases>`_
|
|
5210
5502
|
|
|
5211
5503
|
:param actions: Actions to perform.
|
|
5212
5504
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -5285,7 +5577,7 @@ class IndicesClient(NamespacedClient):
|
|
|
5285
5577
|
Validates a query without running it.</p>
|
|
5286
5578
|
|
|
5287
5579
|
|
|
5288
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5580
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-validate.html>`_
|
|
5289
5581
|
|
|
5290
5582
|
:param index: Comma-separated list of data streams, indices, and aliases to search.
|
|
5291
5583
|
Supports wildcards (`*`). To search all data streams or indices, omit this
|