elasticsearch 8.17.1__py3-none-any.whl → 8.18.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2146 -859
- elasticsearch/_async/client/_base.py +0 -1
- elasticsearch/_async/client/async_search.py +44 -29
- elasticsearch/_async/client/autoscaling.py +32 -26
- elasticsearch/_async/client/cat.py +244 -169
- elasticsearch/_async/client/ccr.py +268 -128
- elasticsearch/_async/client/cluster.py +191 -164
- elasticsearch/_async/client/connector.py +212 -116
- elasticsearch/_async/client/dangling_indices.py +22 -16
- elasticsearch/_async/client/enrich.py +51 -11
- elasticsearch/_async/client/eql.py +54 -13
- elasticsearch/_async/client/esql.py +352 -4
- elasticsearch/_async/client/features.py +37 -27
- elasticsearch/_async/client/fleet.py +22 -10
- elasticsearch/_async/client/graph.py +10 -9
- elasticsearch/_async/client/ilm.py +108 -77
- elasticsearch/_async/client/indices.py +1112 -677
- elasticsearch/_async/client/inference.py +1875 -133
- elasticsearch/_async/client/ingest.py +83 -50
- elasticsearch/_async/client/license.py +90 -38
- elasticsearch/_async/client/logstash.py +20 -9
- elasticsearch/_async/client/migration.py +26 -17
- elasticsearch/_async/client/ml.py +642 -365
- elasticsearch/_async/client/monitoring.py +6 -3
- elasticsearch/_async/client/nodes.py +51 -53
- elasticsearch/_async/client/query_rules.py +59 -33
- elasticsearch/_async/client/rollup.py +124 -86
- elasticsearch/_async/client/search_application.py +60 -32
- elasticsearch/_async/client/searchable_snapshots.py +25 -12
- elasticsearch/_async/client/security.py +896 -558
- elasticsearch/_async/client/shutdown.py +34 -36
- elasticsearch/_async/client/simulate.py +22 -28
- elasticsearch/_async/client/slm.py +65 -40
- elasticsearch/_async/client/snapshot.py +190 -213
- elasticsearch/_async/client/sql.py +43 -22
- elasticsearch/_async/client/ssl.py +17 -18
- elasticsearch/_async/client/synonyms.py +58 -37
- elasticsearch/_async/client/tasks.py +77 -48
- elasticsearch/_async/client/text_structure.py +65 -56
- elasticsearch/_async/client/transform.py +124 -93
- elasticsearch/_async/client/watcher.py +116 -72
- elasticsearch/_async/client/xpack.py +18 -9
- elasticsearch/_async/helpers.py +1 -2
- elasticsearch/_sync/client/__init__.py +2146 -859
- elasticsearch/_sync/client/_base.py +0 -1
- elasticsearch/_sync/client/async_search.py +44 -29
- elasticsearch/_sync/client/autoscaling.py +32 -26
- elasticsearch/_sync/client/cat.py +244 -169
- elasticsearch/_sync/client/ccr.py +268 -128
- elasticsearch/_sync/client/cluster.py +191 -164
- elasticsearch/_sync/client/connector.py +212 -116
- elasticsearch/_sync/client/dangling_indices.py +22 -16
- elasticsearch/_sync/client/enrich.py +51 -11
- elasticsearch/_sync/client/eql.py +54 -13
- elasticsearch/_sync/client/esql.py +352 -4
- elasticsearch/_sync/client/features.py +37 -27
- elasticsearch/_sync/client/fleet.py +22 -10
- elasticsearch/_sync/client/graph.py +10 -9
- elasticsearch/_sync/client/ilm.py +108 -77
- elasticsearch/_sync/client/indices.py +1112 -677
- elasticsearch/_sync/client/inference.py +1875 -133
- elasticsearch/_sync/client/ingest.py +83 -50
- elasticsearch/_sync/client/license.py +90 -38
- elasticsearch/_sync/client/logstash.py +20 -9
- elasticsearch/_sync/client/migration.py +26 -17
- elasticsearch/_sync/client/ml.py +642 -365
- elasticsearch/_sync/client/monitoring.py +6 -3
- elasticsearch/_sync/client/nodes.py +51 -53
- elasticsearch/_sync/client/query_rules.py +59 -33
- elasticsearch/_sync/client/rollup.py +124 -86
- elasticsearch/_sync/client/search_application.py +60 -32
- elasticsearch/_sync/client/searchable_snapshots.py +25 -12
- elasticsearch/_sync/client/security.py +896 -558
- elasticsearch/_sync/client/shutdown.py +34 -36
- elasticsearch/_sync/client/simulate.py +22 -28
- elasticsearch/_sync/client/slm.py +65 -40
- elasticsearch/_sync/client/snapshot.py +190 -213
- elasticsearch/_sync/client/sql.py +43 -22
- elasticsearch/_sync/client/ssl.py +17 -18
- elasticsearch/_sync/client/synonyms.py +58 -37
- elasticsearch/_sync/client/tasks.py +77 -48
- elasticsearch/_sync/client/text_structure.py +65 -56
- elasticsearch/_sync/client/transform.py +124 -93
- elasticsearch/_sync/client/utils.py +1 -4
- elasticsearch/_sync/client/watcher.py +116 -72
- elasticsearch/_sync/client/xpack.py +18 -9
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- elasticsearch/dsl/__init__.py +203 -0
- elasticsearch/dsl/_async/__init__.py +16 -0
- elasticsearch/dsl/_async/document.py +522 -0
- elasticsearch/dsl/_async/faceted_search.py +50 -0
- elasticsearch/dsl/_async/index.py +639 -0
- elasticsearch/dsl/_async/mapping.py +49 -0
- elasticsearch/dsl/_async/search.py +233 -0
- elasticsearch/dsl/_async/update_by_query.py +47 -0
- elasticsearch/dsl/_sync/__init__.py +16 -0
- elasticsearch/dsl/_sync/document.py +514 -0
- elasticsearch/dsl/_sync/faceted_search.py +50 -0
- elasticsearch/dsl/_sync/index.py +597 -0
- elasticsearch/dsl/_sync/mapping.py +49 -0
- elasticsearch/dsl/_sync/search.py +226 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3730 -0
- elasticsearch/dsl/analysis.py +341 -0
- elasticsearch/dsl/async_connections.py +37 -0
- elasticsearch/dsl/connections.py +142 -0
- elasticsearch/dsl/document.py +20 -0
- elasticsearch/dsl/document_base.py +444 -0
- elasticsearch/dsl/exceptions.py +32 -0
- elasticsearch/dsl/faceted_search.py +28 -0
- elasticsearch/dsl/faceted_search_base.py +489 -0
- elasticsearch/dsl/field.py +4254 -0
- elasticsearch/dsl/function.py +180 -0
- elasticsearch/dsl/index.py +23 -0
- elasticsearch/dsl/index_base.py +178 -0
- elasticsearch/dsl/mapping.py +19 -0
- elasticsearch/dsl/mapping_base.py +219 -0
- elasticsearch/dsl/query.py +2816 -0
- elasticsearch/dsl/response/__init__.py +388 -0
- elasticsearch/dsl/response/aggs.py +100 -0
- elasticsearch/dsl/response/hit.py +53 -0
- elasticsearch/dsl/search.py +20 -0
- elasticsearch/dsl/search_base.py +1040 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6471 -0
- elasticsearch/dsl/update_by_query.py +19 -0
- elasticsearch/dsl/update_by_query_base.py +149 -0
- elasticsearch/dsl/utils.py +687 -0
- elasticsearch/dsl/wrappers.py +119 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/METADATA +12 -2
- elasticsearch-8.18.0.dist-info/RECORD +161 -0
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -55,22 +55,42 @@ class IndicesClient(NamespacedClient):
|
|
|
55
55
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
56
56
|
) -> ObjectApiResponse[t.Any]:
|
|
57
57
|
"""
|
|
58
|
-
|
|
59
|
-
operation types.
|
|
58
|
+
.. raw:: html
|
|
60
59
|
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
:param
|
|
73
|
-
:param
|
|
64
|
+
|
|
65
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/index-modules-blocks.html#add-index-block>`_
|
|
66
|
+
|
|
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.
|
|
74
94
|
"""
|
|
75
95
|
if index in SKIP_IN_PATH:
|
|
76
96
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
@@ -143,14 +163,17 @@ class IndicesClient(NamespacedClient):
|
|
|
143
163
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
144
164
|
) -> ObjectApiResponse[t.Any]:
|
|
145
165
|
"""
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
166
|
+
.. raw:: html
|
|
167
|
+
|
|
168
|
+
<p>Get tokens from text analysis.
|
|
169
|
+
The analyze API performs analysis on a text string and returns the resulting tokens.</p>
|
|
170
|
+
<p>Generating excessive amount of tokens may cause a node to run out of memory.
|
|
171
|
+
The <code>index.analyze.max_token_count</code> setting enables you to limit the number of tokens that can be produced.
|
|
172
|
+
If more than this limit of tokens gets generated, an error occurs.
|
|
173
|
+
The <code>_analyze</code> endpoint without a specified index will always use <code>10000</code> as its limit.</p>
|
|
174
|
+
|
|
152
175
|
|
|
153
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
176
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-analyze.html>`_
|
|
154
177
|
|
|
155
178
|
:param index: Index used to derive the analyzer. If specified, the `analyzer`
|
|
156
179
|
or field parameter overrides this value. If no index is specified or the
|
|
@@ -224,6 +247,51 @@ class IndicesClient(NamespacedClient):
|
|
|
224
247
|
path_parts=__path_parts,
|
|
225
248
|
)
|
|
226
249
|
|
|
250
|
+
@_rewrite_parameters()
|
|
251
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
252
|
+
async 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 await 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
|
+
|
|
227
295
|
@_rewrite_parameters()
|
|
228
296
|
async def clear_cache(
|
|
229
297
|
self,
|
|
@@ -249,13 +317,17 @@ class IndicesClient(NamespacedClient):
|
|
|
249
317
|
request: t.Optional[bool] = None,
|
|
250
318
|
) -> ObjectApiResponse[t.Any]:
|
|
251
319
|
"""
|
|
252
|
-
|
|
253
|
-
API clears the caches of the stream's backing indices. By default, the clear
|
|
254
|
-
cache API clears all caches. To clear only specific caches, use the `fielddata`,
|
|
255
|
-
`query`, or `request` parameters. To clear the cache only of specific fields,
|
|
256
|
-
use the `fields` parameter.
|
|
320
|
+
.. raw:: html
|
|
257
321
|
|
|
258
|
-
|
|
322
|
+
<p>Clear the cache.
|
|
323
|
+
Clear the cache of one or more indices.
|
|
324
|
+
For data streams, the API clears the caches of the stream's backing indices.</p>
|
|
325
|
+
<p>By default, the clear cache API clears all caches.
|
|
326
|
+
To clear only specific caches, use the <code>fielddata</code>, <code>query</code>, or <code>request</code> parameters.
|
|
327
|
+
To clear the cache only of specific fields, use the <code>fields</code> parameter.</p>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-clearcache.html>`_
|
|
259
331
|
|
|
260
332
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
261
333
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -338,46 +410,46 @@ class IndicesClient(NamespacedClient):
|
|
|
338
410
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
339
411
|
) -> ObjectApiResponse[t.Any]:
|
|
340
412
|
"""
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
413
|
+
.. raw:: html
|
|
414
|
+
|
|
415
|
+
<p>Clone an index.
|
|
416
|
+
Clone an existing index into a new index.
|
|
417
|
+
Each original primary shard is cloned into a new primary shard in the new index.</p>
|
|
418
|
+
<p>IMPORTANT: Elasticsearch does not apply index templates to the resulting index.
|
|
419
|
+
The API also does not copy index metadata from the original index.
|
|
420
|
+
Index metadata includes aliases, index lifecycle management phase definitions, and cross-cluster replication (CCR) follower information.
|
|
421
|
+
For example, if you clone a CCR follower index, the resulting clone will not be a follower index.</p>
|
|
422
|
+
<p>The clone API copies most index settings from the source index to the resulting index, with the exception of <code>index.number_of_replicas</code> and <code>index.auto_expand_replicas</code>.
|
|
423
|
+
To set the number of replicas in the resulting index, configure these settings in the clone request.</p>
|
|
424
|
+
<p>Cloning works as follows:</p>
|
|
425
|
+
<ul>
|
|
426
|
+
<li>First, it creates a new target index with the same definition as the source index.</li>
|
|
427
|
+
<li>Then it hard-links segments from the source index into the target index. If the file system does not support hard-linking, all segments are copied into the new index, which is a much more time consuming process.</li>
|
|
428
|
+
<li>Finally, it recovers the target index as though it were a closed index which had just been re-opened.</li>
|
|
429
|
+
</ul>
|
|
430
|
+
<p>IMPORTANT: Indices can only be cloned if they meet the following requirements:</p>
|
|
431
|
+
<ul>
|
|
432
|
+
<li>The index must be marked as read-only and have a cluster health status of green.</li>
|
|
433
|
+
<li>The target index must not exist.</li>
|
|
434
|
+
<li>The source index must have the same number of primary shards as the target index.</li>
|
|
435
|
+
<li>The node handling the clone process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
|
|
436
|
+
</ul>
|
|
437
|
+
<p>The current write index on a data stream cannot be cloned.
|
|
438
|
+
In order to clone the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be cloned.</p>
|
|
439
|
+
<p>NOTE: Mappings cannot be specified in the <code>_clone</code> request. The mappings of the source index will be used for the target index.</p>
|
|
440
|
+
<p><strong>Monitor the cloning process</strong></p>
|
|
441
|
+
<p>The cloning process can be monitored with the cat recovery API or the cluster health API can be used to wait until all primary shards have been allocated by setting the <code>wait_for_status</code> parameter to <code>yellow</code>.</p>
|
|
442
|
+
<p>The <code>_clone</code> API returns as soon as the target index has been added to the cluster state, before any shards have been allocated.
|
|
443
|
+
At this point, all shards are in the state unassigned.
|
|
444
|
+
If, for any reason, the target index can't be allocated, its primary shard will remain unassigned until it can be allocated on that node.</p>
|
|
445
|
+
<p>Once the primary shard is allocated, it moves to state initializing, and the clone process begins.
|
|
446
|
+
When the clone operation completes, the shard will become active.
|
|
447
|
+
At that point, Elasticsearch will try to allocate any replicas and may decide to relocate the primary shard to another node.</p>
|
|
448
|
+
<p><strong>Wait for active shards</strong></p>
|
|
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>
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-clone-index.html>`_
|
|
381
453
|
|
|
382
454
|
:param index: Name of the source index to clone.
|
|
383
455
|
:param target: Name of the target index to create.
|
|
@@ -463,26 +535,25 @@ class IndicesClient(NamespacedClient):
|
|
|
463
535
|
] = None,
|
|
464
536
|
) -> ObjectApiResponse[t.Any]:
|
|
465
537
|
"""
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-close.html>`_
|
|
538
|
+
.. raw:: html
|
|
539
|
+
|
|
540
|
+
<p>Close an index.
|
|
541
|
+
A closed index is blocked for read or write operations and does not allow all operations that opened indices allow.
|
|
542
|
+
It is not possible to index documents or to search for documents in a closed index.
|
|
543
|
+
Closed indices do not have to maintain internal data structures for indexing or searching documents, which results in a smaller overhead on the cluster.</p>
|
|
544
|
+
<p>When opening or closing an index, the master node is responsible for restarting the index shards to reflect the new state of the index.
|
|
545
|
+
The shards will then go through the normal recovery process.
|
|
546
|
+
The data of opened and closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times.</p>
|
|
547
|
+
<p>You can open and close multiple indices.
|
|
548
|
+
An error is thrown if the request explicitly refers to a missing index.
|
|
549
|
+
This behaviour can be turned off using the <code>ignore_unavailable=true</code> parameter.</p>
|
|
550
|
+
<p>By default, you must explicitly name the indices you are opening or closing.
|
|
551
|
+
To open or close indices with <code>_all</code>, <code>*</code>, or other wildcard expressions, change the<code> action.destructive_requires_name</code> setting to <code>false</code>. This setting can also be changed with the cluster update settings API.</p>
|
|
552
|
+
<p>Closed indices consume a significant amount of disk-space which can cause problems in managed environments.
|
|
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>
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-close.html>`_
|
|
486
557
|
|
|
487
558
|
:param index: Comma-separated list or wildcard expression of index names used
|
|
488
559
|
to limit the request.
|
|
@@ -561,28 +632,29 @@ class IndicesClient(NamespacedClient):
|
|
|
561
632
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
562
633
|
) -> ObjectApiResponse[t.Any]:
|
|
563
634
|
"""
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
635
|
+
.. raw:: html
|
|
636
|
+
|
|
637
|
+
<p>Create an index.
|
|
638
|
+
You can use the create index API to add a new index to an Elasticsearch cluster.
|
|
639
|
+
When creating an index, you can specify the following:</p>
|
|
640
|
+
<ul>
|
|
641
|
+
<li>Settings for the index.</li>
|
|
642
|
+
<li>Mappings for fields in the index.</li>
|
|
643
|
+
<li>Index aliases</li>
|
|
644
|
+
</ul>
|
|
645
|
+
<p><strong>Wait for active shards</strong></p>
|
|
646
|
+
<p>By default, index creation will only return a response to the client when the primary copies of each shard have been started, or the request times out.
|
|
647
|
+
The index creation response will indicate what happened.
|
|
648
|
+
For example, <code>acknowledged</code> indicates whether the index was successfully created in the cluster, <code>while shards_acknowledged</code> indicates whether the requisite number of shard copies were started for each shard in the index before timing out.
|
|
649
|
+
Note that it is still possible for either <code>acknowledged</code> or <code>shards_acknowledged</code> to be <code>false</code>, but for the index creation to be successful.
|
|
650
|
+
These values simply indicate whether the operation completed before the timeout.
|
|
651
|
+
If <code>acknowledged</code> is false, the request timed out before the cluster state was updated with the newly created index, but it probably will be created sometime soon.
|
|
652
|
+
If <code>shards_acknowledged</code> is false, then the request timed out before the requisite number of shards were started (by default just the primaries), even if the cluster state was successfully updated to reflect the newly created index (that is to say, <code>acknowledged</code> is <code>true</code>).</p>
|
|
653
|
+
<p>You can change the default of only waiting for the primary shards to start through the index setting <code>index.write.wait_for_active_shards</code>.
|
|
654
|
+
Note that changing this setting will also affect the <code>wait_for_active_shards</code> value on all subsequent write operations.</p>
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-create-index.html>`_
|
|
586
658
|
|
|
587
659
|
:param index: Name of the index you wish to create.
|
|
588
660
|
:param aliases: Aliases for the index.
|
|
@@ -653,10 +725,13 @@ class IndicesClient(NamespacedClient):
|
|
|
653
725
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
654
726
|
) -> ObjectApiResponse[t.Any]:
|
|
655
727
|
"""
|
|
656
|
-
|
|
657
|
-
|
|
728
|
+
.. raw:: html
|
|
729
|
+
|
|
730
|
+
<p>Create a data stream.</p>
|
|
731
|
+
<p>You must have a matching index template with data stream enabled.</p>
|
|
658
732
|
|
|
659
|
-
|
|
733
|
+
|
|
734
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-create-data-stream.html>`_
|
|
660
735
|
|
|
661
736
|
:param name: Name of the data stream, which must meet the following criteria:
|
|
662
737
|
Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`,
|
|
@@ -696,6 +771,71 @@ class IndicesClient(NamespacedClient):
|
|
|
696
771
|
path_parts=__path_parts,
|
|
697
772
|
)
|
|
698
773
|
|
|
774
|
+
@_rewrite_parameters(
|
|
775
|
+
body_name="create_from",
|
|
776
|
+
)
|
|
777
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
778
|
+
async 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 await 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
|
+
|
|
699
839
|
@_rewrite_parameters()
|
|
700
840
|
async def data_streams_stats(
|
|
701
841
|
self,
|
|
@@ -715,9 +855,13 @@ class IndicesClient(NamespacedClient):
|
|
|
715
855
|
pretty: t.Optional[bool] = None,
|
|
716
856
|
) -> ObjectApiResponse[t.Any]:
|
|
717
857
|
"""
|
|
718
|
-
|
|
858
|
+
.. raw:: html
|
|
859
|
+
|
|
860
|
+
<p>Get data stream stats.</p>
|
|
861
|
+
<p>Get statistics for one or more data streams.</p>
|
|
862
|
+
|
|
719
863
|
|
|
720
|
-
`<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>`_
|
|
721
865
|
|
|
722
866
|
:param name: Comma-separated list of data streams used to limit the request.
|
|
723
867
|
Wildcard expressions (`*`) are supported. To target all data streams in a
|
|
@@ -776,13 +920,17 @@ class IndicesClient(NamespacedClient):
|
|
|
776
920
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
777
921
|
) -> ObjectApiResponse[t.Any]:
|
|
778
922
|
"""
|
|
779
|
-
|
|
780
|
-
It does not delete related Kibana components, such as data views, visualizations,
|
|
781
|
-
or dashboards. You cannot delete the current write index of a data stream. To
|
|
782
|
-
delete the index, you must roll over the data stream so a new write index is
|
|
783
|
-
created. You can then use the delete index API to delete the previous write index.
|
|
923
|
+
.. raw:: html
|
|
784
924
|
|
|
785
|
-
|
|
925
|
+
<p>Delete indices.
|
|
926
|
+
Deleting an index deletes its documents, shards, and metadata.
|
|
927
|
+
It does not delete related Kibana components, such as data views, visualizations, or dashboards.</p>
|
|
928
|
+
<p>You cannot delete the current write index of a data stream.
|
|
929
|
+
To delete the index, you must roll over the data stream so a new write index is created.
|
|
930
|
+
You can then use the delete index API to delete the previous write index.</p>
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-index.html>`_
|
|
786
934
|
|
|
787
935
|
:param index: Comma-separated list of indices to delete. You cannot specify index
|
|
788
936
|
aliases. By default, this parameter does not support wildcards (`*`) or `_all`.
|
|
@@ -850,9 +998,13 @@ class IndicesClient(NamespacedClient):
|
|
|
850
998
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
851
999
|
) -> ObjectApiResponse[t.Any]:
|
|
852
1000
|
"""
|
|
853
|
-
|
|
1001
|
+
.. raw:: html
|
|
1002
|
+
|
|
1003
|
+
<p>Delete an alias.
|
|
1004
|
+
Removes a data stream or index from an alias.</p>
|
|
854
1005
|
|
|
855
|
-
|
|
1006
|
+
|
|
1007
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-alias.html>`_
|
|
856
1008
|
|
|
857
1009
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
858
1010
|
request. Supports wildcards (`*`).
|
|
@@ -914,10 +1066,13 @@ class IndicesClient(NamespacedClient):
|
|
|
914
1066
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
915
1067
|
) -> ObjectApiResponse[t.Any]:
|
|
916
1068
|
"""
|
|
917
|
-
|
|
918
|
-
|
|
1069
|
+
.. raw:: html
|
|
1070
|
+
|
|
1071
|
+
<p>Delete data stream lifecycles.
|
|
1072
|
+
Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle.</p>
|
|
919
1073
|
|
|
920
|
-
|
|
1074
|
+
|
|
1075
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-streams-delete-lifecycle.html>`_
|
|
921
1076
|
|
|
922
1077
|
:param name: A comma-separated list of data streams of which the data stream
|
|
923
1078
|
lifecycle will be deleted; use `*` to get all data streams
|
|
@@ -975,9 +1130,13 @@ class IndicesClient(NamespacedClient):
|
|
|
975
1130
|
pretty: t.Optional[bool] = None,
|
|
976
1131
|
) -> ObjectApiResponse[t.Any]:
|
|
977
1132
|
"""
|
|
978
|
-
|
|
1133
|
+
.. raw:: html
|
|
1134
|
+
|
|
1135
|
+
<p>Delete data streams.
|
|
1136
|
+
Deletes one or more data streams and their backing indices.</p>
|
|
1137
|
+
|
|
979
1138
|
|
|
980
|
-
`<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>`_
|
|
981
1140
|
|
|
982
1141
|
:param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions
|
|
983
1142
|
are supported.
|
|
@@ -1027,12 +1186,15 @@ class IndicesClient(NamespacedClient):
|
|
|
1027
1186
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1028
1187
|
) -> ObjectApiResponse[t.Any]:
|
|
1029
1188
|
"""
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1189
|
+
.. raw:: html
|
|
1190
|
+
|
|
1191
|
+
<p>Delete an index template.
|
|
1192
|
+
The provided <!-- raw HTML omitted --> may contain multiple template names separated by a comma. If multiple template
|
|
1193
|
+
names are specified then there is no wildcard support and the provided names should match completely with
|
|
1194
|
+
existing templates.</p>
|
|
1195
|
+
|
|
1034
1196
|
|
|
1035
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1197
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-template.html>`_
|
|
1036
1198
|
|
|
1037
1199
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
1038
1200
|
Wildcard (*) expressions are supported.
|
|
@@ -1082,9 +1244,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1082
1244
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1083
1245
|
) -> ObjectApiResponse[t.Any]:
|
|
1084
1246
|
"""
|
|
1085
|
-
|
|
1247
|
+
.. raw:: html
|
|
1086
1248
|
|
|
1087
|
-
|
|
1249
|
+
<p>Delete a legacy index template.</p>
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-delete-template-v1.html>`_
|
|
1088
1253
|
|
|
1089
1254
|
:param name: The name of the legacy index template to delete. Wildcard (`*`)
|
|
1090
1255
|
expressions are supported.
|
|
@@ -1145,18 +1310,18 @@ class IndicesClient(NamespacedClient):
|
|
|
1145
1310
|
run_expensive_tasks: t.Optional[bool] = None,
|
|
1146
1311
|
) -> ObjectApiResponse[t.Any]:
|
|
1147
1312
|
"""
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
field is overestimated.
|
|
1313
|
+
.. raw:: html
|
|
1314
|
+
|
|
1315
|
+
<p>Analyze the index disk usage.
|
|
1316
|
+
Analyze the disk usage of each field of an index or data stream.
|
|
1317
|
+
This API might not support indices created in previous Elasticsearch versions.
|
|
1318
|
+
The result of a small index can be inaccurate as some parts of an index might not be analyzed by the API.</p>
|
|
1319
|
+
<p>NOTE: The total size of fields of the analyzed shards of the index in the response is usually smaller than the index <code>store_size</code> value because some small metadata files are ignored and some parts of data files might not be scanned by the API.
|
|
1320
|
+
Since stored fields are stored together in a compressed format, the sizes of stored fields are also estimates and can be inaccurate.
|
|
1321
|
+
The stored size of the <code>_id</code> field is likely underestimated while the <code>_source</code> field is overestimated.</p>
|
|
1158
1322
|
|
|
1159
|
-
|
|
1323
|
+
|
|
1324
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-disk-usage.html>`_
|
|
1160
1325
|
|
|
1161
1326
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
1162
1327
|
to limit the request. It’s recommended to execute this API with a single
|
|
@@ -1228,16 +1393,18 @@ class IndicesClient(NamespacedClient):
|
|
|
1228
1393
|
pretty: t.Optional[bool] = None,
|
|
1229
1394
|
) -> ObjectApiResponse[t.Any]:
|
|
1230
1395
|
"""
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1396
|
+
.. raw:: html
|
|
1397
|
+
|
|
1398
|
+
<p>Downsample an index.
|
|
1399
|
+
Aggregate a time series (TSDS) index and store pre-computed statistical summaries (<code>min</code>, <code>max</code>, <code>sum</code>, <code>value_count</code> and <code>avg</code>) for each metric field grouped by a configured time interval.
|
|
1400
|
+
For example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index.
|
|
1401
|
+
All documents within an hour interval are summarized and stored as a single document in the downsample index.</p>
|
|
1402
|
+
<p>NOTE: Only indices in a time series data stream are supported.
|
|
1403
|
+
Neither field nor document level security can be defined on the source index.
|
|
1404
|
+
The source index must be read only (<code>index.blocks.write: true</code>).</p>
|
|
1239
1405
|
|
|
1240
|
-
|
|
1406
|
+
|
|
1407
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-downsample-data-stream.html>`_
|
|
1241
1408
|
|
|
1242
1409
|
:param index: Name of the time series index to downsample.
|
|
1243
1410
|
:param target_index: Name of the index to create.
|
|
@@ -1303,9 +1470,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1303
1470
|
pretty: t.Optional[bool] = None,
|
|
1304
1471
|
) -> HeadApiResponse:
|
|
1305
1472
|
"""
|
|
1306
|
-
|
|
1473
|
+
.. raw:: html
|
|
1474
|
+
|
|
1475
|
+
<p>Check indices.
|
|
1476
|
+
Check if one or more indices, index aliases, or data streams exist.</p>
|
|
1477
|
+
|
|
1307
1478
|
|
|
1308
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1479
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-exists.html>`_
|
|
1309
1480
|
|
|
1310
1481
|
:param index: Comma-separated list of data streams, indices, and aliases. Supports
|
|
1311
1482
|
wildcards (`*`).
|
|
@@ -1381,9 +1552,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1381
1552
|
pretty: t.Optional[bool] = None,
|
|
1382
1553
|
) -> HeadApiResponse:
|
|
1383
1554
|
"""
|
|
1384
|
-
|
|
1555
|
+
.. raw:: html
|
|
1556
|
+
|
|
1557
|
+
<p>Check aliases.</p>
|
|
1558
|
+
<p>Check if one or more data stream or index aliases exist.</p>
|
|
1559
|
+
|
|
1385
1560
|
|
|
1386
|
-
`<https://www.elastic.co/
|
|
1561
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-exists-alias>`_
|
|
1387
1562
|
|
|
1388
1563
|
:param name: Comma-separated list of aliases to check. Supports wildcards (`*`).
|
|
1389
1564
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
@@ -1446,17 +1621,27 @@ class IndicesClient(NamespacedClient):
|
|
|
1446
1621
|
name: str,
|
|
1447
1622
|
error_trace: t.Optional[bool] = None,
|
|
1448
1623
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1624
|
+
flat_settings: t.Optional[bool] = None,
|
|
1449
1625
|
human: t.Optional[bool] = None,
|
|
1626
|
+
local: t.Optional[bool] = None,
|
|
1450
1627
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1451
1628
|
pretty: t.Optional[bool] = None,
|
|
1452
1629
|
) -> HeadApiResponse:
|
|
1453
1630
|
"""
|
|
1454
|
-
|
|
1631
|
+
.. raw:: html
|
|
1632
|
+
|
|
1633
|
+
<p>Check index templates.</p>
|
|
1634
|
+
<p>Check whether index templates exist.</p>
|
|
1455
1635
|
|
|
1456
|
-
|
|
1636
|
+
|
|
1637
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-exists-index-template>`_
|
|
1457
1638
|
|
|
1458
1639
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
1459
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.
|
|
1460
1645
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
1461
1646
|
no response is received before the timeout expires, the request fails and
|
|
1462
1647
|
returns an error.
|
|
@@ -1470,8 +1655,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1470
1655
|
__query["error_trace"] = error_trace
|
|
1471
1656
|
if filter_path is not None:
|
|
1472
1657
|
__query["filter_path"] = filter_path
|
|
1658
|
+
if flat_settings is not None:
|
|
1659
|
+
__query["flat_settings"] = flat_settings
|
|
1473
1660
|
if human is not None:
|
|
1474
1661
|
__query["human"] = human
|
|
1662
|
+
if local is not None:
|
|
1663
|
+
__query["local"] = local
|
|
1475
1664
|
if master_timeout is not None:
|
|
1476
1665
|
__query["master_timeout"] = master_timeout
|
|
1477
1666
|
if pretty is not None:
|
|
@@ -1500,13 +1689,15 @@ class IndicesClient(NamespacedClient):
|
|
|
1500
1689
|
pretty: t.Optional[bool] = None,
|
|
1501
1690
|
) -> HeadApiResponse:
|
|
1502
1691
|
"""
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1692
|
+
.. raw:: html
|
|
1693
|
+
|
|
1694
|
+
<p>Check existence of index templates.
|
|
1695
|
+
Get information about whether index templates exist.
|
|
1696
|
+
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.</p>
|
|
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>
|
|
1698
|
+
|
|
1508
1699
|
|
|
1509
|
-
`<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>`_
|
|
1510
1701
|
|
|
1511
1702
|
:param name: A comma-separated list of index template names used to limit the
|
|
1512
1703
|
request. Wildcard (`*`) expressions are supported.
|
|
@@ -1558,12 +1749,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1558
1749
|
pretty: t.Optional[bool] = None,
|
|
1559
1750
|
) -> ObjectApiResponse[t.Any]:
|
|
1560
1751
|
"""
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1752
|
+
.. raw:: html
|
|
1753
|
+
|
|
1754
|
+
<p>Get the status for a data stream lifecycle.
|
|
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>
|
|
1756
|
+
|
|
1565
1757
|
|
|
1566
|
-
`<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>`_
|
|
1567
1759
|
|
|
1568
1760
|
:param index: The name of the index to explain
|
|
1569
1761
|
:param include_defaults: indicates if the API should return the default values
|
|
@@ -1617,23 +1809,20 @@ class IndicesClient(NamespacedClient):
|
|
|
1617
1809
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1618
1810
|
human: t.Optional[bool] = None,
|
|
1619
1811
|
ignore_unavailable: t.Optional[bool] = None,
|
|
1620
|
-
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1621
1812
|
pretty: t.Optional[bool] = None,
|
|
1622
|
-
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1623
|
-
wait_for_active_shards: t.Optional[
|
|
1624
|
-
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
|
|
1625
|
-
] = None,
|
|
1626
1813
|
) -> ObjectApiResponse[t.Any]:
|
|
1627
1814
|
"""
|
|
1628
|
-
|
|
1629
|
-
an index. Field usage statistics are automatically captured when queries are
|
|
1630
|
-
running on a cluster. A shard-level search request that accesses a given field,
|
|
1631
|
-
even if multiple times during that request, is counted as a single use. The response
|
|
1632
|
-
body reports the per-shard usage count of the data structures that back the fields
|
|
1633
|
-
in the index. A given request will increment each count by a maximum value of
|
|
1634
|
-
1, even if the request accesses the same field multiple times.
|
|
1815
|
+
.. raw:: html
|
|
1635
1816
|
|
|
1636
|
-
|
|
1817
|
+
<p>Get field usage stats.
|
|
1818
|
+
Get field usage information for each shard and field of an index.
|
|
1819
|
+
Field usage statistics are automatically captured when queries are running on a cluster.
|
|
1820
|
+
A shard-level search request that accesses a given field, even if multiple times during that request, is counted as a single use.</p>
|
|
1821
|
+
<p>The response body reports the per-shard usage count of the data structures that back the fields in the index.
|
|
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>
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/field-usage-stats.html>`_
|
|
1637
1826
|
|
|
1638
1827
|
:param index: Comma-separated list or wildcard expression of index names used
|
|
1639
1828
|
to limit the request.
|
|
@@ -1650,14 +1839,6 @@ class IndicesClient(NamespacedClient):
|
|
|
1650
1839
|
in the statistics.
|
|
1651
1840
|
:param ignore_unavailable: If `true`, missing or closed indices are not included
|
|
1652
1841
|
in the response.
|
|
1653
|
-
:param master_timeout: Period to wait for a connection to the master node. If
|
|
1654
|
-
no response is received before the timeout expires, the request fails and
|
|
1655
|
-
returns an error.
|
|
1656
|
-
:param timeout: Period to wait for a response. If no response is received before
|
|
1657
|
-
the timeout expires, the request fails and returns an error.
|
|
1658
|
-
:param wait_for_active_shards: The number of shard copies that must be active
|
|
1659
|
-
before proceeding with the operation. Set to all or any positive integer
|
|
1660
|
-
up to the total number of shards in the index (`number_of_replicas+1`).
|
|
1661
1842
|
"""
|
|
1662
1843
|
if index in SKIP_IN_PATH:
|
|
1663
1844
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
@@ -1678,14 +1859,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1678
1859
|
__query["human"] = human
|
|
1679
1860
|
if ignore_unavailable is not None:
|
|
1680
1861
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
1681
|
-
if master_timeout is not None:
|
|
1682
|
-
__query["master_timeout"] = master_timeout
|
|
1683
1862
|
if pretty is not None:
|
|
1684
1863
|
__query["pretty"] = pretty
|
|
1685
|
-
if timeout is not None:
|
|
1686
|
-
__query["timeout"] = timeout
|
|
1687
|
-
if wait_for_active_shards is not None:
|
|
1688
|
-
__query["wait_for_active_shards"] = wait_for_active_shards
|
|
1689
1864
|
__headers = {"accept": "application/json"}
|
|
1690
1865
|
return await self.perform_request( # type: ignore[return-value]
|
|
1691
1866
|
"GET",
|
|
@@ -1719,24 +1894,20 @@ class IndicesClient(NamespacedClient):
|
|
|
1719
1894
|
wait_if_ongoing: t.Optional[bool] = None,
|
|
1720
1895
|
) -> ObjectApiResponse[t.Any]:
|
|
1721
1896
|
"""
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
documents then a successful response indicates that Elasticsearch has flushed
|
|
1737
|
-
all the documents that were indexed before the flush API was called.
|
|
1738
|
-
|
|
1739
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-flush.html>`_
|
|
1897
|
+
.. raw:: html
|
|
1898
|
+
|
|
1899
|
+
<p>Flush data streams or indices.
|
|
1900
|
+
Flushing a data stream or index is the process of making sure that any data that is currently only stored in the transaction log is also permanently stored in the Lucene index.
|
|
1901
|
+
When restarting, Elasticsearch replays any unflushed operations from the transaction log into the Lucene index to bring it back into the state that it was in before the restart.
|
|
1902
|
+
Elasticsearch automatically triggers flushes as needed, using heuristics that trade off the size of the unflushed transaction log against the cost of performing each flush.</p>
|
|
1903
|
+
<p>After each operation has been flushed it is permanently stored in the Lucene index.
|
|
1904
|
+
This may mean that there is no need to maintain an additional copy of it in the transaction log.
|
|
1905
|
+
The transaction log is made up of multiple files, called generations, and Elasticsearch will delete any generation files when they are no longer needed, freeing up disk space.</p>
|
|
1906
|
+
<p>It is also possible to trigger a flush on one or more indices using the flush API, although it is rare for users to need to call this API directly.
|
|
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>
|
|
1908
|
+
|
|
1909
|
+
|
|
1910
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-flush.html>`_
|
|
1740
1911
|
|
|
1741
1912
|
:param index: Comma-separated list of data streams, indices, and aliases to flush.
|
|
1742
1913
|
Supports wildcards (`*`). To flush all data streams and indices, omit this
|
|
@@ -1817,51 +1988,51 @@ class IndicesClient(NamespacedClient):
|
|
|
1817
1988
|
wait_for_completion: t.Optional[bool] = None,
|
|
1818
1989
|
) -> ObjectApiResponse[t.Any]:
|
|
1819
1990
|
"""
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1991
|
+
.. raw:: html
|
|
1992
|
+
|
|
1993
|
+
<p>Force a merge.
|
|
1994
|
+
Perform the force merge operation on the shards of one or more indices.
|
|
1995
|
+
For data streams, the API forces a merge on the shards of the stream's backing indices.</p>
|
|
1996
|
+
<p>Merging reduces the number of segments in each shard by merging some of them together and also frees up the space used by deleted documents.
|
|
1997
|
+
Merging normally happens automatically, but sometimes it is useful to trigger a merge manually.</p>
|
|
1998
|
+
<p>WARNING: We recommend force merging only a read-only index (meaning the index is no longer receiving writes).
|
|
1999
|
+
When documents are updated or deleted, the old version is not immediately removed but instead soft-deleted and marked with a "tombstone".
|
|
2000
|
+
These soft-deleted documents are automatically cleaned up during regular segment merges.
|
|
2001
|
+
But force merge can cause very large (greater than 5 GB) segments to be produced, which are not eligible for regular merges.
|
|
2002
|
+
So the number of soft-deleted documents can then grow rapidly, resulting in higher disk usage and worse search performance.
|
|
2003
|
+
If you regularly force merge an index receiving writes, this can also make snapshots more expensive, since the new documents can't be backed up incrementally.</p>
|
|
2004
|
+
<p><strong>Blocks during a force merge</strong></p>
|
|
2005
|
+
<p>Calls to this API block until the merge is complete (unless request contains <code>wait_for_completion=false</code>).
|
|
2006
|
+
If the client connection is lost before completion then the force merge process will continue in the background.
|
|
2007
|
+
Any new requests to force merge the same indices will also block until the ongoing force merge is complete.</p>
|
|
2008
|
+
<p><strong>Running force merge asynchronously</strong></p>
|
|
2009
|
+
<p>If the request contains <code>wait_for_completion=false</code>, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to get the status of the task.
|
|
2010
|
+
However, you can not cancel this task as the force merge task is not cancelable.
|
|
2011
|
+
Elasticsearch creates a record of this task as a document at <code>_tasks/<task_id></code>.
|
|
2012
|
+
When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.</p>
|
|
2013
|
+
<p><strong>Force merging multiple indices</strong></p>
|
|
2014
|
+
<p>You can force merge multiple indices with a single request by targeting:</p>
|
|
2015
|
+
<ul>
|
|
2016
|
+
<li>One or more data streams that contain multiple backing indices</li>
|
|
2017
|
+
<li>Multiple indices</li>
|
|
2018
|
+
<li>One or more aliases</li>
|
|
2019
|
+
<li>All data streams and indices in a cluster</li>
|
|
2020
|
+
</ul>
|
|
2021
|
+
<p>Each targeted shard is force-merged separately using the force_merge threadpool.
|
|
2022
|
+
By default each node only has a single <code>force_merge</code> thread which means that the shards on that node are force-merged one at a time.
|
|
2023
|
+
If you expand the <code>force_merge</code> threadpool on a node then it will force merge its shards in parallel</p>
|
|
2024
|
+
<p>Force merge makes the storage for the shard being merged temporarily increase, as it may require free space up to triple its size in case <code>max_num_segments parameter</code> is set to <code>1</code>, to rewrite all segments into a new one.</p>
|
|
2025
|
+
<p><strong>Data streams and time-based indices</strong></p>
|
|
2026
|
+
<p>Force-merging is useful for managing a data stream's older backing indices and other time-based indices, particularly after a rollover.
|
|
2027
|
+
In these cases, each index only receives indexing traffic for a certain period of time.
|
|
2028
|
+
Once an index receive no more writes, its shards can be force-merged to a single segment.
|
|
2029
|
+
This can be a good idea because single-segment shards can sometimes use simpler and more efficient data structures to perform searches.
|
|
2030
|
+
For example:</p>
|
|
2031
|
+
<pre><code>POST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1
|
|
2032
|
+
</code></pre>
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-forcemerge.html>`_
|
|
1865
2036
|
|
|
1866
2037
|
:param index: A comma-separated list of index names; use `_all` or empty string
|
|
1867
2038
|
to perform the operation on all indices
|
|
@@ -1952,10 +2123,14 @@ class IndicesClient(NamespacedClient):
|
|
|
1952
2123
|
pretty: t.Optional[bool] = None,
|
|
1953
2124
|
) -> ObjectApiResponse[t.Any]:
|
|
1954
2125
|
"""
|
|
1955
|
-
|
|
1956
|
-
|
|
2126
|
+
.. raw:: html
|
|
2127
|
+
|
|
2128
|
+
<p>Get index information.
|
|
2129
|
+
Get information about one or more indices. For data streams, the API returns information about the
|
|
2130
|
+
stream’s backing indices.</p>
|
|
1957
2131
|
|
|
1958
|
-
|
|
2132
|
+
|
|
2133
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-index.html>`_
|
|
1959
2134
|
|
|
1960
2135
|
:param index: Comma-separated list of data streams, indices, and index aliases
|
|
1961
2136
|
used to limit the request. Wildcard expressions (*) are supported.
|
|
@@ -2042,9 +2217,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2042
2217
|
pretty: t.Optional[bool] = None,
|
|
2043
2218
|
) -> ObjectApiResponse[t.Any]:
|
|
2044
2219
|
"""
|
|
2045
|
-
|
|
2220
|
+
.. raw:: html
|
|
2221
|
+
|
|
2222
|
+
<p>Get aliases.
|
|
2223
|
+
Retrieves information for one or more data stream or index aliases.</p>
|
|
2224
|
+
|
|
2046
2225
|
|
|
2047
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2226
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-alias.html>`_
|
|
2048
2227
|
|
|
2049
2228
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
2050
2229
|
request. Supports wildcards (`*`). To target all data streams and indices,
|
|
@@ -2124,10 +2303,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2124
2303
|
pretty: t.Optional[bool] = None,
|
|
2125
2304
|
) -> ObjectApiResponse[t.Any]:
|
|
2126
2305
|
"""
|
|
2127
|
-
|
|
2128
|
-
of one or more data streams.
|
|
2306
|
+
.. raw:: html
|
|
2129
2307
|
|
|
2130
|
-
|
|
2308
|
+
<p>Get data stream lifecycles.</p>
|
|
2309
|
+
<p>Get the data stream lifecycle configuration of one or more data streams.</p>
|
|
2310
|
+
|
|
2311
|
+
|
|
2312
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-streams-get-lifecycle.html>`_
|
|
2131
2313
|
|
|
2132
2314
|
:param name: Comma-separated list of data streams to limit the request. Supports
|
|
2133
2315
|
wildcards (`*`). To target all data streams, omit this parameter or use `*`
|
|
@@ -2179,10 +2361,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2179
2361
|
pretty: t.Optional[bool] = None,
|
|
2180
2362
|
) -> ObjectApiResponse[t.Any]:
|
|
2181
2363
|
"""
|
|
2182
|
-
|
|
2183
|
-
|
|
2364
|
+
.. raw:: html
|
|
2365
|
+
|
|
2366
|
+
<p>Get data stream lifecycle stats.
|
|
2367
|
+
Get statistics about the data streams that are managed by a data stream lifecycle.</p>
|
|
2184
2368
|
|
|
2185
|
-
|
|
2369
|
+
|
|
2370
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/data-streams-get-lifecycle-stats.html>`_
|
|
2186
2371
|
"""
|
|
2187
2372
|
__path_parts: t.Dict[str, str] = {}
|
|
2188
2373
|
__path = "/_lifecycle/stats"
|
|
@@ -2227,9 +2412,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2227
2412
|
verbose: t.Optional[bool] = None,
|
|
2228
2413
|
) -> ObjectApiResponse[t.Any]:
|
|
2229
2414
|
"""
|
|
2230
|
-
|
|
2415
|
+
.. raw:: html
|
|
2416
|
+
|
|
2417
|
+
<p>Get data streams.</p>
|
|
2418
|
+
<p>Get information about one or more data streams.</p>
|
|
2419
|
+
|
|
2231
2420
|
|
|
2232
|
-
`<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>`_
|
|
2233
2422
|
|
|
2234
2423
|
:param name: Comma-separated list of data stream names used to limit the request.
|
|
2235
2424
|
Wildcard (`*`) expressions are supported. If omitted, all data streams are
|
|
@@ -2302,12 +2491,15 @@ class IndicesClient(NamespacedClient):
|
|
|
2302
2491
|
pretty: t.Optional[bool] = None,
|
|
2303
2492
|
) -> ObjectApiResponse[t.Any]:
|
|
2304
2493
|
"""
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2494
|
+
.. raw:: html
|
|
2495
|
+
|
|
2496
|
+
<p>Get mapping definitions.
|
|
2497
|
+
Retrieves mapping definitions for one or more fields.
|
|
2498
|
+
For data streams, the API retrieves field mappings for the stream’s backing indices.</p>
|
|
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>
|
|
2500
|
+
|
|
2309
2501
|
|
|
2310
|
-
`<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>`_
|
|
2311
2503
|
|
|
2312
2504
|
:param fields: Comma-separated list or wildcard expression of fields used to
|
|
2313
2505
|
limit returned information. Supports wildcards (`*`).
|
|
@@ -2382,9 +2574,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2382
2574
|
pretty: t.Optional[bool] = None,
|
|
2383
2575
|
) -> ObjectApiResponse[t.Any]:
|
|
2384
2576
|
"""
|
|
2385
|
-
|
|
2577
|
+
.. raw:: html
|
|
2386
2578
|
|
|
2387
|
-
|
|
2579
|
+
<p>Get index templates.
|
|
2580
|
+
Get information about one or more index templates.</p>
|
|
2581
|
+
|
|
2582
|
+
|
|
2583
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-template.html>`_
|
|
2388
2584
|
|
|
2389
2585
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
2390
2586
|
Wildcard (*) expressions are supported.
|
|
@@ -2455,10 +2651,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2455
2651
|
pretty: t.Optional[bool] = None,
|
|
2456
2652
|
) -> ObjectApiResponse[t.Any]:
|
|
2457
2653
|
"""
|
|
2458
|
-
|
|
2459
|
-
|
|
2654
|
+
.. raw:: html
|
|
2655
|
+
|
|
2656
|
+
<p>Get mapping definitions.
|
|
2657
|
+
For data streams, the API retrieves mappings for the stream’s backing indices.</p>
|
|
2460
2658
|
|
|
2461
|
-
|
|
2659
|
+
|
|
2660
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-mapping.html>`_
|
|
2462
2661
|
|
|
2463
2662
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2464
2663
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -2514,6 +2713,51 @@ class IndicesClient(NamespacedClient):
|
|
|
2514
2713
|
path_parts=__path_parts,
|
|
2515
2714
|
)
|
|
2516
2715
|
|
|
2716
|
+
@_rewrite_parameters()
|
|
2717
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
2718
|
+
async 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 await 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
|
+
|
|
2517
2761
|
@_rewrite_parameters()
|
|
2518
2762
|
async def get_settings(
|
|
2519
2763
|
self,
|
|
@@ -2540,10 +2784,14 @@ class IndicesClient(NamespacedClient):
|
|
|
2540
2784
|
pretty: t.Optional[bool] = None,
|
|
2541
2785
|
) -> ObjectApiResponse[t.Any]:
|
|
2542
2786
|
"""
|
|
2543
|
-
|
|
2544
|
-
streams, it returns setting information for the stream's backing indices.
|
|
2787
|
+
.. raw:: html
|
|
2545
2788
|
|
|
2546
|
-
|
|
2789
|
+
<p>Get index settings.
|
|
2790
|
+
Get setting information for one or more indices.
|
|
2791
|
+
For data streams, it returns setting information for the stream's backing indices.</p>
|
|
2792
|
+
|
|
2793
|
+
|
|
2794
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-settings.html>`_
|
|
2547
2795
|
|
|
2548
2796
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2549
2797
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -2628,11 +2876,14 @@ class IndicesClient(NamespacedClient):
|
|
|
2628
2876
|
pretty: t.Optional[bool] = None,
|
|
2629
2877
|
) -> ObjectApiResponse[t.Any]:
|
|
2630
2878
|
"""
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2879
|
+
.. raw:: html
|
|
2880
|
+
|
|
2881
|
+
<p>Get index templates.
|
|
2882
|
+
Get information about one or more index templates.</p>
|
|
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>
|
|
2634
2884
|
|
|
2635
|
-
|
|
2885
|
+
|
|
2886
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-get-template-v1.html>`_
|
|
2636
2887
|
|
|
2637
2888
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
2638
2889
|
Wildcard (`*`) expressions are supported. To return all index templates,
|
|
@@ -2676,6 +2927,62 @@ class IndicesClient(NamespacedClient):
|
|
|
2676
2927
|
path_parts=__path_parts,
|
|
2677
2928
|
)
|
|
2678
2929
|
|
|
2930
|
+
@_rewrite_parameters(
|
|
2931
|
+
body_name="reindex",
|
|
2932
|
+
)
|
|
2933
|
+
@_stability_warning(Stability.EXPERIMENTAL)
|
|
2934
|
+
async 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 await 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
|
+
|
|
2679
2986
|
@_rewrite_parameters()
|
|
2680
2987
|
async def migrate_to_data_stream(
|
|
2681
2988
|
self,
|
|
@@ -2689,16 +2996,22 @@ class IndicesClient(NamespacedClient):
|
|
|
2689
2996
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
2690
2997
|
) -> ObjectApiResponse[t.Any]:
|
|
2691
2998
|
"""
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2999
|
+
.. raw:: html
|
|
3000
|
+
|
|
3001
|
+
<p>Convert an index alias to a data stream.
|
|
3002
|
+
Converts an index alias to a data stream.
|
|
3003
|
+
You must have a matching index template that is data stream enabled.
|
|
3004
|
+
The alias must meet the following criteria:
|
|
3005
|
+
The alias must have a write index;
|
|
3006
|
+
All indices for the alias must have a <code>@timestamp</code> field mapping of a <code>date</code> or <code>date_nanos</code> field type;
|
|
3007
|
+
The alias must not have any filters;
|
|
3008
|
+
The alias must not use custom routing.
|
|
3009
|
+
If successful, the request removes the alias and creates a data stream with the same name.
|
|
3010
|
+
The indices for the alias become hidden backing indices for the stream.
|
|
3011
|
+
The write index for the alias becomes the write index for the stream.</p>
|
|
2700
3012
|
|
|
2701
|
-
|
|
3013
|
+
|
|
3014
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-migrate-to-data-stream>`_
|
|
2702
3015
|
|
|
2703
3016
|
:param name: Name of the index alias to convert to a data stream.
|
|
2704
3017
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -2748,10 +3061,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2748
3061
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2749
3062
|
) -> ObjectApiResponse[t.Any]:
|
|
2750
3063
|
"""
|
|
2751
|
-
|
|
2752
|
-
|
|
3064
|
+
.. raw:: html
|
|
3065
|
+
|
|
3066
|
+
<p>Update data streams.
|
|
3067
|
+
Performs one or more data stream modification actions in a single atomic operation.</p>
|
|
2753
3068
|
|
|
2754
|
-
|
|
3069
|
+
|
|
3070
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-modify-data-stream>`_
|
|
2755
3071
|
|
|
2756
3072
|
:param actions: Actions to perform.
|
|
2757
3073
|
"""
|
|
@@ -2809,29 +3125,28 @@ class IndicesClient(NamespacedClient):
|
|
|
2809
3125
|
] = None,
|
|
2810
3126
|
) -> ObjectApiResponse[t.Any]:
|
|
2811
3127
|
"""
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-open-close.html>`_
|
|
3128
|
+
.. raw:: html
|
|
3129
|
+
|
|
3130
|
+
<p>Open a closed index.
|
|
3131
|
+
For data streams, the API opens any closed backing indices.</p>
|
|
3132
|
+
<p>A closed index is blocked for read/write operations and does not allow all operations that opened indices allow.
|
|
3133
|
+
It is not possible to index documents or to search for documents in a closed index.
|
|
3134
|
+
This allows closed indices to not have to maintain internal data structures for indexing or searching documents, resulting in a smaller overhead on the cluster.</p>
|
|
3135
|
+
<p>When opening or closing an index, the master is responsible for restarting the index shards to reflect the new state of the index.
|
|
3136
|
+
The shards will then go through the normal recovery process.
|
|
3137
|
+
The data of opened or closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times.</p>
|
|
3138
|
+
<p>You can open and close multiple indices.
|
|
3139
|
+
An error is thrown if the request explicitly refers to a missing index.
|
|
3140
|
+
This behavior can be turned off by using the <code>ignore_unavailable=true</code> parameter.</p>
|
|
3141
|
+
<p>By default, you must explicitly name the indices you are opening or closing.
|
|
3142
|
+
To open or close indices with <code>_all</code>, <code>*</code>, or other wildcard expressions, change the <code>action.destructive_requires_name</code> setting to <code>false</code>.
|
|
3143
|
+
This setting can also be changed with the cluster update settings API.</p>
|
|
3144
|
+
<p>Closed indices consume a significant amount of disk-space which can cause problems in managed environments.
|
|
3145
|
+
Closing indices can be turned off with the cluster settings API by setting <code>cluster.indices.close.enable</code> to <code>false</code>.</p>
|
|
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>
|
|
3147
|
+
|
|
3148
|
+
|
|
3149
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-open-close.html>`_
|
|
2835
3150
|
|
|
2836
3151
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2837
3152
|
to limit the request. Supports wildcards (`*`). By default, you must explicitly
|
|
@@ -2904,20 +3219,20 @@ class IndicesClient(NamespacedClient):
|
|
|
2904
3219
|
pretty: t.Optional[bool] = None,
|
|
2905
3220
|
) -> ObjectApiResponse[t.Any]:
|
|
2906
3221
|
"""
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
`<https://www.elastic.co/
|
|
3222
|
+
.. raw:: html
|
|
3223
|
+
|
|
3224
|
+
<p>Promote a data stream.
|
|
3225
|
+
Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.</p>
|
|
3226
|
+
<p>With CCR auto following, a data stream from a remote cluster can be replicated to the local cluster.
|
|
3227
|
+
These data streams can't be rolled over in the local cluster.
|
|
3228
|
+
These replicated data streams roll over only if the upstream data stream rolls over.
|
|
3229
|
+
In the event that the remote cluster is no longer available, the data stream in the local cluster can be promoted to a regular data stream, which allows these data streams to be rolled over in the local cluster.</p>
|
|
3230
|
+
<p>NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream.
|
|
3231
|
+
If this is missing, the data stream will not be able to roll over until a matching index template is created.
|
|
3232
|
+
This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.</p>
|
|
3233
|
+
|
|
3234
|
+
|
|
3235
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-promote-data-stream>`_
|
|
2921
3236
|
|
|
2922
3237
|
:param name: The name of the data stream
|
|
2923
3238
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -2977,9 +3292,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2977
3292
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2978
3293
|
) -> ObjectApiResponse[t.Any]:
|
|
2979
3294
|
"""
|
|
2980
|
-
|
|
3295
|
+
.. raw:: html
|
|
3296
|
+
|
|
3297
|
+
<p>Create or update an alias.
|
|
3298
|
+
Adds a data stream or index to an alias.</p>
|
|
2981
3299
|
|
|
2982
|
-
|
|
3300
|
+
|
|
3301
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-put-alias>`_
|
|
2983
3302
|
|
|
2984
3303
|
:param index: Comma-separated list of data streams or indices to add. Supports
|
|
2985
3304
|
wildcards (`*`). Wildcard patterns that match both data streams and indices
|
|
@@ -3054,7 +3373,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3054
3373
|
)
|
|
3055
3374
|
|
|
3056
3375
|
@_rewrite_parameters(
|
|
3057
|
-
body_fields=("data_retention", "downsampling"),
|
|
3376
|
+
body_fields=("data_retention", "downsampling", "enabled"),
|
|
3058
3377
|
)
|
|
3059
3378
|
async def put_data_lifecycle(
|
|
3060
3379
|
self,
|
|
@@ -3062,6 +3381,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3062
3381
|
name: t.Union[str, t.Sequence[str]],
|
|
3063
3382
|
data_retention: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3064
3383
|
downsampling: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3384
|
+
enabled: t.Optional[bool] = None,
|
|
3065
3385
|
error_trace: t.Optional[bool] = None,
|
|
3066
3386
|
expand_wildcards: t.Optional[
|
|
3067
3387
|
t.Union[
|
|
@@ -3079,10 +3399,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3079
3399
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3080
3400
|
) -> ObjectApiResponse[t.Any]:
|
|
3081
3401
|
"""
|
|
3082
|
-
|
|
3083
|
-
|
|
3402
|
+
.. raw:: html
|
|
3403
|
+
|
|
3404
|
+
<p>Update data stream lifecycles.
|
|
3405
|
+
Update the data stream lifecycle of the specified data streams.</p>
|
|
3406
|
+
|
|
3084
3407
|
|
|
3085
|
-
`<https://www.elastic.co/
|
|
3408
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-put-data-lifecycle>`_
|
|
3086
3409
|
|
|
3087
3410
|
:param name: Comma-separated list of data streams used to limit the request.
|
|
3088
3411
|
Supports wildcards (`*`). To target all data streams use `*` or `_all`.
|
|
@@ -3090,9 +3413,11 @@ class IndicesClient(NamespacedClient):
|
|
|
3090
3413
|
be stored at least for this time frame. Any time after this duration the
|
|
3091
3414
|
document could be deleted. When empty, every document in this data stream
|
|
3092
3415
|
will be stored indefinitely.
|
|
3093
|
-
:param downsampling:
|
|
3094
|
-
|
|
3095
|
-
|
|
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.
|
|
3096
3421
|
:param expand_wildcards: Type of data stream that wildcard patterns can match.
|
|
3097
3422
|
Supports comma-separated values, such as `open,hidden`. Valid values are:
|
|
3098
3423
|
`all`, `hidden`, `open`, `closed`, `none`.
|
|
@@ -3127,6 +3452,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3127
3452
|
__body["data_retention"] = data_retention
|
|
3128
3453
|
if downsampling is not None:
|
|
3129
3454
|
__body["downsampling"] = downsampling
|
|
3455
|
+
if enabled is not None:
|
|
3456
|
+
__body["enabled"] = enabled
|
|
3130
3457
|
if not __body:
|
|
3131
3458
|
__body = None # type: ignore[assignment]
|
|
3132
3459
|
__headers = {"accept": "application/json"}
|
|
@@ -3181,36 +3508,32 @@ class IndicesClient(NamespacedClient):
|
|
|
3181
3508
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3182
3509
|
) -> ObjectApiResponse[t.Any]:
|
|
3183
3510
|
"""
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
default new `dynamic_templates` entries are appended onto the end. If an entry
|
|
3211
|
-
already exists with the same key, then it is overwritten by the new definition.
|
|
3212
|
-
|
|
3213
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-template.html>`_
|
|
3511
|
+
.. raw:: html
|
|
3512
|
+
|
|
3513
|
+
<p>Create or update an index template.
|
|
3514
|
+
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.</p>
|
|
3515
|
+
<p>Elasticsearch applies templates to new indices based on an wildcard pattern that matches the index name.
|
|
3516
|
+
Index templates are applied during data stream or index creation.
|
|
3517
|
+
For data streams, these settings and mappings are applied when the stream's backing indices are created.
|
|
3518
|
+
Settings and mappings specified in a create index API request override any settings or mappings specified in an index template.
|
|
3519
|
+
Changes to index templates do not affect existing indices, including the existing backing indices of a data stream.</p>
|
|
3520
|
+
<p>You can use C-style <code>/* *\\/</code> block comments in index templates.
|
|
3521
|
+
You can include comments anywhere in the request body, except before the opening curly bracket.</p>
|
|
3522
|
+
<p><strong>Multiple matching templates</strong></p>
|
|
3523
|
+
<p>If multiple index templates match the name of a new index or data stream, the template with the highest priority is used.</p>
|
|
3524
|
+
<p>Multiple templates with overlapping index patterns at the same priority are not allowed and an error will be thrown when attempting to create a template matching an existing index template at identical priorities.</p>
|
|
3525
|
+
<p><strong>Composing aliases, mappings, and settings</strong></p>
|
|
3526
|
+
<p>When multiple component templates are specified in the <code>composed_of</code> field for an index template, they are merged in the order specified, meaning that later component templates override earlier component templates.
|
|
3527
|
+
Any mappings, settings, or aliases from the parent index template are merged in next.
|
|
3528
|
+
Finally, any configuration on the index request itself is merged.
|
|
3529
|
+
Mapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration.
|
|
3530
|
+
If a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one.
|
|
3531
|
+
This recursive merging strategy applies not only to field mappings, but also root options like <code>dynamic_templates</code> and <code>meta</code>.
|
|
3532
|
+
If an earlier component contains a <code>dynamic_templates</code> block, then by default new <code>dynamic_templates</code> entries are appended onto the end.
|
|
3533
|
+
If an entry already exists with the same key, then it is overwritten by the new definition.</p>
|
|
3534
|
+
|
|
3535
|
+
|
|
3536
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-put-index-template>`_
|
|
3214
3537
|
|
|
3215
3538
|
:param name: Index or template name
|
|
3216
3539
|
:param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
|
|
@@ -3341,10 +3664,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3341
3664
|
] = None,
|
|
3342
3665
|
dynamic_date_formats: t.Optional[t.Sequence[str]] = None,
|
|
3343
3666
|
dynamic_templates: t.Optional[
|
|
3344
|
-
t.
|
|
3345
|
-
t.Mapping[str, t.Mapping[str, t.Any]],
|
|
3346
|
-
t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]],
|
|
3347
|
-
]
|
|
3667
|
+
t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]]
|
|
3348
3668
|
] = None,
|
|
3349
3669
|
error_trace: t.Optional[bool] = None,
|
|
3350
3670
|
expand_wildcards: t.Optional[
|
|
@@ -3372,29 +3692,31 @@ class IndicesClient(NamespacedClient):
|
|
|
3372
3692
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3373
3693
|
) -> ObjectApiResponse[t.Any]:
|
|
3374
3694
|
"""
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3695
|
+
.. raw:: html
|
|
3696
|
+
|
|
3697
|
+
<p>Update field mappings.
|
|
3698
|
+
Add new fields to an existing data stream or index.
|
|
3699
|
+
You can also use this API to change the search settings of existing fields and add new properties to existing object fields.
|
|
3700
|
+
For data streams, these changes are applied to all backing indices by default.</p>
|
|
3701
|
+
<p><strong>Add multi-fields to an existing field</strong></p>
|
|
3702
|
+
<p>Multi-fields let you index the same field in different ways.
|
|
3703
|
+
You can use this API to update the fields mapping parameter and enable multi-fields for an existing field.
|
|
3704
|
+
WARNING: If an index (or data stream) contains documents when you add a multi-field, those documents will not have values for the new multi-field.
|
|
3705
|
+
You can populate the new multi-field with the update by query API.</p>
|
|
3706
|
+
<p><strong>Change supported mapping parameters for an existing field</strong></p>
|
|
3707
|
+
<p>The documentation for each mapping parameter indicates whether you can update it for an existing field using this API.
|
|
3708
|
+
For example, you can use the update mapping API to update the <code>ignore_above</code> parameter.</p>
|
|
3709
|
+
<p><strong>Change the mapping of an existing field</strong></p>
|
|
3710
|
+
<p>Except for supported mapping parameters, you can't change the mapping or field type of an existing field.
|
|
3711
|
+
Changing an existing field could invalidate data that's already indexed.</p>
|
|
3712
|
+
<p>If you need to change the mapping of a field in a data stream's backing indices, refer to documentation about modifying data streams.
|
|
3713
|
+
If you need to change the mapping of a field in other indices, create a new index with the correct mapping and reindex your data into that index.</p>
|
|
3714
|
+
<p><strong>Rename a field</strong></p>
|
|
3715
|
+
<p>Renaming a field would invalidate data already indexed under the old field name.
|
|
3716
|
+
Instead, add an alias field to create an alternate field name.</p>
|
|
3717
|
+
|
|
3718
|
+
|
|
3719
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-put-mapping.html>`_
|
|
3398
3720
|
|
|
3399
3721
|
:param index: A comma-separated list of index names the mapping should be added
|
|
3400
3722
|
to (supports wildcards); use `_all` or omit to add the mapping on all indices.
|
|
@@ -3518,26 +3840,29 @@ class IndicesClient(NamespacedClient):
|
|
|
3518
3840
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3519
3841
|
preserve_existing: t.Optional[bool] = None,
|
|
3520
3842
|
pretty: t.Optional[bool] = None,
|
|
3843
|
+
reopen: t.Optional[bool] = None,
|
|
3521
3844
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3522
3845
|
) -> ObjectApiResponse[t.Any]:
|
|
3523
3846
|
"""
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3847
|
+
.. raw:: html
|
|
3848
|
+
|
|
3849
|
+
<p>Update index settings.
|
|
3850
|
+
Changes dynamic index settings in real time.
|
|
3851
|
+
For data streams, index setting changes are applied to all backing indices by default.</p>
|
|
3852
|
+
<p>To revert a setting to the default value, use a null value.
|
|
3853
|
+
The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
|
|
3854
|
+
To preserve existing settings from being updated, set the <code>preserve_existing</code> parameter to <code>true</code>.</p>
|
|
3855
|
+
<p>NOTE: You can only define new analyzers on closed indices.
|
|
3856
|
+
To add an analyzer, you must close the index, define the analyzer, and reopen the index.
|
|
3857
|
+
You cannot close the write index of a data stream.
|
|
3858
|
+
To update the analyzer for a data stream's write index and future backing indices, update the analyzer in the index template used by the stream.
|
|
3859
|
+
Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
|
|
3860
|
+
This affects searches and any new data added to the stream after the rollover.
|
|
3861
|
+
However, it does not affect the data stream's backing indices or their existing data.
|
|
3862
|
+
To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.</p>
|
|
3863
|
+
|
|
3864
|
+
|
|
3865
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-update-settings.html>`_
|
|
3541
3866
|
|
|
3542
3867
|
:param settings:
|
|
3543
3868
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
@@ -3558,6 +3883,9 @@ class IndicesClient(NamespacedClient):
|
|
|
3558
3883
|
no response is received before the timeout expires, the request fails and
|
|
3559
3884
|
returns an error.
|
|
3560
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.
|
|
3561
3889
|
:param timeout: Period to wait for a response. If no response is received before
|
|
3562
3890
|
the timeout expires, the request fails and returns an error.
|
|
3563
3891
|
"""
|
|
@@ -3595,6 +3923,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3595
3923
|
__query["preserve_existing"] = preserve_existing
|
|
3596
3924
|
if pretty is not None:
|
|
3597
3925
|
__query["pretty"] = pretty
|
|
3926
|
+
if reopen is not None:
|
|
3927
|
+
__query["reopen"] = reopen
|
|
3598
3928
|
if timeout is not None:
|
|
3599
3929
|
__query["timeout"] = timeout
|
|
3600
3930
|
__body = settings if settings is not None else body
|
|
@@ -3639,30 +3969,30 @@ class IndicesClient(NamespacedClient):
|
|
|
3639
3969
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3640
3970
|
) -> ObjectApiResponse[t.Any]:
|
|
3641
3971
|
"""
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3972
|
+
.. raw:: html
|
|
3973
|
+
|
|
3974
|
+
<p>Create or update an index template.
|
|
3975
|
+
Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
|
|
3976
|
+
Elasticsearch applies templates to new indices based on an index pattern that matches the index name.</p>
|
|
3977
|
+
<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>
|
|
3978
|
+
<p>Composable templates always take precedence over legacy templates.
|
|
3979
|
+
If no composable template matches a new index, matching legacy templates are applied according to their order.</p>
|
|
3980
|
+
<p>Index templates are only applied during index creation.
|
|
3981
|
+
Changes to index templates do not affect existing indices.
|
|
3982
|
+
Settings and mappings specified in create index API requests override any settings or mappings specified in an index template.</p>
|
|
3983
|
+
<p>You can use C-style <code>/* *\\/</code> block comments in index templates.
|
|
3984
|
+
You can include comments anywhere in the request body, except before the opening curly bracket.</p>
|
|
3985
|
+
<p><strong>Indices matching multiple templates</strong></p>
|
|
3986
|
+
<p>Multiple index templates can potentially match an index, in this case, both the settings and mappings are merged into the final configuration of the index.
|
|
3987
|
+
The order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them.
|
|
3988
|
+
NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.</p>
|
|
3989
|
+
|
|
3990
|
+
|
|
3991
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-templates-v1.html>`_
|
|
3662
3992
|
|
|
3663
3993
|
:param name: The name of the template
|
|
3664
3994
|
:param aliases: Aliases for the index.
|
|
3665
|
-
:param cause:
|
|
3995
|
+
:param cause: User defined reason for creating/updating the index template
|
|
3666
3996
|
:param create: If true, this request cannot replace or update existing index
|
|
3667
3997
|
templates.
|
|
3668
3998
|
:param index_patterns: Array of wildcard expressions used to match the names
|
|
@@ -3737,29 +4067,30 @@ class IndicesClient(NamespacedClient):
|
|
|
3737
4067
|
pretty: t.Optional[bool] = None,
|
|
3738
4068
|
) -> ObjectApiResponse[t.Any]:
|
|
3739
4069
|
"""
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
4070
|
+
.. raw:: html
|
|
4071
|
+
|
|
4072
|
+
<p>Get index recovery information.
|
|
4073
|
+
Get information about ongoing and completed shard recoveries for one or more indices.
|
|
4074
|
+
For data streams, the API returns information for the stream's backing indices.</p>
|
|
4075
|
+
<p>All recoveries, whether ongoing or complete, are kept in the cluster state and may be reported on at any time.</p>
|
|
4076
|
+
<p>Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or creating a replica shard from a primary shard.
|
|
4077
|
+
When a shard recovery completes, the recovered shard is available for search and indexing.</p>
|
|
4078
|
+
<p>Recovery automatically occurs during the following processes:</p>
|
|
4079
|
+
<ul>
|
|
4080
|
+
<li>When creating an index for the first time.</li>
|
|
4081
|
+
<li>When a node rejoins the cluster and starts up any missing primary shard copies using the data that it holds in its data path.</li>
|
|
4082
|
+
<li>Creation of new replica shard copies from the primary.</li>
|
|
4083
|
+
<li>Relocation of a shard copy to a different node in the same cluster.</li>
|
|
4084
|
+
<li>A snapshot restore operation.</li>
|
|
4085
|
+
<li>A clone, shrink, or split operation.</li>
|
|
4086
|
+
</ul>
|
|
4087
|
+
<p>You can determine the cause of a shard recovery using the recovery or cat recovery APIs.</p>
|
|
4088
|
+
<p>The index recovery API reports information about completed recoveries only for shard copies that currently exist in the cluster.
|
|
4089
|
+
It only reports the last recovery for each shard copy and does not report historical information about earlier recoveries, nor does it report information about the recoveries of shard copies that no longer exist.
|
|
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>
|
|
4091
|
+
|
|
4092
|
+
|
|
4093
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-recovery.html>`_
|
|
3763
4094
|
|
|
3764
4095
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
3765
4096
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -3819,21 +4150,21 @@ class IndicesClient(NamespacedClient):
|
|
|
3819
4150
|
pretty: t.Optional[bool] = None,
|
|
3820
4151
|
) -> ObjectApiResponse[t.Any]:
|
|
3821
4152
|
"""
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4153
|
+
.. raw:: html
|
|
4154
|
+
|
|
4155
|
+
<p>Refresh an index.
|
|
4156
|
+
A refresh makes recent operations performed on one or more indices available for search.
|
|
4157
|
+
For data streams, the API runs the refresh operation on the stream’s backing indices.</p>
|
|
4158
|
+
<p>By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.
|
|
4159
|
+
You can change this default interval with the <code>index.refresh_interval</code> setting.</p>
|
|
4160
|
+
<p>Refresh requests are synchronous and do not return a response until the refresh operation completes.</p>
|
|
4161
|
+
<p>Refreshes are resource-intensive.
|
|
4162
|
+
To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.</p>
|
|
4163
|
+
<p>If your application workflow indexes documents and then runs a search to retrieve the indexed document, it's recommended to use the index API's <code>refresh=wait_for</code> query parameter option.
|
|
4164
|
+
This option ensures the indexing operation waits for a periodic refresh before running the search.</p>
|
|
4165
|
+
|
|
4166
|
+
|
|
4167
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-refresh.html>`_
|
|
3837
4168
|
|
|
3838
4169
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
3839
4170
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -3899,25 +4230,25 @@ class IndicesClient(NamespacedClient):
|
|
|
3899
4230
|
human: t.Optional[bool] = None,
|
|
3900
4231
|
ignore_unavailable: t.Optional[bool] = None,
|
|
3901
4232
|
pretty: t.Optional[bool] = None,
|
|
4233
|
+
resource: t.Optional[str] = None,
|
|
3902
4234
|
) -> ObjectApiResponse[t.Any]:
|
|
3903
4235
|
"""
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-reload-analyzers.html>`_
|
|
4236
|
+
.. raw:: html
|
|
4237
|
+
|
|
4238
|
+
<p>Reload search analyzers.
|
|
4239
|
+
Reload an index's search analyzers and their resources.
|
|
4240
|
+
For data streams, the API reloads search analyzers and resources for the stream's backing indices.</p>
|
|
4241
|
+
<p>IMPORTANT: After reloading the search analyzers you should clear the request cache to make sure it doesn't contain responses derived from the previous versions of the analyzer.</p>
|
|
4242
|
+
<p>You can use the reload search analyzers API to pick up changes to synonym files used in the <code>synonym_graph</code> or <code>synonym</code> token filter of a search analyzer.
|
|
4243
|
+
To be eligible, the token filter must have an <code>updateable</code> flag of <code>true</code> and only be used in search analyzers.</p>
|
|
4244
|
+
<p>NOTE: This API does not perform a reload for each shard of an index.
|
|
4245
|
+
Instead, it performs a reload for each node containing index shards.
|
|
4246
|
+
As a result, the total shard count returned by the API can differ from the number of index shards.
|
|
4247
|
+
Because reloading affects every node with an index shard, it is important to update the synonym file on every data node in the cluster--including nodes that don't contain a shard replica--before using this API.
|
|
4248
|
+
This ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future.</p>
|
|
4249
|
+
|
|
4250
|
+
|
|
4251
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-reload-analyzers.html>`_
|
|
3921
4252
|
|
|
3922
4253
|
:param index: A comma-separated list of index names to reload analyzers for
|
|
3923
4254
|
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
|
|
@@ -3927,6 +4258,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3927
4258
|
that are open, closed or both.
|
|
3928
4259
|
:param ignore_unavailable: Whether specified concrete indices should be ignored
|
|
3929
4260
|
when unavailable (missing or closed)
|
|
4261
|
+
:param resource: Changed resource to reload analyzers from if applicable
|
|
3930
4262
|
"""
|
|
3931
4263
|
if index in SKIP_IN_PATH:
|
|
3932
4264
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
@@ -3947,6 +4279,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3947
4279
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
3948
4280
|
if pretty is not None:
|
|
3949
4281
|
__query["pretty"] = pretty
|
|
4282
|
+
if resource is not None:
|
|
4283
|
+
__query["resource"] = resource
|
|
3950
4284
|
__headers = {"accept": "application/json"}
|
|
3951
4285
|
return await self.perform_request( # type: ignore[return-value]
|
|
3952
4286
|
"POST",
|
|
@@ -3961,7 +4295,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3961
4295
|
async def resolve_cluster(
|
|
3962
4296
|
self,
|
|
3963
4297
|
*,
|
|
3964
|
-
name: t.Union[str, t.Sequence[str]],
|
|
4298
|
+
name: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3965
4299
|
allow_no_indices: t.Optional[bool] = None,
|
|
3966
4300
|
error_trace: t.Optional[bool] = None,
|
|
3967
4301
|
expand_wildcards: t.Optional[
|
|
@@ -3977,64 +4311,95 @@ class IndicesClient(NamespacedClient):
|
|
|
3977
4311
|
ignore_throttled: t.Optional[bool] = None,
|
|
3978
4312
|
ignore_unavailable: t.Optional[bool] = None,
|
|
3979
4313
|
pretty: t.Optional[bool] = None,
|
|
4314
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3980
4315
|
) -> ObjectApiResponse[t.Any]:
|
|
3981
4316
|
"""
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4317
|
+
.. raw:: html
|
|
4318
|
+
|
|
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>
|
|
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>
|
|
4323
|
+
<p>You use the same index expression with this endpoint as you would for cross-cluster search.
|
|
4324
|
+
Index and cluster exclusions are also supported with this endpoint.</p>
|
|
4325
|
+
<p>For each cluster in the index expression, information is returned about:</p>
|
|
4326
|
+
<ul>
|
|
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>
|
|
4328
|
+
<li>Whether each remote cluster is configured with <code>skip_unavailable</code> as <code>true</code> or <code>false</code>.</li>
|
|
4329
|
+
<li>Whether there are any indices, aliases, or data streams on that cluster that match the index expression.</li>
|
|
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>
|
|
4331
|
+
<li>Cluster version information, including the Elasticsearch server version.</li>
|
|
4332
|
+
</ul>
|
|
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>.
|
|
4334
|
+
Each cluster returns information about whether it has any indices, aliases or data streams that match <code>my-index-*</code>.</p>
|
|
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>
|
|
4342
|
+
<p>You may want to exclude a cluster or index from a search when:</p>
|
|
4343
|
+
<ul>
|
|
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>
|
|
4345
|
+
<li>A cluster has no matching indices, aliases or data streams for the index expression (or your user does not have permissions to search them). For example, suppose your index expression is <code>logs*,remote1:logs*</code> and the remote1 cluster has no indices, aliases or data streams that match <code>logs*</code>. In that case, that cluster will return no results from that cluster if you include it in a cross-cluster search.</li>
|
|
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>
|
|
4347
|
+
<li>A remote cluster is an older version that does not support the feature you want to use in your search.</li>
|
|
4348
|
+
</ul>
|
|
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
|
|
4020
4366
|
:param allow_no_indices: If false, the request returns an error if any wildcard
|
|
4021
|
-
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.
|
|
4022
4368
|
This behavior applies even if the request targets other open indices. For
|
|
4023
|
-
example, a request targeting foo*,bar
|
|
4024
|
-
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.
|
|
4025
4374
|
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
4026
4375
|
request can target data streams, this argument determines whether wildcard
|
|
4027
4376
|
expressions match hidden data streams. Supports comma-separated values, such
|
|
4028
4377
|
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
|
|
4029
|
-
|
|
4030
|
-
|
|
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.
|
|
4031
4385
|
:param ignore_unavailable: If false, the request returns an error if it targets
|
|
4032
|
-
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).
|
|
4033
4395
|
"""
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
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"
|
|
4038
4403
|
__query: t.Dict[str, t.Any] = {}
|
|
4039
4404
|
if allow_no_indices is not None:
|
|
4040
4405
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -4052,6 +4417,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4052
4417
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
4053
4418
|
if pretty is not None:
|
|
4054
4419
|
__query["pretty"] = pretty
|
|
4420
|
+
if timeout is not None:
|
|
4421
|
+
__query["timeout"] = timeout
|
|
4055
4422
|
__headers = {"accept": "application/json"}
|
|
4056
4423
|
return await self.perform_request( # type: ignore[return-value]
|
|
4057
4424
|
"GET",
|
|
@@ -4083,10 +4450,14 @@ class IndicesClient(NamespacedClient):
|
|
|
4083
4450
|
pretty: t.Optional[bool] = None,
|
|
4084
4451
|
) -> ObjectApiResponse[t.Any]:
|
|
4085
4452
|
"""
|
|
4086
|
-
|
|
4087
|
-
|
|
4453
|
+
.. raw:: html
|
|
4454
|
+
|
|
4455
|
+
<p>Resolve indices.
|
|
4456
|
+
Resolve the names and/or index patterns for indices, aliases, and data streams.
|
|
4457
|
+
Multiple patterns and remote clusters are supported.</p>
|
|
4458
|
+
|
|
4088
4459
|
|
|
4089
|
-
`<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>`_
|
|
4090
4461
|
|
|
4091
4462
|
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
|
|
4092
4463
|
and data streams to resolve. Resources on remote clusters can be specified
|
|
@@ -4146,6 +4517,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4146
4517
|
error_trace: t.Optional[bool] = None,
|
|
4147
4518
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4148
4519
|
human: t.Optional[bool] = None,
|
|
4520
|
+
lazy: t.Optional[bool] = None,
|
|
4149
4521
|
mappings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4150
4522
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4151
4523
|
pretty: t.Optional[bool] = None,
|
|
@@ -4157,35 +4529,37 @@ class IndicesClient(NamespacedClient):
|
|
|
4157
4529
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4158
4530
|
) -> ObjectApiResponse[t.Any]:
|
|
4159
4531
|
"""
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4532
|
+
.. raw:: html
|
|
4533
|
+
|
|
4534
|
+
<p>Roll over to a new index.
|
|
4535
|
+
TIP: It is recommended to use the index lifecycle rollover action to automate rollovers.</p>
|
|
4536
|
+
<p>The rollover API creates a new index for a data stream or index alias.
|
|
4537
|
+
The API behavior depends on the rollover target.</p>
|
|
4538
|
+
<p><strong>Roll over a data stream</strong></p>
|
|
4539
|
+
<p>If you roll over a data stream, the API creates a new write index for the stream.
|
|
4540
|
+
The stream's previous write index becomes a regular backing index.
|
|
4541
|
+
A rollover also increments the data stream's generation.</p>
|
|
4542
|
+
<p><strong>Roll over an index alias with a write index</strong></p>
|
|
4543
|
+
<p>TIP: Prior to Elasticsearch 7.9, you'd typically use an index alias with a write index to manage time series data.
|
|
4544
|
+
Data streams replace this functionality, require less maintenance, and automatically integrate with data tiers.</p>
|
|
4545
|
+
<p>If an index alias points to multiple indices, one of the indices must be a write index.
|
|
4546
|
+
The rollover API creates a new write index for the alias with <code>is_write_index</code> set to <code>true</code>.
|
|
4547
|
+
The API also <code>sets is_write_index</code> to <code>false</code> for the previous write index.</p>
|
|
4548
|
+
<p><strong>Roll over an index alias with one index</strong></p>
|
|
4549
|
+
<p>If you roll over an index alias that points to only one index, the API creates a new index for the alias and removes the original index from the alias.</p>
|
|
4550
|
+
<p>NOTE: A rollover creates a new index and is subject to the <code>wait_for_active_shards</code> setting.</p>
|
|
4551
|
+
<p><strong>Increment index names for an alias</strong></p>
|
|
4552
|
+
<p>When you roll over an index alias, you can specify a name for the new index.
|
|
4553
|
+
If you don't specify a name and the current index ends with <code>-</code> and a number, such as <code>my-index-000001</code> or <code>my-index-3</code>, the new index name increments that number.
|
|
4554
|
+
For example, if you roll over an alias with a current index of <code>my-index-000001</code>, the rollover creates a new index named <code>my-index-000002</code>.
|
|
4555
|
+
This number is always six characters and zero-padded, regardless of the previous index's name.</p>
|
|
4556
|
+
<p>If you use an index alias for time series data, you can use date math in the index name to track the rollover date.
|
|
4557
|
+
For example, you can create an alias that points to an index named <code><my-index-{now/d}-000001></code>.
|
|
4558
|
+
If you create the index on May 6, 2099, the index's name is <code>my-index-2099.05.06-000001</code>.
|
|
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>
|
|
4560
|
+
|
|
4561
|
+
|
|
4562
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-rollover-index.html>`_
|
|
4189
4563
|
|
|
4190
4564
|
:param alias: Name of the data stream or index alias to roll over.
|
|
4191
4565
|
:param new_index: Name of the index to create. Supports date math. Data streams
|
|
@@ -4200,6 +4574,9 @@ class IndicesClient(NamespacedClient):
|
|
|
4200
4574
|
conditions are satisfied.
|
|
4201
4575
|
:param dry_run: If `true`, checks whether the current index satisfies the specified
|
|
4202
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.
|
|
4203
4580
|
:param mappings: Mapping for fields in the index. If specified, this mapping
|
|
4204
4581
|
can include field names, field data types, and mapping paramaters.
|
|
4205
4582
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -4234,6 +4611,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4234
4611
|
__query["filter_path"] = filter_path
|
|
4235
4612
|
if human is not None:
|
|
4236
4613
|
__query["human"] = human
|
|
4614
|
+
if lazy is not None:
|
|
4615
|
+
__query["lazy"] = lazy
|
|
4237
4616
|
if master_timeout is not None:
|
|
4238
4617
|
__query["master_timeout"] = master_timeout
|
|
4239
4618
|
if pretty is not None:
|
|
@@ -4288,11 +4667,14 @@ class IndicesClient(NamespacedClient):
|
|
|
4288
4667
|
verbose: t.Optional[bool] = None,
|
|
4289
4668
|
) -> ObjectApiResponse[t.Any]:
|
|
4290
4669
|
"""
|
|
4291
|
-
|
|
4292
|
-
shards. For data streams, the API returns information about the stream's backing
|
|
4293
|
-
indices.
|
|
4670
|
+
.. raw:: html
|
|
4294
4671
|
|
|
4295
|
-
|
|
4672
|
+
<p>Get index segments.
|
|
4673
|
+
Get low-level information about the Lucene segments in index shards.
|
|
4674
|
+
For data streams, the API returns information about the stream's backing indices.</p>
|
|
4675
|
+
|
|
4676
|
+
|
|
4677
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-segments.html>`_
|
|
4296
4678
|
|
|
4297
4679
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
4298
4680
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -4369,16 +4751,22 @@ class IndicesClient(NamespacedClient):
|
|
|
4369
4751
|
] = None,
|
|
4370
4752
|
) -> ObjectApiResponse[t.Any]:
|
|
4371
4753
|
"""
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4754
|
+
.. raw:: html
|
|
4755
|
+
|
|
4756
|
+
<p>Get index shard stores.
|
|
4757
|
+
Get store information about replica shards in one or more indices.
|
|
4758
|
+
For data streams, the API retrieves store information for the stream's backing indices.</p>
|
|
4759
|
+
<p>The index shard stores API returns the following information:</p>
|
|
4760
|
+
<ul>
|
|
4761
|
+
<li>The node on which each replica shard exists.</li>
|
|
4762
|
+
<li>The allocation ID for each replica shard.</li>
|
|
4763
|
+
<li>A unique ID for each replica shard.</li>
|
|
4764
|
+
<li>Any errors encountered while opening the shard index or from an earlier failure.</li>
|
|
4765
|
+
</ul>
|
|
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>
|
|
4380
4767
|
|
|
4381
|
-
|
|
4768
|
+
|
|
4769
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-shards-stores.html>`_
|
|
4382
4770
|
|
|
4383
4771
|
:param index: List of data streams, indices, and aliases used to limit the request.
|
|
4384
4772
|
:param allow_no_indices: If false, the request returns an error if any wildcard
|
|
@@ -4447,41 +4835,40 @@ class IndicesClient(NamespacedClient):
|
|
|
4447
4835
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4448
4836
|
) -> ObjectApiResponse[t.Any]:
|
|
4449
4837
|
"""
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-shrink-index.html>`_
|
|
4838
|
+
.. raw:: html
|
|
4839
|
+
|
|
4840
|
+
<p>Shrink an index.
|
|
4841
|
+
Shrink an index into a new index with fewer primary shards.</p>
|
|
4842
|
+
<p>Before you can shrink an index:</p>
|
|
4843
|
+
<ul>
|
|
4844
|
+
<li>The index must be read-only.</li>
|
|
4845
|
+
<li>A copy of every shard in the index must reside on the same node.</li>
|
|
4846
|
+
<li>The index must have a green health status.</li>
|
|
4847
|
+
</ul>
|
|
4848
|
+
<p>To make shard allocation easier, we recommend you also remove the index's replica shards.
|
|
4849
|
+
You can later re-add replica shards as part of the shrink operation.</p>
|
|
4850
|
+
<p>The requested number of primary shards in the target index must be a factor of the number of shards in the source index.
|
|
4851
|
+
For example an index with 8 primary shards can be shrunk into 4, 2 or 1 primary shards or an index with 15 primary shards can be shrunk into 5, 3 or 1.
|
|
4852
|
+
If the number of shards in the index is a prime number it can only be shrunk into a single primary shard
|
|
4853
|
+
Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node.</p>
|
|
4854
|
+
<p>The current write index on a data stream cannot be shrunk. In order to shrink the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be shrunk.</p>
|
|
4855
|
+
<p>A shrink operation:</p>
|
|
4856
|
+
<ul>
|
|
4857
|
+
<li>Creates a new target index with the same definition as the source index, but with a smaller number of primary shards.</li>
|
|
4858
|
+
<li>Hard-links segments from the source index into the target index. If the file system does not support hard-linking, then all segments are copied into the new index, which is a much more time consuming process. Also if using multiple data paths, shards on different data paths require a full copy of segment files if they are not on the same disk since hardlinks do not work across disks.</li>
|
|
4859
|
+
<li>Recovers the target index as though it were a closed index which had just been re-opened. Recovers shards to the <code>.routing.allocation.initial_recovery._id</code> index setting.</li>
|
|
4860
|
+
</ul>
|
|
4861
|
+
<p>IMPORTANT: Indices can only be shrunk if they satisfy the following requirements:</p>
|
|
4862
|
+
<ul>
|
|
4863
|
+
<li>The target index must not exist.</li>
|
|
4864
|
+
<li>The source index must have more primary shards than the target index.</li>
|
|
4865
|
+
<li>The number of primary shards in the target index must be a factor of the number of primary shards in the source index. The source index must have more primary shards than the target index.</li>
|
|
4866
|
+
<li>The index must not contain more than 2,147,483,519 documents in total across all shards that will be shrunk into a single shard on the target index as this is the maximum number of docs that can fit into a single shard.</li>
|
|
4867
|
+
<li>The node handling the shrink process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
|
|
4868
|
+
</ul>
|
|
4869
|
+
|
|
4870
|
+
|
|
4871
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-shrink-index.html>`_
|
|
4485
4872
|
|
|
4486
4873
|
:param index: Name of the source index to shrink.
|
|
4487
4874
|
:param target: Name of the target index to create.
|
|
@@ -4546,6 +4933,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4546
4933
|
self,
|
|
4547
4934
|
*,
|
|
4548
4935
|
name: str,
|
|
4936
|
+
cause: t.Optional[str] = None,
|
|
4937
|
+
create: t.Optional[bool] = None,
|
|
4549
4938
|
error_trace: t.Optional[bool] = None,
|
|
4550
4939
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4551
4940
|
human: t.Optional[bool] = None,
|
|
@@ -4554,12 +4943,19 @@ class IndicesClient(NamespacedClient):
|
|
|
4554
4943
|
pretty: t.Optional[bool] = None,
|
|
4555
4944
|
) -> ObjectApiResponse[t.Any]:
|
|
4556
4945
|
"""
|
|
4557
|
-
|
|
4558
|
-
|
|
4946
|
+
.. raw:: html
|
|
4947
|
+
|
|
4948
|
+
<p>Simulate an index.
|
|
4949
|
+
Get the index configuration that would be applied to the specified index from an existing index template.</p>
|
|
4950
|
+
|
|
4559
4951
|
|
|
4560
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4952
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-simulate-index.html>`_
|
|
4561
4953
|
|
|
4562
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
|
|
4563
4959
|
:param include_defaults: If true, returns all relevant default configurations
|
|
4564
4960
|
for the index template.
|
|
4565
4961
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -4571,6 +4967,10 @@ class IndicesClient(NamespacedClient):
|
|
|
4571
4967
|
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
4572
4968
|
__path = f'/_index_template/_simulate_index/{__path_parts["name"]}'
|
|
4573
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
|
|
4574
4974
|
if error_trace is not None:
|
|
4575
4975
|
__query["error_trace"] = error_trace
|
|
4576
4976
|
if filter_path is not None:
|
|
@@ -4613,6 +5013,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4613
5013
|
*,
|
|
4614
5014
|
name: t.Optional[str] = None,
|
|
4615
5015
|
allow_auto_create: t.Optional[bool] = None,
|
|
5016
|
+
cause: t.Optional[str] = None,
|
|
4616
5017
|
composed_of: t.Optional[t.Sequence[str]] = None,
|
|
4617
5018
|
create: t.Optional[bool] = None,
|
|
4618
5019
|
data_stream: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -4632,10 +5033,13 @@ class IndicesClient(NamespacedClient):
|
|
|
4632
5033
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4633
5034
|
) -> ObjectApiResponse[t.Any]:
|
|
4634
5035
|
"""
|
|
4635
|
-
|
|
4636
|
-
|
|
5036
|
+
.. raw:: html
|
|
5037
|
+
|
|
5038
|
+
<p>Simulate an index template.
|
|
5039
|
+
Get the index configuration that would be applied by a particular index template.</p>
|
|
5040
|
+
|
|
4637
5041
|
|
|
4638
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5042
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-simulate-template.html>`_
|
|
4639
5043
|
|
|
4640
5044
|
:param name: Name of the index template to simulate. To test a template configuration
|
|
4641
5045
|
before you add it to the cluster, omit this parameter and specify the template
|
|
@@ -4646,6 +5050,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4646
5050
|
via `actions.auto_create_index`. If set to `false`, then indices or data
|
|
4647
5051
|
streams matching the template must always be explicitly created, and may
|
|
4648
5052
|
never be automatically created.
|
|
5053
|
+
:param cause: User defined reason for dry-run creating the new template for simulation
|
|
5054
|
+
purposes
|
|
4649
5055
|
:param composed_of: An ordered list of component template names. Component templates
|
|
4650
5056
|
are merged in the order specified, meaning that the last component template
|
|
4651
5057
|
specified has the highest precedence.
|
|
@@ -4690,6 +5096,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4690
5096
|
__path = "/_index_template/_simulate"
|
|
4691
5097
|
__query: t.Dict[str, t.Any] = {}
|
|
4692
5098
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
5099
|
+
if cause is not None:
|
|
5100
|
+
__query["cause"] = cause
|
|
4693
5101
|
if create is not None:
|
|
4694
5102
|
__query["create"] = create
|
|
4695
5103
|
if error_trace is not None:
|
|
@@ -4764,33 +5172,46 @@ class IndicesClient(NamespacedClient):
|
|
|
4764
5172
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4765
5173
|
) -> ObjectApiResponse[t.Any]:
|
|
4766
5174
|
"""
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
5175
|
+
.. raw:: html
|
|
5176
|
+
|
|
5177
|
+
<p>Split an index.
|
|
5178
|
+
Split an index into a new index with more primary shards.</p>
|
|
5179
|
+
<ul>
|
|
5180
|
+
<li>
|
|
5181
|
+
<p>Before you can split an index:</p>
|
|
5182
|
+
</li>
|
|
5183
|
+
<li>
|
|
5184
|
+
<p>The index must be read-only.</p>
|
|
5185
|
+
</li>
|
|
5186
|
+
<li>
|
|
5187
|
+
<p>The cluster health status must be green.</p>
|
|
5188
|
+
</li>
|
|
5189
|
+
</ul>
|
|
5190
|
+
<p>You can do make an index read-only with the following request using the add index block API:</p>
|
|
5191
|
+
<pre><code>PUT /my_source_index/_block/write
|
|
5192
|
+
</code></pre>
|
|
5193
|
+
<p>The current write index on a data stream cannot be split.
|
|
5194
|
+
In order to split the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be split.</p>
|
|
5195
|
+
<p>The number of times the index can be split (and the number of shards that each original shard can be split into) is determined by the <code>index.number_of_routing_shards</code> setting.
|
|
5196
|
+
The number of routing shards specifies the hashing space that is used internally to distribute documents across shards with consistent hashing.
|
|
5197
|
+
For instance, a 5 shard index with <code>number_of_routing_shards</code> set to 30 (5 x 2 x 3) could be split by a factor of 2 or 3.</p>
|
|
5198
|
+
<p>A split operation:</p>
|
|
5199
|
+
<ul>
|
|
5200
|
+
<li>Creates a new target index with the same definition as the source index, but with a larger number of primary shards.</li>
|
|
5201
|
+
<li>Hard-links segments from the source index into the target index. If the file system doesn't support hard-linking, all segments are copied into the new index, which is a much more time consuming process.</li>
|
|
5202
|
+
<li>Hashes all documents again, after low level files are created, to delete documents that belong to a different shard.</li>
|
|
5203
|
+
<li>Recovers the target index as though it were a closed index which had just been re-opened.</li>
|
|
5204
|
+
</ul>
|
|
5205
|
+
<p>IMPORTANT: Indices can only be split if they satisfy the following requirements:</p>
|
|
5206
|
+
<ul>
|
|
5207
|
+
<li>The target index must not exist.</li>
|
|
5208
|
+
<li>The source index must have fewer primary shards than the target index.</li>
|
|
5209
|
+
<li>The number of primary shards in the target index must be a multiple of the number of primary shards in the source index.</li>
|
|
5210
|
+
<li>The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
|
|
5211
|
+
</ul>
|
|
5212
|
+
|
|
5213
|
+
|
|
5214
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-split-index.html>`_
|
|
4794
5215
|
|
|
4795
5216
|
:param index: Name of the source index to split.
|
|
4796
5217
|
:param target: Name of the target index to create.
|
|
@@ -4880,16 +5301,19 @@ class IndicesClient(NamespacedClient):
|
|
|
4880
5301
|
pretty: t.Optional[bool] = None,
|
|
4881
5302
|
) -> ObjectApiResponse[t.Any]:
|
|
4882
5303
|
"""
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
5304
|
+
.. raw:: html
|
|
5305
|
+
|
|
5306
|
+
<p>Get index statistics.
|
|
5307
|
+
For data streams, the API retrieves statistics for the stream's backing indices.</p>
|
|
5308
|
+
<p>By default, the returned statistics are index-level with <code>primaries</code> and <code>total</code> aggregations.
|
|
5309
|
+
<code>primaries</code> are the values for only the primary shards.
|
|
5310
|
+
<code>total</code> are the accumulated values for both primary and replica shards.</p>
|
|
5311
|
+
<p>To get shard-level statistics, set the <code>level</code> parameter to <code>shards</code>.</p>
|
|
5312
|
+
<p>NOTE: When moving to another node, the shard-level statistics for a shard are cleared.
|
|
5313
|
+
Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed.</p>
|
|
4891
5314
|
|
|
4892
|
-
|
|
5315
|
+
|
|
5316
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-stats.html>`_
|
|
4893
5317
|
|
|
4894
5318
|
:param index: A comma-separated list of index names; use `_all` or empty string
|
|
4895
5319
|
to perform the operation on all indices
|
|
@@ -4990,10 +5414,13 @@ class IndicesClient(NamespacedClient):
|
|
|
4990
5414
|
wait_for_active_shards: t.Optional[str] = None,
|
|
4991
5415
|
) -> ObjectApiResponse[t.Any]:
|
|
4992
5416
|
"""
|
|
4993
|
-
|
|
4994
|
-
|
|
5417
|
+
.. raw:: html
|
|
5418
|
+
|
|
5419
|
+
<p>Unfreeze an index.
|
|
5420
|
+
When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.</p>
|
|
4995
5421
|
|
|
4996
|
-
|
|
5422
|
+
|
|
5423
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/unfreeze-index-api.html>`_
|
|
4997
5424
|
|
|
4998
5425
|
:param index: Identifier for the index.
|
|
4999
5426
|
:param allow_no_indices: If `false`, the request returns an error if any wildcard
|
|
@@ -5065,9 +5492,13 @@ class IndicesClient(NamespacedClient):
|
|
|
5065
5492
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5066
5493
|
) -> ObjectApiResponse[t.Any]:
|
|
5067
5494
|
"""
|
|
5068
|
-
|
|
5495
|
+
.. raw:: html
|
|
5496
|
+
|
|
5497
|
+
<p>Create or update an alias.
|
|
5498
|
+
Adds a data stream or index to an alias.</p>
|
|
5499
|
+
|
|
5069
5500
|
|
|
5070
|
-
`<https://www.elastic.co/
|
|
5501
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-update-aliases>`_
|
|
5071
5502
|
|
|
5072
5503
|
:param actions: Actions to perform.
|
|
5073
5504
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -5140,9 +5571,13 @@ class IndicesClient(NamespacedClient):
|
|
|
5140
5571
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5141
5572
|
) -> ObjectApiResponse[t.Any]:
|
|
5142
5573
|
"""
|
|
5143
|
-
|
|
5574
|
+
.. raw:: html
|
|
5575
|
+
|
|
5576
|
+
<p>Validate a query.
|
|
5577
|
+
Validates a query without running it.</p>
|
|
5578
|
+
|
|
5144
5579
|
|
|
5145
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5580
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/search-validate.html>`_
|
|
5146
5581
|
|
|
5147
5582
|
:param index: Comma-separated list of data streams, indices, and aliases to search.
|
|
5148
5583
|
Supports wildcards (`*`). To search all data streams or indices, omit this
|