elasticsearch 8.17.1__py3-none-any.whl → 9.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. elasticsearch/__init__.py +2 -2
  2. elasticsearch/_async/client/__init__.py +2125 -1053
  3. elasticsearch/_async/client/_base.py +1 -2
  4. elasticsearch/_async/client/async_search.py +46 -35
  5. elasticsearch/_async/client/autoscaling.py +32 -26
  6. elasticsearch/_async/client/cat.py +244 -176
  7. elasticsearch/_async/client/ccr.py +268 -128
  8. elasticsearch/_async/client/cluster.py +191 -164
  9. elasticsearch/_async/client/connector.py +226 -116
  10. elasticsearch/_async/client/dangling_indices.py +22 -16
  11. elasticsearch/_async/client/enrich.py +51 -11
  12. elasticsearch/_async/client/eql.py +54 -13
  13. elasticsearch/_async/client/esql.py +351 -7
  14. elasticsearch/_async/client/features.py +37 -27
  15. elasticsearch/_async/client/fleet.py +32 -22
  16. elasticsearch/_async/client/graph.py +10 -9
  17. elasticsearch/_async/client/ilm.py +115 -77
  18. elasticsearch/_async/client/indices.py +1119 -772
  19. elasticsearch/_async/client/inference.py +1933 -84
  20. elasticsearch/_async/client/ingest.py +83 -50
  21. elasticsearch/_async/client/license.py +90 -38
  22. elasticsearch/_async/client/logstash.py +20 -9
  23. elasticsearch/_async/client/migration.py +26 -17
  24. elasticsearch/_async/client/ml.py +646 -374
  25. elasticsearch/_async/client/monitoring.py +6 -3
  26. elasticsearch/_async/client/nodes.py +52 -54
  27. elasticsearch/_async/client/query_rules.py +59 -33
  28. elasticsearch/_async/client/rollup.py +124 -86
  29. elasticsearch/_async/client/search_application.py +60 -32
  30. elasticsearch/_async/client/searchable_snapshots.py +25 -12
  31. elasticsearch/_async/client/security.py +903 -562
  32. elasticsearch/_async/client/shutdown.py +34 -36
  33. elasticsearch/_async/client/simulate.py +22 -28
  34. elasticsearch/_async/client/slm.py +65 -40
  35. elasticsearch/_async/client/snapshot.py +454 -327
  36. elasticsearch/_async/client/sql.py +43 -22
  37. elasticsearch/_async/client/ssl.py +17 -18
  38. elasticsearch/_async/client/synonyms.py +58 -37
  39. elasticsearch/_async/client/tasks.py +77 -48
  40. elasticsearch/_async/client/text_structure.py +65 -56
  41. elasticsearch/_async/client/transform.py +124 -93
  42. elasticsearch/_async/client/watcher.py +117 -73
  43. elasticsearch/_async/client/xpack.py +18 -9
  44. elasticsearch/_async/helpers.py +1 -2
  45. elasticsearch/_sync/client/__init__.py +2125 -1053
  46. elasticsearch/_sync/client/_base.py +1 -2
  47. elasticsearch/_sync/client/async_search.py +46 -35
  48. elasticsearch/_sync/client/autoscaling.py +32 -26
  49. elasticsearch/_sync/client/cat.py +244 -176
  50. elasticsearch/_sync/client/ccr.py +268 -128
  51. elasticsearch/_sync/client/cluster.py +191 -164
  52. elasticsearch/_sync/client/connector.py +226 -116
  53. elasticsearch/_sync/client/dangling_indices.py +22 -16
  54. elasticsearch/_sync/client/enrich.py +51 -11
  55. elasticsearch/_sync/client/eql.py +54 -13
  56. elasticsearch/_sync/client/esql.py +351 -7
  57. elasticsearch/_sync/client/features.py +37 -27
  58. elasticsearch/_sync/client/fleet.py +32 -22
  59. elasticsearch/_sync/client/graph.py +10 -9
  60. elasticsearch/_sync/client/ilm.py +115 -77
  61. elasticsearch/_sync/client/indices.py +1119 -772
  62. elasticsearch/_sync/client/inference.py +1933 -84
  63. elasticsearch/_sync/client/ingest.py +83 -50
  64. elasticsearch/_sync/client/license.py +90 -38
  65. elasticsearch/_sync/client/logstash.py +20 -9
  66. elasticsearch/_sync/client/migration.py +26 -17
  67. elasticsearch/_sync/client/ml.py +646 -374
  68. elasticsearch/_sync/client/monitoring.py +6 -3
  69. elasticsearch/_sync/client/nodes.py +52 -54
  70. elasticsearch/_sync/client/query_rules.py +59 -33
  71. elasticsearch/_sync/client/rollup.py +124 -86
  72. elasticsearch/_sync/client/search_application.py +60 -32
  73. elasticsearch/_sync/client/searchable_snapshots.py +25 -12
  74. elasticsearch/_sync/client/security.py +903 -562
  75. elasticsearch/_sync/client/shutdown.py +34 -36
  76. elasticsearch/_sync/client/simulate.py +22 -28
  77. elasticsearch/_sync/client/slm.py +65 -40
  78. elasticsearch/_sync/client/snapshot.py +454 -327
  79. elasticsearch/_sync/client/sql.py +43 -22
  80. elasticsearch/_sync/client/ssl.py +17 -18
  81. elasticsearch/_sync/client/synonyms.py +58 -37
  82. elasticsearch/_sync/client/tasks.py +77 -48
  83. elasticsearch/_sync/client/text_structure.py +65 -56
  84. elasticsearch/_sync/client/transform.py +124 -93
  85. elasticsearch/_sync/client/utils.py +1 -41
  86. elasticsearch/_sync/client/watcher.py +117 -73
  87. elasticsearch/_sync/client/xpack.py +18 -9
  88. elasticsearch/_version.py +1 -1
  89. elasticsearch/client.py +2 -0
  90. elasticsearch/dsl/__init__.py +203 -0
  91. elasticsearch/dsl/_async/__init__.py +16 -0
  92. elasticsearch/dsl/_async/document.py +522 -0
  93. elasticsearch/dsl/_async/faceted_search.py +50 -0
  94. elasticsearch/dsl/_async/index.py +639 -0
  95. elasticsearch/dsl/_async/mapping.py +49 -0
  96. elasticsearch/dsl/_async/search.py +237 -0
  97. elasticsearch/dsl/_async/update_by_query.py +47 -0
  98. elasticsearch/dsl/_sync/__init__.py +16 -0
  99. elasticsearch/dsl/_sync/document.py +514 -0
  100. elasticsearch/dsl/_sync/faceted_search.py +50 -0
  101. elasticsearch/dsl/_sync/index.py +597 -0
  102. elasticsearch/dsl/_sync/mapping.py +49 -0
  103. elasticsearch/dsl/_sync/search.py +230 -0
  104. elasticsearch/dsl/_sync/update_by_query.py +45 -0
  105. elasticsearch/dsl/aggs.py +3734 -0
  106. elasticsearch/dsl/analysis.py +341 -0
  107. elasticsearch/dsl/async_connections.py +37 -0
  108. elasticsearch/dsl/connections.py +142 -0
  109. elasticsearch/dsl/document.py +20 -0
  110. elasticsearch/dsl/document_base.py +444 -0
  111. elasticsearch/dsl/exceptions.py +32 -0
  112. elasticsearch/dsl/faceted_search.py +28 -0
  113. elasticsearch/dsl/faceted_search_base.py +489 -0
  114. elasticsearch/dsl/field.py +4392 -0
  115. elasticsearch/dsl/function.py +180 -0
  116. elasticsearch/dsl/index.py +23 -0
  117. elasticsearch/dsl/index_base.py +178 -0
  118. elasticsearch/dsl/mapping.py +19 -0
  119. elasticsearch/dsl/mapping_base.py +219 -0
  120. elasticsearch/dsl/query.py +2822 -0
  121. elasticsearch/dsl/response/__init__.py +388 -0
  122. elasticsearch/dsl/response/aggs.py +100 -0
  123. elasticsearch/dsl/response/hit.py +53 -0
  124. elasticsearch/dsl/search.py +20 -0
  125. elasticsearch/dsl/search_base.py +1053 -0
  126. elasticsearch/dsl/serializer.py +34 -0
  127. elasticsearch/dsl/types.py +6453 -0
  128. elasticsearch/dsl/update_by_query.py +19 -0
  129. elasticsearch/dsl/update_by_query_base.py +149 -0
  130. elasticsearch/dsl/utils.py +687 -0
  131. elasticsearch/dsl/wrappers.py +144 -0
  132. elasticsearch/helpers/actions.py +1 -1
  133. elasticsearch/helpers/vectorstore/_async/strategies.py +12 -12
  134. elasticsearch/helpers/vectorstore/_sync/strategies.py +12 -12
  135. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
  136. {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/METADATA +12 -15
  137. elasticsearch-9.0.0.dist-info/RECORD +160 -0
  138. elasticsearch/transport.py +0 -57
  139. elasticsearch-8.17.1.dist-info/RECORD +0 -119
  140. {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/WHEEL +0 -0
  141. {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/licenses/LICENSE +0 -0
  142. {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.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
- Add an index block. Limits the operations allowed on an index by blocking specific
59
- operation types.
58
+ .. raw:: html
60
59
 
61
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index-modules-blocks.html>`_
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
- :param index: A comma separated list of indices to add a block to
64
- :param block: The block to add (one of read, write, read_only or metadata)
65
- :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
66
- into no concrete indices. (This includes `_all` string or when no indices
67
- have been specified)
68
- :param expand_wildcards: Whether to expand wildcard expression to concrete indices
69
- that are open, closed or both.
70
- :param ignore_unavailable: Whether specified concrete indices should be ignored
71
- when unavailable (missing or closed)
72
- :param master_timeout: Specify timeout for connection to master
73
- :param timeout: Explicit operation timeout
64
+
65
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-add-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
- Get tokens from text analysis. The analyze API performs analysis on a text string
147
- and returns the resulting tokens. Generating excessive amount of tokens may cause
148
- a node to run out of memory. The `index.analyze.max_token_count` setting enables
149
- you to limit the number of tokens that can be produced. If more than this limit
150
- of tokens gets generated, an error occurs. The `_analyze` endpoint without a
151
- specified index will always use `10000` as its limit.
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.17/indices-analyze.html>`_
176
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-analyze>`_
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/docs/api/doc/elasticsearch/v9/group/endpoint-migration>`_
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
- Clear the cache. Clear the cache of one or more indices. For data streams, the
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
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clearcache.html>`_
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/docs/api/doc/elasticsearch/v9/operation/operation-indices-clear-cache>`_
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
- Clone an index. Clone an existing index into a new index. Each original primary
342
- shard is cloned into a new primary shard in the new index. IMPORTANT: Elasticsearch
343
- does not apply index templates to the resulting index. The API also does not
344
- copy index metadata from the original index. Index metadata includes aliases,
345
- index lifecycle management phase definitions, and cross-cluster replication (CCR)
346
- follower information. For example, if you clone a CCR follower index, the resulting
347
- clone will not be a follower index. The clone API copies most index settings
348
- from the source index to the resulting index, with the exception of `index.number_of_replicas`
349
- and `index.auto_expand_replicas`. To set the number of replicas in the resulting
350
- index, configure these settings in the clone request. Cloning works as follows:
351
- * First, it creates a new target index with the same definition as the source
352
- index. * Then it hard-links segments from the source index into the target index.
353
- If the file system does not support hard-linking, all segments are copied into
354
- the new index, which is a much more time consuming process. * Finally, it recovers
355
- the target index as though it were a closed index which had just been re-opened.
356
- IMPORTANT: Indices can only be cloned if they meet the following requirements:
357
- * The index must be marked as read-only and have a cluster health status of green.
358
- * The target index must not exist. * The source index must have the same number
359
- of primary shards as the target index. * The node handling the clone process
360
- must have sufficient free disk space to accommodate a second copy of the existing
361
- index. The current write index on a data stream cannot be cloned. In order to
362
- clone the current write index, the data stream must first be rolled over so that
363
- a new write index is created and then the previous write index can be cloned.
364
- NOTE: Mappings cannot be specified in the `_clone` request. The mappings of the
365
- source index will be used for the target index. **Monitor the cloning process**
366
- The cloning process can be monitored with the cat recovery API or the cluster
367
- health API can be used to wait until all primary shards have been allocated by
368
- setting the `wait_for_status` parameter to `yellow`. The `_clone` API returns
369
- as soon as the target index has been added to the cluster state, before any shards
370
- have been allocated. At this point, all shards are in the state unassigned. If,
371
- for any reason, the target index can't be allocated, its primary shard will remain
372
- unassigned until it can be allocated on that node. Once the primary shard is
373
- allocated, it moves to state initializing, and the clone process begins. When
374
- the clone operation completes, the shard will become active. At that point, Elasticsearch
375
- will try to allocate any replicas and may decide to relocate the primary shard
376
- to another node. **Wait for active shards** Because the clone operation creates
377
- a new index to clone the shards to, the wait for active shards setting on index
378
- creation applies to the clone index action as well.
379
-
380
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clone-index.html>`_
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/docs/api/doc/elasticsearch/v9/operation/operation-indices-clone>`_
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
- Close an index. A closed index is blocked for read or write operations and does
467
- not allow all operations that opened indices allow. It is not possible to index
468
- documents or to search for documents in a closed index. Closed indices do not
469
- have to maintain internal data structures for indexing or searching documents,
470
- which results in a smaller overhead on the cluster. When opening or closing an
471
- index, the master node is responsible for restarting the index shards to reflect
472
- the new state of the index. The shards will then go through the normal recovery
473
- process. The data of opened and closed indices is automatically replicated by
474
- the cluster to ensure that enough shard copies are safely kept around at all
475
- times. You can open and close multiple indices. An error is thrown if the request
476
- explicitly refers to a missing index. This behaviour can be turned off using
477
- the `ignore_unavailable=true` parameter. By default, you must explicitly name
478
- the indices you are opening or closing. To open or close indices with `_all`,
479
- `*`, or other wildcard expressions, change the` action.destructive_requires_name`
480
- setting to `false`. This setting can also be changed with the cluster update
481
- settings API. Closed indices consume a significant amount of disk-space which
482
- can cause problems in managed environments. Closing indices can be turned off
483
- with the cluster settings API by setting `cluster.indices.close.enable` to `false`.
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/docs/api/doc/elasticsearch/v9/operation/operation-indices-close>`_
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
- Create an index. You can use the create index API to add a new index to an Elasticsearch
565
- cluster. When creating an index, you can specify the following: * Settings for
566
- the index. * Mappings for fields in the index. * Index aliases **Wait for active
567
- shards** By default, index creation will only return a response to the client
568
- when the primary copies of each shard have been started, or the request times
569
- out. The index creation response will indicate what happened. For example, `acknowledged`
570
- indicates whether the index was successfully created in the cluster, `while shards_acknowledged`
571
- indicates whether the requisite number of shard copies were started for each
572
- shard in the index before timing out. Note that it is still possible for either
573
- `acknowledged` or `shards_acknowledged` to be `false`, but for the index creation
574
- to be successful. These values simply indicate whether the operation completed
575
- before the timeout. If `acknowledged` is false, the request timed out before
576
- the cluster state was updated with the newly created index, but it probably will
577
- be created sometime soon. If `shards_acknowledged` is false, then the request
578
- timed out before the requisite number of shards were started (by default just
579
- the primaries), even if the cluster state was successfully updated to reflect
580
- the newly created index (that is to say, `acknowledged` is `true`). You can change
581
- the default of only waiting for the primary shards to start through the index
582
- setting `index.write.wait_for_active_shards`. Note that changing this setting
583
- will also affect the `wait_for_active_shards` value on all subsequent write operations.
584
-
585
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-create-index.html>`_
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/docs/api/doc/elasticsearch/v9/operation/operation-indices-create>`_
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
- Create a data stream. Creates a data stream. You must have a matching index template
657
- with data stream enabled.
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
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
733
+
734
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-create-data-stream>`_
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/docs/api/doc/elasticsearch/v9/group/endpoint-migration>`_
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
- Get data stream stats. Retrieves statistics for one or more data streams.
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.17/data-streams.html>`_
864
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-data-streams-stats-1>`_
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
- Delete indices. Deleting an index deletes its documents, shards, and metadata.
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
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-index.html>`_
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/docs/api/doc/elasticsearch/v9/operation/operation-indices-delete>`_
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
- Delete an alias. Removes a data stream or index from an alias.
1001
+ .. raw:: html
1002
+
1003
+ <p>Delete an alias.
1004
+ Removes a data stream or index from an alias.</p>
854
1005
 
855
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-alias.html>`_
1006
+
1007
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-delete-alias>`_
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
- Delete data stream lifecycles. Removes the data stream lifecycle from a data
918
- stream, rendering it not managed by the data stream lifecycle.
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
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-delete-lifecycle.html>`_
1074
+
1075
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-delete-data-lifecycle>`_
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
- Delete data streams. Deletes one or more data streams and their backing indices.
1133
+ .. raw:: html
1134
+
1135
+ <p>Delete data streams.
1136
+ Deletes one or more data streams and their backing indices.</p>
979
1137
 
980
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
1138
+
1139
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-delete-data-stream>`_
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
- Delete an index template. The provided <index-template> may contain multiple
1031
- template names separated by a comma. If multiple template names are specified
1032
- then there is no wildcard support and the provided names should match completely
1033
- with existing templates.
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.17/indices-delete-template.html>`_
1197
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-delete-index-template>`_
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
- Delete a legacy index template.
1247
+ .. raw:: html
1086
1248
 
1087
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-template-v1.html>`_
1249
+ <p>Delete a legacy index template.</p>
1250
+
1251
+
1252
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-delete-template>`_
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
- Analyze the index disk usage. Analyze the disk usage of each field of an index
1149
- or data stream. This API might not support indices created in previous Elasticsearch
1150
- versions. The result of a small index can be inaccurate as some parts of an index
1151
- might not be analyzed by the API. NOTE: The total size of fields of the analyzed
1152
- shards of the index in the response is usually smaller than the index `store_size`
1153
- value because some small metadata files are ignored and some parts of data files
1154
- might not be scanned by the API. Since stored fields are stored together in a
1155
- compressed format, the sizes of stored fields are also estimates and can be inaccurate.
1156
- The stored size of the `_id` field is likely underestimated while the `_source`
1157
- field is overestimated.
1158
-
1159
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-disk-usage.html>`_
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>
1322
+
1323
+
1324
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-disk-usage>`_
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
- Downsample an index. Aggregate a time series (TSDS) index and store pre-computed
1232
- statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each
1233
- metric field grouped by a configured time interval. For example, a TSDS index
1234
- that contains metrics sampled every 10 seconds can be downsampled to an hourly
1235
- index. All documents within an hour interval are summarized and stored as a single
1236
- document in the downsample index. NOTE: Only indices in a time series data stream
1237
- are supported. Neither field nor document level security can be defined on the
1238
- source index. The source index must be read only (`index.blocks.write: true`).
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>
1405
+
1239
1406
 
1240
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-downsample-data-stream.html>`_
1407
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-downsample>`_
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
- Check indices. Check if one or more indices, index aliases, or data streams exist.
1473
+ .. raw:: html
1307
1474
 
1308
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-exists.html>`_
1475
+ <p>Check indices.
1476
+ Check if one or more indices, index aliases, or data streams exist.</p>
1477
+
1478
+
1479
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-exists>`_
1309
1480
 
1310
1481
  :param index: Comma-separated list of data streams, indices, and aliases. Supports
1311
1482
  wildcards (`*`).
@@ -1377,13 +1548,17 @@ class IndicesClient(NamespacedClient):
1377
1548
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1378
1549
  human: t.Optional[bool] = None,
1379
1550
  ignore_unavailable: t.Optional[bool] = None,
1380
- local: t.Optional[bool] = None,
1551
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1381
1552
  pretty: t.Optional[bool] = None,
1382
1553
  ) -> HeadApiResponse:
1383
1554
  """
1384
- Check aliases. Checks if one or more data stream or index aliases exist.
1555
+ .. raw:: html
1385
1556
 
1386
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
1557
+ <p>Check aliases.</p>
1558
+ <p>Check if one or more data stream or index aliases exist.</p>
1559
+
1560
+
1561
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/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
@@ -1398,8 +1573,9 @@ class IndicesClient(NamespacedClient):
1398
1573
  as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
1399
1574
  :param ignore_unavailable: If `false`, requests that include a missing data stream
1400
1575
  or index in the target indices or data streams return an error.
1401
- :param local: If `true`, the request retrieves information from the local node
1402
- only.
1576
+ :param master_timeout: Period to wait for a connection to the master node. If
1577
+ no response is received before the timeout expires, the request fails and
1578
+ returns an error.
1403
1579
  """
1404
1580
  if name in SKIP_IN_PATH:
1405
1581
  raise ValueError("Empty value passed for parameter 'name'")
@@ -1425,8 +1601,8 @@ class IndicesClient(NamespacedClient):
1425
1601
  __query["human"] = human
1426
1602
  if ignore_unavailable is not None:
1427
1603
  __query["ignore_unavailable"] = ignore_unavailable
1428
- if local is not None:
1429
- __query["local"] = local
1604
+ if master_timeout is not None:
1605
+ __query["master_timeout"] = master_timeout
1430
1606
  if pretty is not None:
1431
1607
  __query["pretty"] = pretty
1432
1608
  __headers = {"accept": "application/json"}
@@ -1446,17 +1622,27 @@ class IndicesClient(NamespacedClient):
1446
1622
  name: str,
1447
1623
  error_trace: t.Optional[bool] = None,
1448
1624
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1625
+ flat_settings: t.Optional[bool] = None,
1449
1626
  human: t.Optional[bool] = None,
1627
+ local: t.Optional[bool] = None,
1450
1628
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1451
1629
  pretty: t.Optional[bool] = None,
1452
1630
  ) -> HeadApiResponse:
1453
1631
  """
1454
- Check index templates. Check whether index templates exist.
1632
+ .. raw:: html
1455
1633
 
1456
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index-templates.html>`_
1634
+ <p>Check index templates.</p>
1635
+ <p>Check whether index templates exist.</p>
1636
+
1637
+
1638
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-exists-index-template>`_
1457
1639
 
1458
1640
  :param name: Comma-separated list of index template names used to limit the request.
1459
1641
  Wildcard (*) expressions are supported.
1642
+ :param flat_settings: If true, returns settings in flat format.
1643
+ :param local: If true, the request retrieves information from the local node
1644
+ only. Defaults to false, which means information is retrieved from the master
1645
+ node.
1460
1646
  :param master_timeout: Period to wait for a connection to the master node. If
1461
1647
  no response is received before the timeout expires, the request fails and
1462
1648
  returns an error.
@@ -1470,8 +1656,12 @@ class IndicesClient(NamespacedClient):
1470
1656
  __query["error_trace"] = error_trace
1471
1657
  if filter_path is not None:
1472
1658
  __query["filter_path"] = filter_path
1659
+ if flat_settings is not None:
1660
+ __query["flat_settings"] = flat_settings
1473
1661
  if human is not None:
1474
1662
  __query["human"] = human
1663
+ if local is not None:
1664
+ __query["local"] = local
1475
1665
  if master_timeout is not None:
1476
1666
  __query["master_timeout"] = master_timeout
1477
1667
  if pretty is not None:
@@ -1500,13 +1690,15 @@ class IndicesClient(NamespacedClient):
1500
1690
  pretty: t.Optional[bool] = None,
1501
1691
  ) -> HeadApiResponse:
1502
1692
  """
1503
- Check existence of index templates. Get information about whether index templates
1504
- exist. Index templates define settings, mappings, and aliases that can be applied
1505
- automatically to new indices. IMPORTANT: This documentation is about legacy index
1506
- templates, which are deprecated and will be replaced by the composable templates
1507
- introduced in Elasticsearch 7.8.
1693
+ .. raw:: html
1508
1694
 
1509
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-template-exists-v1.html>`_
1695
+ <p>Check existence of index templates.
1696
+ Get information about whether index templates exist.
1697
+ Index templates define settings, mappings, and aliases that can be applied automatically to new indices.</p>
1698
+ <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>
1699
+
1700
+
1701
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-exists-template>`_
1510
1702
 
1511
1703
  :param name: A comma-separated list of index template names used to limit the
1512
1704
  request. Wildcard (`*`) expressions are supported.
@@ -1558,12 +1750,13 @@ class IndicesClient(NamespacedClient):
1558
1750
  pretty: t.Optional[bool] = None,
1559
1751
  ) -> ObjectApiResponse[t.Any]:
1560
1752
  """
1561
- Get the status for a data stream lifecycle. Get information about an index or
1562
- data stream's current data stream lifecycle status, such as time since index
1563
- creation, time since rollover, the lifecycle configuration managing the index,
1564
- or any errors encountered during lifecycle execution.
1753
+ .. raw:: html
1754
+
1755
+ <p>Get the status for a data stream lifecycle.
1756
+ 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>
1757
+
1565
1758
 
1566
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-explain-lifecycle.html>`_
1759
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-explain-data-lifecycle>`_
1567
1760
 
1568
1761
  :param index: The name of the index to explain
1569
1762
  :param include_defaults: indicates if the API should return the default values
@@ -1617,23 +1810,20 @@ class IndicesClient(NamespacedClient):
1617
1810
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1618
1811
  human: t.Optional[bool] = None,
1619
1812
  ignore_unavailable: t.Optional[bool] = None,
1620
- master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1621
1813
  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
1814
  ) -> ObjectApiResponse[t.Any]:
1627
1815
  """
1628
- Get field usage stats. Get field usage information for each shard and field of
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.
1816
+ .. raw:: html
1817
+
1818
+ <p>Get field usage stats.
1819
+ Get field usage information for each shard and field of an index.
1820
+ Field usage statistics are automatically captured when queries are running on a cluster.
1821
+ A shard-level search request that accesses a given field, even if multiple times during that request, is counted as a single use.</p>
1822
+ <p>The response body reports the per-shard usage count of the data structures that back the fields in the index.
1823
+ A given request will increment each count by a maximum value of 1, even if the request accesses the same field multiple times.</p>
1635
1824
 
1636
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/field-usage-stats.html>`_
1825
+
1826
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-field-usage-stats>`_
1637
1827
 
1638
1828
  :param index: Comma-separated list or wildcard expression of index names used
1639
1829
  to limit the request.
@@ -1650,14 +1840,6 @@ class IndicesClient(NamespacedClient):
1650
1840
  in the statistics.
1651
1841
  :param ignore_unavailable: If `true`, missing or closed indices are not included
1652
1842
  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
1843
  """
1662
1844
  if index in SKIP_IN_PATH:
1663
1845
  raise ValueError("Empty value passed for parameter 'index'")
@@ -1678,14 +1860,8 @@ class IndicesClient(NamespacedClient):
1678
1860
  __query["human"] = human
1679
1861
  if ignore_unavailable is not None:
1680
1862
  __query["ignore_unavailable"] = ignore_unavailable
1681
- if master_timeout is not None:
1682
- __query["master_timeout"] = master_timeout
1683
1863
  if pretty is not None:
1684
1864
  __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
1865
  __headers = {"accept": "application/json"}
1690
1866
  return await self.perform_request( # type: ignore[return-value]
1691
1867
  "GET",
@@ -1719,24 +1895,20 @@ class IndicesClient(NamespacedClient):
1719
1895
  wait_if_ongoing: t.Optional[bool] = None,
1720
1896
  ) -> ObjectApiResponse[t.Any]:
1721
1897
  """
1722
- Flush data streams or indices. Flushing a data stream or index is the process
1723
- of making sure that any data that is currently only stored in the transaction
1724
- log is also permanently stored in the Lucene index. When restarting, Elasticsearch
1725
- replays any unflushed operations from the transaction log into the Lucene index
1726
- to bring it back into the state that it was in before the restart. Elasticsearch
1727
- automatically triggers flushes as needed, using heuristics that trade off the
1728
- size of the unflushed transaction log against the cost of performing each flush.
1729
- After each operation has been flushed it is permanently stored in the Lucene
1730
- index. This may mean that there is no need to maintain an additional copy of
1731
- it in the transaction log. The transaction log is made up of multiple files,
1732
- called generations, and Elasticsearch will delete any generation files when they
1733
- are no longer needed, freeing up disk space. It is also possible to trigger a
1734
- flush on one or more indices using the flush API, although it is rare for users
1735
- to need to call this API directly. If you call the flush API after indexing some
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>`_
1898
+ .. raw:: html
1899
+
1900
+ <p>Flush data streams or indices.
1901
+ 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.
1902
+ 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.
1903
+ 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>
1904
+ <p>After each operation has been flushed it is permanently stored in the Lucene index.
1905
+ This may mean that there is no need to maintain an additional copy of it in the transaction log.
1906
+ 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>
1907
+ <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.
1908
+ 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>
1909
+
1910
+
1911
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-flush>`_
1740
1912
 
1741
1913
  :param index: Comma-separated list of data streams, indices, and aliases to flush.
1742
1914
  Supports wildcards (`*`). To flush all data streams and indices, omit this
@@ -1817,51 +1989,51 @@ class IndicesClient(NamespacedClient):
1817
1989
  wait_for_completion: t.Optional[bool] = None,
1818
1990
  ) -> ObjectApiResponse[t.Any]:
1819
1991
  """
1820
- Force a merge. Perform the force merge operation on the shards of one or more
1821
- indices. For data streams, the API forces a merge on the shards of the stream's
1822
- backing indices. Merging reduces the number of segments in each shard by merging
1823
- some of them together and also frees up the space used by deleted documents.
1824
- Merging normally happens automatically, but sometimes it is useful to trigger
1825
- a merge manually. WARNING: We recommend force merging only a read-only index
1826
- (meaning the index is no longer receiving writes). When documents are updated
1827
- or deleted, the old version is not immediately removed but instead soft-deleted
1828
- and marked with a "tombstone". These soft-deleted documents are automatically
1829
- cleaned up during regular segment merges. But force merge can cause very large
1830
- (greater than 5 GB) segments to be produced, which are not eligible for regular
1831
- merges. So the number of soft-deleted documents can then grow rapidly, resulting
1832
- in higher disk usage and worse search performance. If you regularly force merge
1833
- an index receiving writes, this can also make snapshots more expensive, since
1834
- the new documents can't be backed up incrementally. **Blocks during a force merge**
1835
- Calls to this API block until the merge is complete (unless request contains
1836
- `wait_for_completion=false`). If the client connection is lost before completion
1837
- then the force merge process will continue in the background. Any new requests
1838
- to force merge the same indices will also block until the ongoing force merge
1839
- is complete. **Running force merge asynchronously** If the request contains `wait_for_completion=false`,
1840
- Elasticsearch performs some preflight checks, launches the request, and returns
1841
- a task you can use to get the status of the task. However, you can not cancel
1842
- this task as the force merge task is not cancelable. Elasticsearch creates a
1843
- record of this task as a document at `_tasks/<task_id>`. When you are done with
1844
- a task, you should delete the task document so Elasticsearch can reclaim the
1845
- space. **Force merging multiple indices** You can force merge multiple indices
1846
- with a single request by targeting: * One or more data streams that contain multiple
1847
- backing indices * Multiple indices * One or more aliases * All data streams and
1848
- indices in a cluster Each targeted shard is force-merged separately using the
1849
- force_merge threadpool. By default each node only has a single `force_merge`
1850
- thread which means that the shards on that node are force-merged one at a time.
1851
- If you expand the `force_merge` threadpool on a node then it will force merge
1852
- its shards in parallel Force merge makes the storage for the shard being merged
1853
- temporarily increase, as it may require free space up to triple its size in case
1854
- `max_num_segments parameter` is set to `1`, to rewrite all segments into a new
1855
- one. **Data streams and time-based indices** Force-merging is useful for managing
1856
- a data stream's older backing indices and other time-based indices, particularly
1857
- after a rollover. In these cases, each index only receives indexing traffic for
1858
- a certain period of time. Once an index receive no more writes, its shards can
1859
- be force-merged to a single segment. This can be a good idea because single-segment
1860
- shards can sometimes use simpler and more efficient data structures to perform
1861
- searches. For example: ``` POST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1
1862
- ```
1863
-
1864
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-forcemerge.html>`_
1992
+ .. raw:: html
1993
+
1994
+ <p>Force a merge.
1995
+ Perform the force merge operation on the shards of one or more indices.
1996
+ For data streams, the API forces a merge on the shards of the stream's backing indices.</p>
1997
+ <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.
1998
+ Merging normally happens automatically, but sometimes it is useful to trigger a merge manually.</p>
1999
+ <p>WARNING: We recommend force merging only a read-only index (meaning the index is no longer receiving writes).
2000
+ When documents are updated or deleted, the old version is not immediately removed but instead soft-deleted and marked with a &quot;tombstone&quot;.
2001
+ These soft-deleted documents are automatically cleaned up during regular segment merges.
2002
+ But force merge can cause very large (greater than 5 GB) segments to be produced, which are not eligible for regular merges.
2003
+ So the number of soft-deleted documents can then grow rapidly, resulting in higher disk usage and worse search performance.
2004
+ 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>
2005
+ <p><strong>Blocks during a force merge</strong></p>
2006
+ <p>Calls to this API block until the merge is complete (unless request contains <code>wait_for_completion=false</code>).
2007
+ If the client connection is lost before completion then the force merge process will continue in the background.
2008
+ Any new requests to force merge the same indices will also block until the ongoing force merge is complete.</p>
2009
+ <p><strong>Running force merge asynchronously</strong></p>
2010
+ <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.
2011
+ However, you can not cancel this task as the force merge task is not cancelable.
2012
+ Elasticsearch creates a record of this task as a document at <code>_tasks/&lt;task_id&gt;</code>.
2013
+ When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space.</p>
2014
+ <p><strong>Force merging multiple indices</strong></p>
2015
+ <p>You can force merge multiple indices with a single request by targeting:</p>
2016
+ <ul>
2017
+ <li>One or more data streams that contain multiple backing indices</li>
2018
+ <li>Multiple indices</li>
2019
+ <li>One or more aliases</li>
2020
+ <li>All data streams and indices in a cluster</li>
2021
+ </ul>
2022
+ <p>Each targeted shard is force-merged separately using the force_merge threadpool.
2023
+ 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.
2024
+ If you expand the <code>force_merge</code> threadpool on a node then it will force merge its shards in parallel</p>
2025
+ <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>
2026
+ <p><strong>Data streams and time-based indices</strong></p>
2027
+ <p>Force-merging is useful for managing a data stream's older backing indices and other time-based indices, particularly after a rollover.
2028
+ In these cases, each index only receives indexing traffic for a certain period of time.
2029
+ Once an index receive no more writes, its shards can be force-merged to a single segment.
2030
+ This can be a good idea because single-segment shards can sometimes use simpler and more efficient data structures to perform searches.
2031
+ For example:</p>
2032
+ <pre><code>POST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1
2033
+ </code></pre>
2034
+
2035
+
2036
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-forcemerge>`_
1865
2037
 
1866
2038
  :param index: A comma-separated list of index names; use `_all` or empty string
1867
2039
  to perform the operation on all indices
@@ -1952,10 +2124,14 @@ class IndicesClient(NamespacedClient):
1952
2124
  pretty: t.Optional[bool] = None,
1953
2125
  ) -> ObjectApiResponse[t.Any]:
1954
2126
  """
1955
- Get index information. Get information about one or more indices. For data streams,
1956
- the API returns information about the stream’s backing indices.
2127
+ .. raw:: html
2128
+
2129
+ <p>Get index information.
2130
+ Get information about one or more indices. For data streams, the API returns information about the
2131
+ stream’s backing indices.</p>
1957
2132
 
1958
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-index.html>`_
2133
+
2134
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get>`_
1959
2135
 
1960
2136
  :param index: Comma-separated list of data streams, indices, and index aliases
1961
2137
  used to limit the request. Wildcard expressions (*) are supported.
@@ -2038,13 +2214,17 @@ class IndicesClient(NamespacedClient):
2038
2214
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2039
2215
  human: t.Optional[bool] = None,
2040
2216
  ignore_unavailable: t.Optional[bool] = None,
2041
- local: t.Optional[bool] = None,
2217
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2042
2218
  pretty: t.Optional[bool] = None,
2043
2219
  ) -> ObjectApiResponse[t.Any]:
2044
2220
  """
2045
- Get aliases. Retrieves information for one or more data stream or index aliases.
2221
+ .. raw:: html
2222
+
2223
+ <p>Get aliases.
2224
+ Retrieves information for one or more data stream or index aliases.</p>
2225
+
2046
2226
 
2047
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-alias.html>`_
2227
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-alias>`_
2048
2228
 
2049
2229
  :param index: Comma-separated list of data streams or indices used to limit the
2050
2230
  request. Supports wildcards (`*`). To target all data streams and indices,
@@ -2060,8 +2240,9 @@ class IndicesClient(NamespacedClient):
2060
2240
  as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
2061
2241
  :param ignore_unavailable: If `false`, the request returns an error if it targets
2062
2242
  a missing or closed index.
2063
- :param local: If `true`, the request retrieves information from the local node
2064
- only.
2243
+ :param master_timeout: Period to wait for a connection to the master node. If
2244
+ no response is received before the timeout expires, the request fails and
2245
+ returns an error.
2065
2246
  """
2066
2247
  __path_parts: t.Dict[str, str]
2067
2248
  if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH:
@@ -2089,8 +2270,8 @@ class IndicesClient(NamespacedClient):
2089
2270
  __query["human"] = human
2090
2271
  if ignore_unavailable is not None:
2091
2272
  __query["ignore_unavailable"] = ignore_unavailable
2092
- if local is not None:
2093
- __query["local"] = local
2273
+ if master_timeout is not None:
2274
+ __query["master_timeout"] = master_timeout
2094
2275
  if pretty is not None:
2095
2276
  __query["pretty"] = pretty
2096
2277
  __headers = {"accept": "application/json"}
@@ -2124,10 +2305,13 @@ class IndicesClient(NamespacedClient):
2124
2305
  pretty: t.Optional[bool] = None,
2125
2306
  ) -> ObjectApiResponse[t.Any]:
2126
2307
  """
2127
- Get data stream lifecycles. Retrieves the data stream lifecycle configuration
2128
- of one or more data streams.
2308
+ .. raw:: html
2309
+
2310
+ <p>Get data stream lifecycles.</p>
2311
+ <p>Get the data stream lifecycle configuration of one or more data streams.</p>
2129
2312
 
2130
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-get-lifecycle.html>`_
2313
+
2314
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-data-lifecycle>`_
2131
2315
 
2132
2316
  :param name: Comma-separated list of data streams to limit the request. Supports
2133
2317
  wildcards (`*`). To target all data streams, omit this parameter or use `*`
@@ -2179,10 +2363,13 @@ class IndicesClient(NamespacedClient):
2179
2363
  pretty: t.Optional[bool] = None,
2180
2364
  ) -> ObjectApiResponse[t.Any]:
2181
2365
  """
2182
- Get data stream lifecycle stats. Get statistics about the data streams that are
2183
- managed by a data stream lifecycle.
2366
+ .. raw:: html
2367
+
2368
+ <p>Get data stream lifecycle stats.
2369
+ Get statistics about the data streams that are managed by a data stream lifecycle.</p>
2370
+
2184
2371
 
2185
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-get-lifecycle-stats.html>`_
2372
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-data-lifecycle-stats>`_
2186
2373
  """
2187
2374
  __path_parts: t.Dict[str, str] = {}
2188
2375
  __path = "/_lifecycle/stats"
@@ -2227,9 +2414,13 @@ class IndicesClient(NamespacedClient):
2227
2414
  verbose: t.Optional[bool] = None,
2228
2415
  ) -> ObjectApiResponse[t.Any]:
2229
2416
  """
2230
- Get data streams. Retrieves information about one or more data streams.
2417
+ .. raw:: html
2231
2418
 
2232
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
2419
+ <p>Get data streams.</p>
2420
+ <p>Get information about one or more data streams.</p>
2421
+
2422
+
2423
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-data-stream>`_
2233
2424
 
2234
2425
  :param name: Comma-separated list of data stream names used to limit the request.
2235
2426
  Wildcard (`*`) expressions are supported. If omitted, all data streams are
@@ -2302,12 +2493,15 @@ class IndicesClient(NamespacedClient):
2302
2493
  pretty: t.Optional[bool] = None,
2303
2494
  ) -> ObjectApiResponse[t.Any]:
2304
2495
  """
2305
- Get mapping definitions. Retrieves mapping definitions for one or more fields.
2306
- For data streams, the API retrieves field mappings for the stream’s backing indices.
2307
- This API is useful if you don't need a complete mapping or if an index mapping
2308
- contains a large number of fields.
2496
+ .. raw:: html
2497
+
2498
+ <p>Get mapping definitions.
2499
+ Retrieves mapping definitions for one or more fields.
2500
+ For data streams, the API retrieves field mappings for the stream’s backing indices.</p>
2501
+ <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>
2309
2502
 
2310
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-field-mapping.html>`_
2503
+
2504
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-mapping>`_
2311
2505
 
2312
2506
  :param fields: Comma-separated list or wildcard expression of fields used to
2313
2507
  limit returned information. Supports wildcards (`*`).
@@ -2382,9 +2576,13 @@ class IndicesClient(NamespacedClient):
2382
2576
  pretty: t.Optional[bool] = None,
2383
2577
  ) -> ObjectApiResponse[t.Any]:
2384
2578
  """
2385
- Get index templates. Get information about one or more index templates.
2579
+ .. raw:: html
2580
+
2581
+ <p>Get index templates.
2582
+ Get information about one or more index templates.</p>
2583
+
2386
2584
 
2387
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template.html>`_
2585
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-index-template>`_
2388
2586
 
2389
2587
  :param name: Comma-separated list of index template names used to limit the request.
2390
2588
  Wildcard (*) expressions are supported.
@@ -2455,10 +2653,13 @@ class IndicesClient(NamespacedClient):
2455
2653
  pretty: t.Optional[bool] = None,
2456
2654
  ) -> ObjectApiResponse[t.Any]:
2457
2655
  """
2458
- Get mapping definitions. For data streams, the API retrieves mappings for the
2459
- stream’s backing indices.
2656
+ .. raw:: html
2460
2657
 
2461
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-mapping.html>`_
2658
+ <p>Get mapping definitions.
2659
+ For data streams, the API retrieves mappings for the stream’s backing indices.</p>
2660
+
2661
+
2662
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-mapping>`_
2462
2663
 
2463
2664
  :param index: Comma-separated list of data streams, indices, and aliases used
2464
2665
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -2514,6 +2715,51 @@ class IndicesClient(NamespacedClient):
2514
2715
  path_parts=__path_parts,
2515
2716
  )
2516
2717
 
2718
+ @_rewrite_parameters()
2719
+ @_stability_warning(Stability.EXPERIMENTAL)
2720
+ async def get_migrate_reindex_status(
2721
+ self,
2722
+ *,
2723
+ index: t.Union[str, t.Sequence[str]],
2724
+ error_trace: t.Optional[bool] = None,
2725
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2726
+ human: t.Optional[bool] = None,
2727
+ pretty: t.Optional[bool] = None,
2728
+ ) -> ObjectApiResponse[t.Any]:
2729
+ """
2730
+ .. raw:: html
2731
+
2732
+ <p>Get the migration reindexing status.</p>
2733
+ <p>Get the status of a migration reindex attempt for a data stream or index.</p>
2734
+
2735
+
2736
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-migration>`_
2737
+
2738
+ :param index: The index or data stream name.
2739
+ """
2740
+ if index in SKIP_IN_PATH:
2741
+ raise ValueError("Empty value passed for parameter 'index'")
2742
+ __path_parts: t.Dict[str, str] = {"index": _quote(index)}
2743
+ __path = f'/_migration/reindex/{__path_parts["index"]}/_status'
2744
+ __query: t.Dict[str, t.Any] = {}
2745
+ if error_trace is not None:
2746
+ __query["error_trace"] = error_trace
2747
+ if filter_path is not None:
2748
+ __query["filter_path"] = filter_path
2749
+ if human is not None:
2750
+ __query["human"] = human
2751
+ if pretty is not None:
2752
+ __query["pretty"] = pretty
2753
+ __headers = {"accept": "application/json"}
2754
+ return await self.perform_request( # type: ignore[return-value]
2755
+ "GET",
2756
+ __path,
2757
+ params=__query,
2758
+ headers=__headers,
2759
+ endpoint_id="indices.get_migrate_reindex_status",
2760
+ path_parts=__path_parts,
2761
+ )
2762
+
2517
2763
  @_rewrite_parameters()
2518
2764
  async def get_settings(
2519
2765
  self,
@@ -2540,10 +2786,14 @@ class IndicesClient(NamespacedClient):
2540
2786
  pretty: t.Optional[bool] = None,
2541
2787
  ) -> ObjectApiResponse[t.Any]:
2542
2788
  """
2543
- Get index settings. Get setting information for one or more indices. For data
2544
- streams, it returns setting information for the stream's backing indices.
2789
+ .. raw:: html
2790
+
2791
+ <p>Get index settings.
2792
+ Get setting information for one or more indices.
2793
+ For data streams, it returns setting information for the stream's backing indices.</p>
2545
2794
 
2546
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-settings.html>`_
2795
+
2796
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-settings>`_
2547
2797
 
2548
2798
  :param index: Comma-separated list of data streams, indices, and aliases used
2549
2799
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -2628,11 +2878,14 @@ class IndicesClient(NamespacedClient):
2628
2878
  pretty: t.Optional[bool] = None,
2629
2879
  ) -> ObjectApiResponse[t.Any]:
2630
2880
  """
2631
- Get index templates. Get information about one or more index templates. IMPORTANT:
2632
- This documentation is about legacy index templates, which are deprecated and
2633
- will be replaced by the composable templates introduced in Elasticsearch 7.8.
2881
+ .. raw:: html
2882
+
2883
+ <p>Get index templates.
2884
+ Get information about one or more index templates.</p>
2885
+ <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
2886
 
2635
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template-v1.html>`_
2887
+
2888
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-get-template>`_
2636
2889
 
2637
2890
  :param name: Comma-separated list of index template names used to limit the request.
2638
2891
  Wildcard (`*`) expressions are supported. To return all index templates,
@@ -2676,6 +2929,62 @@ class IndicesClient(NamespacedClient):
2676
2929
  path_parts=__path_parts,
2677
2930
  )
2678
2931
 
2932
+ @_rewrite_parameters(
2933
+ body_name="reindex",
2934
+ )
2935
+ @_stability_warning(Stability.EXPERIMENTAL)
2936
+ async def migrate_reindex(
2937
+ self,
2938
+ *,
2939
+ reindex: t.Optional[t.Mapping[str, t.Any]] = None,
2940
+ body: t.Optional[t.Mapping[str, t.Any]] = None,
2941
+ error_trace: t.Optional[bool] = None,
2942
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2943
+ human: t.Optional[bool] = None,
2944
+ pretty: t.Optional[bool] = None,
2945
+ ) -> ObjectApiResponse[t.Any]:
2946
+ """
2947
+ .. raw:: html
2948
+
2949
+ <p>Reindex legacy backing indices.</p>
2950
+ <p>Reindex all legacy backing indices for a data stream.
2951
+ This operation occurs in a persistent task.
2952
+ The persistent task ID is returned immediately and the reindexing work is completed in that task.</p>
2953
+
2954
+
2955
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-migration>`_
2956
+
2957
+ :param reindex:
2958
+ """
2959
+ if reindex is None and body is None:
2960
+ raise ValueError(
2961
+ "Empty value passed for parameters 'reindex' and 'body', one of them should be set."
2962
+ )
2963
+ elif reindex is not None and body is not None:
2964
+ raise ValueError("Cannot set both 'reindex' and 'body'")
2965
+ __path_parts: t.Dict[str, str] = {}
2966
+ __path = "/_migration/reindex"
2967
+ __query: t.Dict[str, t.Any] = {}
2968
+ if error_trace is not None:
2969
+ __query["error_trace"] = error_trace
2970
+ if filter_path is not None:
2971
+ __query["filter_path"] = filter_path
2972
+ if human is not None:
2973
+ __query["human"] = human
2974
+ if pretty is not None:
2975
+ __query["pretty"] = pretty
2976
+ __body = reindex if reindex is not None else body
2977
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2978
+ return await self.perform_request( # type: ignore[return-value]
2979
+ "POST",
2980
+ __path,
2981
+ params=__query,
2982
+ headers=__headers,
2983
+ body=__body,
2984
+ endpoint_id="indices.migrate_reindex",
2985
+ path_parts=__path_parts,
2986
+ )
2987
+
2679
2988
  @_rewrite_parameters()
2680
2989
  async def migrate_to_data_stream(
2681
2990
  self,
@@ -2689,16 +2998,22 @@ class IndicesClient(NamespacedClient):
2689
2998
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2690
2999
  ) -> ObjectApiResponse[t.Any]:
2691
3000
  """
2692
- Convert an index alias to a data stream. Converts an index alias to a data stream.
2693
- You must have a matching index template that is data stream enabled. The alias
2694
- must meet the following criteria: The alias must have a write index; All indices
2695
- for the alias must have a `@timestamp` field mapping of a `date` or `date_nanos`
2696
- field type; The alias must not have any filters; The alias must not use custom
2697
- routing. If successful, the request removes the alias and creates a data stream
2698
- with the same name. The indices for the alias become hidden backing indices for
2699
- the stream. The write index for the alias becomes the write index for the stream.
3001
+ .. raw:: html
3002
+
3003
+ <p>Convert an index alias to a data stream.
3004
+ Converts an index alias to a data stream.
3005
+ You must have a matching index template that is data stream enabled.
3006
+ The alias must meet the following criteria:
3007
+ The alias must have a write index;
3008
+ 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;
3009
+ The alias must not have any filters;
3010
+ The alias must not use custom routing.
3011
+ If successful, the request removes the alias and creates a data stream with the same name.
3012
+ The indices for the alias become hidden backing indices for the stream.
3013
+ The write index for the alias becomes the write index for the stream.</p>
2700
3014
 
2701
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
3015
+
3016
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-migrate-to-data-stream>`_
2702
3017
 
2703
3018
  :param name: Name of the index alias to convert to a data stream.
2704
3019
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -2748,10 +3063,13 @@ class IndicesClient(NamespacedClient):
2748
3063
  body: t.Optional[t.Dict[str, t.Any]] = None,
2749
3064
  ) -> ObjectApiResponse[t.Any]:
2750
3065
  """
2751
- Update data streams. Performs one or more data stream modification actions in
2752
- a single atomic operation.
3066
+ .. raw:: html
3067
+
3068
+ <p>Update data streams.
3069
+ Performs one or more data stream modification actions in a single atomic operation.</p>
2753
3070
 
2754
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
3071
+
3072
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-modify-data-stream>`_
2755
3073
 
2756
3074
  :param actions: Actions to perform.
2757
3075
  """
@@ -2809,29 +3127,28 @@ class IndicesClient(NamespacedClient):
2809
3127
  ] = None,
2810
3128
  ) -> ObjectApiResponse[t.Any]:
2811
3129
  """
2812
- Open a closed index. For data streams, the API opens any closed backing indices.
2813
- A closed index is blocked for read/write operations and does not allow all operations
2814
- that opened indices allow. It is not possible to index documents or to search
2815
- for documents in a closed index. This allows closed indices to not have to maintain
2816
- internal data structures for indexing or searching documents, resulting in a
2817
- smaller overhead on the cluster. When opening or closing an index, the master
2818
- is responsible for restarting the index shards to reflect the new state of the
2819
- index. The shards will then go through the normal recovery process. The data
2820
- of opened or closed indices is automatically replicated by the cluster to ensure
2821
- that enough shard copies are safely kept around at all times. You can open and
2822
- close multiple indices. An error is thrown if the request explicitly refers to
2823
- a missing index. This behavior can be turned off by using the `ignore_unavailable=true`
2824
- parameter. By default, you must explicitly name the indices you are opening or
2825
- closing. To open or close indices with `_all`, `*`, or other wildcard expressions,
2826
- change the `action.destructive_requires_name` setting to `false`. This setting
2827
- can also be changed with the cluster update settings API. Closed indices consume
2828
- a significant amount of disk-space which can cause problems in managed environments.
2829
- Closing indices can be turned off with the cluster settings API by setting `cluster.indices.close.enable`
2830
- to `false`. Because opening or closing an index allocates its shards, the `wait_for_active_shards`
2831
- setting on index creation applies to the `_open` and `_close` index actions as
2832
- well.
2833
-
2834
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-open-close.html>`_
3130
+ .. raw:: html
3131
+
3132
+ <p>Open a closed index.
3133
+ For data streams, the API opens any closed backing indices.</p>
3134
+ <p>A closed index is blocked for read/write operations and does not allow all operations that opened indices allow.
3135
+ It is not possible to index documents or to search for documents in a closed index.
3136
+ 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>
3137
+ <p>When opening or closing an index, the master is responsible for restarting the index shards to reflect the new state of the index.
3138
+ The shards will then go through the normal recovery process.
3139
+ 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>
3140
+ <p>You can open and close multiple indices.
3141
+ An error is thrown if the request explicitly refers to a missing index.
3142
+ This behavior can be turned off by using the <code>ignore_unavailable=true</code> parameter.</p>
3143
+ <p>By default, you must explicitly name the indices you are opening or closing.
3144
+ 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>.
3145
+ This setting can also be changed with the cluster update settings API.</p>
3146
+ <p>Closed indices consume a significant amount of disk-space which can cause problems in managed environments.
3147
+ Closing indices can be turned off with the cluster settings API by setting <code>cluster.indices.close.enable</code> to <code>false</code>.</p>
3148
+ <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>
3149
+
3150
+
3151
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-open>`_
2835
3152
 
2836
3153
  :param index: Comma-separated list of data streams, indices, and aliases used
2837
3154
  to limit the request. Supports wildcards (`*`). By default, you must explicitly
@@ -2904,20 +3221,20 @@ class IndicesClient(NamespacedClient):
2904
3221
  pretty: t.Optional[bool] = None,
2905
3222
  ) -> ObjectApiResponse[t.Any]:
2906
3223
  """
2907
- Promote a data stream. Promote a data stream from a replicated data stream managed
2908
- by cross-cluster replication (CCR) to a regular data stream. With CCR auto following,
2909
- a data stream from a remote cluster can be replicated to the local cluster. These
2910
- data streams can't be rolled over in the local cluster. These replicated data
2911
- streams roll over only if the upstream data stream rolls over. In the event that
2912
- the remote cluster is no longer available, the data stream in the local cluster
2913
- can be promoted to a regular data stream, which allows these data streams to
2914
- be rolled over in the local cluster. NOTE: When promoting a data stream, ensure
2915
- the local cluster has a data stream enabled index template that matches the data
2916
- stream. If this is missing, the data stream will not be able to roll over until
2917
- a matching index template is created. This will affect the lifecycle management
2918
- of the data stream and interfere with the data stream size and retention.
2919
-
2920
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html>`_
3224
+ .. raw:: html
3225
+
3226
+ <p>Promote a data stream.
3227
+ Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream.</p>
3228
+ <p>With CCR auto following, a data stream from a remote cluster can be replicated to the local cluster.
3229
+ These data streams can't be rolled over in the local cluster.
3230
+ These replicated data streams roll over only if the upstream data stream rolls over.
3231
+ 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>
3232
+ <p>NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream.
3233
+ If this is missing, the data stream will not be able to roll over until a matching index template is created.
3234
+ This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.</p>
3235
+
3236
+
3237
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-promote-data-stream>`_
2921
3238
 
2922
3239
  :param name: The name of the data stream
2923
3240
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -2977,9 +3294,13 @@ class IndicesClient(NamespacedClient):
2977
3294
  body: t.Optional[t.Dict[str, t.Any]] = None,
2978
3295
  ) -> ObjectApiResponse[t.Any]:
2979
3296
  """
2980
- Create or update an alias. Adds a data stream or index to an alias.
3297
+ .. raw:: html
3298
+
3299
+ <p>Create or update an alias.
3300
+ Adds a data stream or index to an alias.</p>
3301
+
2981
3302
 
2982
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
3303
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-alias>`_
2983
3304
 
2984
3305
  :param index: Comma-separated list of data streams or indices to add. Supports
2985
3306
  wildcards (`*`). Wildcard patterns that match both data streams and indices
@@ -3054,7 +3375,7 @@ class IndicesClient(NamespacedClient):
3054
3375
  )
3055
3376
 
3056
3377
  @_rewrite_parameters(
3057
- body_fields=("data_retention", "downsampling"),
3378
+ body_fields=("data_retention", "downsampling", "enabled"),
3058
3379
  )
3059
3380
  async def put_data_lifecycle(
3060
3381
  self,
@@ -3062,6 +3383,7 @@ class IndicesClient(NamespacedClient):
3062
3383
  name: t.Union[str, t.Sequence[str]],
3063
3384
  data_retention: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3064
3385
  downsampling: t.Optional[t.Mapping[str, t.Any]] = None,
3386
+ enabled: t.Optional[bool] = None,
3065
3387
  error_trace: t.Optional[bool] = None,
3066
3388
  expand_wildcards: t.Optional[
3067
3389
  t.Union[
@@ -3079,10 +3401,13 @@ class IndicesClient(NamespacedClient):
3079
3401
  body: t.Optional[t.Dict[str, t.Any]] = None,
3080
3402
  ) -> ObjectApiResponse[t.Any]:
3081
3403
  """
3082
- Update data stream lifecycles. Update the data stream lifecycle of the specified
3083
- data streams.
3404
+ .. raw:: html
3084
3405
 
3085
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-put-lifecycle.html>`_
3406
+ <p>Update data stream lifecycles.
3407
+ Update the data stream lifecycle of the specified data streams.</p>
3408
+
3409
+
3410
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-data-lifecycle>`_
3086
3411
 
3087
3412
  :param name: Comma-separated list of data streams used to limit the request.
3088
3413
  Supports wildcards (`*`). To target all data streams use `*` or `_all`.
@@ -3090,9 +3415,11 @@ class IndicesClient(NamespacedClient):
3090
3415
  be stored at least for this time frame. Any time after this duration the
3091
3416
  document could be deleted. When empty, every document in this data stream
3092
3417
  will be stored indefinitely.
3093
- :param downsampling: If defined, every backing index will execute the configured
3094
- downsampling configuration after the backing index is not the data stream
3095
- write index anymore.
3418
+ :param downsampling: The downsampling configuration to execute for the managed
3419
+ backing index after rollover.
3420
+ :param enabled: If defined, it turns data stream lifecycle on/off (`true`/`false`)
3421
+ for this data stream. A data stream lifecycle that's disabled (enabled: `false`)
3422
+ will have no effect on the data stream.
3096
3423
  :param expand_wildcards: Type of data stream that wildcard patterns can match.
3097
3424
  Supports comma-separated values, such as `open,hidden`. Valid values are:
3098
3425
  `all`, `hidden`, `open`, `closed`, `none`.
@@ -3127,6 +3454,8 @@ class IndicesClient(NamespacedClient):
3127
3454
  __body["data_retention"] = data_retention
3128
3455
  if downsampling is not None:
3129
3456
  __body["downsampling"] = downsampling
3457
+ if enabled is not None:
3458
+ __body["enabled"] = enabled
3130
3459
  if not __body:
3131
3460
  __body = None # type: ignore[assignment]
3132
3461
  __headers = {"accept": "application/json"}
@@ -3181,36 +3510,32 @@ class IndicesClient(NamespacedClient):
3181
3510
  body: t.Optional[t.Dict[str, t.Any]] = None,
3182
3511
  ) -> ObjectApiResponse[t.Any]:
3183
3512
  """
3184
- Create or update an index template. Index templates define settings, mappings,
3185
- and aliases that can be applied automatically to new indices. Elasticsearch applies
3186
- templates to new indices based on an wildcard pattern that matches the index
3187
- name. Index templates are applied during data stream or index creation. For data
3188
- streams, these settings and mappings are applied when the stream's backing indices
3189
- are created. Settings and mappings specified in a create index API request override
3190
- any settings or mappings specified in an index template. Changes to index templates
3191
- do not affect existing indices, including the existing backing indices of a data
3192
- stream. You can use C-style `/* *\\/` block comments in index templates. You
3193
- can include comments anywhere in the request body, except before the opening
3194
- curly bracket. **Multiple matching templates** If multiple index templates match
3195
- the name of a new index or data stream, the template with the highest priority
3196
- is used. Multiple templates with overlapping index patterns at the same priority
3197
- are not allowed and an error will be thrown when attempting to create a template
3198
- matching an existing index template at identical priorities. **Composing aliases,
3199
- mappings, and settings** When multiple component templates are specified in the
3200
- `composed_of` field for an index template, they are merged in the order specified,
3201
- meaning that later component templates override earlier component templates.
3202
- Any mappings, settings, or aliases from the parent index template are merged
3203
- in next. Finally, any configuration on the index request itself is merged. Mapping
3204
- definitions are merged recursively, which means that later mapping components
3205
- can introduce new field mappings and update the mapping configuration. If a field
3206
- mapping is already contained in an earlier component, its definition will be
3207
- completely overwritten by the later one. This recursive merging strategy applies
3208
- not only to field mappings, but also root options like `dynamic_templates` and
3209
- `meta`. If an earlier component contains a `dynamic_templates` block, then by
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>`_
3513
+ .. raw:: html
3514
+
3515
+ <p>Create or update an index template.
3516
+ Index templates define settings, mappings, and aliases that can be applied automatically to new indices.</p>
3517
+ <p>Elasticsearch applies templates to new indices based on an wildcard pattern that matches the index name.
3518
+ Index templates are applied during data stream or index creation.
3519
+ For data streams, these settings and mappings are applied when the stream's backing indices are created.
3520
+ Settings and mappings specified in a create index API request override any settings or mappings specified in an index template.
3521
+ Changes to index templates do not affect existing indices, including the existing backing indices of a data stream.</p>
3522
+ <p>You can use C-style <code>/* *\\/</code> block comments in index templates.
3523
+ You can include comments anywhere in the request body, except before the opening curly bracket.</p>
3524
+ <p><strong>Multiple matching templates</strong></p>
3525
+ <p>If multiple index templates match the name of a new index or data stream, the template with the highest priority is used.</p>
3526
+ <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>
3527
+ <p><strong>Composing aliases, mappings, and settings</strong></p>
3528
+ <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.
3529
+ Any mappings, settings, or aliases from the parent index template are merged in next.
3530
+ Finally, any configuration on the index request itself is merged.
3531
+ Mapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration.
3532
+ If a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one.
3533
+ This recursive merging strategy applies not only to field mappings, but also root options like <code>dynamic_templates</code> and <code>meta</code>.
3534
+ 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.
3535
+ If an entry already exists with the same key, then it is overwritten by the new definition.</p>
3536
+
3537
+
3538
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-index-template>`_
3214
3539
 
3215
3540
  :param name: Index or template name
3216
3541
  :param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
@@ -3341,10 +3666,7 @@ class IndicesClient(NamespacedClient):
3341
3666
  ] = None,
3342
3667
  dynamic_date_formats: t.Optional[t.Sequence[str]] = None,
3343
3668
  dynamic_templates: t.Optional[
3344
- t.Union[
3345
- t.Mapping[str, t.Mapping[str, t.Any]],
3346
- t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]],
3347
- ]
3669
+ t.Sequence[t.Mapping[str, t.Mapping[str, t.Any]]]
3348
3670
  ] = None,
3349
3671
  error_trace: t.Optional[bool] = None,
3350
3672
  expand_wildcards: t.Optional[
@@ -3372,29 +3694,31 @@ class IndicesClient(NamespacedClient):
3372
3694
  body: t.Optional[t.Dict[str, t.Any]] = None,
3373
3695
  ) -> ObjectApiResponse[t.Any]:
3374
3696
  """
3375
- Update field mappings. Add new fields to an existing data stream or index. You
3376
- can also use this API to change the search settings of existing fields and add
3377
- new properties to existing object fields. For data streams, these changes are
3378
- applied to all backing indices by default. **Add multi-fields to an existing
3379
- field** Multi-fields let you index the same field in different ways. You can
3380
- use this API to update the fields mapping parameter and enable multi-fields for
3381
- an existing field. WARNING: If an index (or data stream) contains documents when
3382
- you add a multi-field, those documents will not have values for the new multi-field.
3383
- You can populate the new multi-field with the update by query API. **Change supported
3384
- mapping parameters for an existing field** The documentation for each mapping
3385
- parameter indicates whether you can update it for an existing field using this
3386
- API. For example, you can use the update mapping API to update the `ignore_above`
3387
- parameter. **Change the mapping of an existing field** Except for supported mapping
3388
- parameters, you can't change the mapping or field type of an existing field.
3389
- Changing an existing field could invalidate data that's already indexed. If you
3390
- need to change the mapping of a field in a data stream's backing indices, refer
3391
- to documentation about modifying data streams. If you need to change the mapping
3392
- of a field in other indices, create a new index with the correct mapping and
3393
- reindex your data into that index. **Rename a field** Renaming a field would
3394
- invalidate data already indexed under the old field name. Instead, add an alias
3395
- field to create an alternate field name.
3396
-
3397
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-mapping.html>`_
3697
+ .. raw:: html
3698
+
3699
+ <p>Update field mappings.
3700
+ Add new fields to an existing data stream or index.
3701
+ You can also use this API to change the search settings of existing fields and add new properties to existing object fields.
3702
+ For data streams, these changes are applied to all backing indices by default.</p>
3703
+ <p><strong>Add multi-fields to an existing field</strong></p>
3704
+ <p>Multi-fields let you index the same field in different ways.
3705
+ You can use this API to update the fields mapping parameter and enable multi-fields for an existing field.
3706
+ 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.
3707
+ You can populate the new multi-field with the update by query API.</p>
3708
+ <p><strong>Change supported mapping parameters for an existing field</strong></p>
3709
+ <p>The documentation for each mapping parameter indicates whether you can update it for an existing field using this API.
3710
+ For example, you can use the update mapping API to update the <code>ignore_above</code> parameter.</p>
3711
+ <p><strong>Change the mapping of an existing field</strong></p>
3712
+ <p>Except for supported mapping parameters, you can't change the mapping or field type of an existing field.
3713
+ Changing an existing field could invalidate data that's already indexed.</p>
3714
+ <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.
3715
+ 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>
3716
+ <p><strong>Rename a field</strong></p>
3717
+ <p>Renaming a field would invalidate data already indexed under the old field name.
3718
+ Instead, add an alias field to create an alternate field name.</p>
3719
+
3720
+
3721
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-mapping>`_
3398
3722
 
3399
3723
  :param index: A comma-separated list of index names the mapping should be added
3400
3724
  to (supports wildcards); use `_all` or omit to add the mapping on all indices.
@@ -3518,26 +3842,29 @@ class IndicesClient(NamespacedClient):
3518
3842
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3519
3843
  preserve_existing: t.Optional[bool] = None,
3520
3844
  pretty: t.Optional[bool] = None,
3845
+ reopen: t.Optional[bool] = None,
3521
3846
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3522
3847
  ) -> ObjectApiResponse[t.Any]:
3523
3848
  """
3524
- Update index settings. Changes dynamic index settings in real time. For data
3525
- streams, index setting changes are applied to all backing indices by default.
3526
- To revert a setting to the default value, use a null value. The list of per-index
3527
- settings that can be updated dynamically on live indices can be found in index
3528
- module documentation. To preserve existing settings from being updated, set the
3529
- `preserve_existing` parameter to `true`. NOTE: You can only define new analyzers
3530
- on closed indices. To add an analyzer, you must close the index, define the analyzer,
3531
- and reopen the index. You cannot close the write index of a data stream. To update
3532
- the analyzer for a data stream's write index and future backing indices, update
3533
- the analyzer in the index template used by the stream. Then roll over the data
3534
- stream to apply the new analyzer to the stream's write index and future backing
3535
- indices. This affects searches and any new data added to the stream after the
3536
- rollover. However, it does not affect the data stream's backing indices or their
3537
- existing data. To change the analyzer for existing backing indices, you must
3538
- create a new data stream and reindex your data into it.
3539
-
3540
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-update-settings.html>`_
3849
+ .. raw:: html
3850
+
3851
+ <p>Update index settings.
3852
+ Changes dynamic index settings in real time.
3853
+ For data streams, index setting changes are applied to all backing indices by default.</p>
3854
+ <p>To revert a setting to the default value, use a null value.
3855
+ The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation.
3856
+ To preserve existing settings from being updated, set the <code>preserve_existing</code> parameter to <code>true</code>.</p>
3857
+ <p>NOTE: You can only define new analyzers on closed indices.
3858
+ To add an analyzer, you must close the index, define the analyzer, and reopen the index.
3859
+ You cannot close the write index of a data stream.
3860
+ 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.
3861
+ Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices.
3862
+ This affects searches and any new data added to the stream after the rollover.
3863
+ However, it does not affect the data stream's backing indices or their existing data.
3864
+ To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it.</p>
3865
+
3866
+
3867
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-settings>`_
3541
3868
 
3542
3869
  :param settings:
3543
3870
  :param index: Comma-separated list of data streams, indices, and aliases used
@@ -3558,6 +3885,9 @@ class IndicesClient(NamespacedClient):
3558
3885
  no response is received before the timeout expires, the request fails and
3559
3886
  returns an error.
3560
3887
  :param preserve_existing: If `true`, existing index settings remain unchanged.
3888
+ :param reopen: Whether to close and reopen the index to apply non-dynamic settings.
3889
+ If set to `true` the indices to which the settings are being applied will
3890
+ be closed temporarily and then reopened in order to apply the changes.
3561
3891
  :param timeout: Period to wait for a response. If no response is received before
3562
3892
  the timeout expires, the request fails and returns an error.
3563
3893
  """
@@ -3595,6 +3925,8 @@ class IndicesClient(NamespacedClient):
3595
3925
  __query["preserve_existing"] = preserve_existing
3596
3926
  if pretty is not None:
3597
3927
  __query["pretty"] = pretty
3928
+ if reopen is not None:
3929
+ __query["reopen"] = reopen
3598
3930
  if timeout is not None:
3599
3931
  __query["timeout"] = timeout
3600
3932
  __body = settings if settings is not None else body
@@ -3639,30 +3971,30 @@ class IndicesClient(NamespacedClient):
3639
3971
  body: t.Optional[t.Dict[str, t.Any]] = None,
3640
3972
  ) -> ObjectApiResponse[t.Any]:
3641
3973
  """
3642
- Create or update an index template. Index templates define settings, mappings,
3643
- and aliases that can be applied automatically to new indices. Elasticsearch applies
3644
- templates to new indices based on an index pattern that matches the index name.
3645
- IMPORTANT: This documentation is about legacy index templates, which are deprecated
3646
- and will be replaced by the composable templates introduced in Elasticsearch
3647
- 7.8. Composable templates always take precedence over legacy templates. If no
3648
- composable template matches a new index, matching legacy templates are applied
3649
- according to their order. Index templates are only applied during index creation.
3650
- Changes to index templates do not affect existing indices. Settings and mappings
3651
- specified in create index API requests override any settings or mappings specified
3652
- in an index template. You can use C-style `/* *\\/` block comments in index templates.
3653
- You can include comments anywhere in the request body, except before the opening
3654
- curly bracket. **Indices matching multiple templates** Multiple index templates
3655
- can potentially match an index, in this case, both the settings and mappings
3656
- are merged into the final configuration of the index. The order of the merging
3657
- can be controlled using the order parameter, with lower order being applied first,
3658
- and higher orders overriding them. NOTE: Multiple matching templates with the
3659
- same order value will result in a non-deterministic merging order.
3660
-
3661
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-templates-v1.html>`_
3974
+ .. raw:: html
3975
+
3976
+ <p>Create or update an index template.
3977
+ Index templates define settings, mappings, and aliases that can be applied automatically to new indices.
3978
+ Elasticsearch applies templates to new indices based on an index pattern that matches the index name.</p>
3979
+ <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>
3980
+ <p>Composable templates always take precedence over legacy templates.
3981
+ If no composable template matches a new index, matching legacy templates are applied according to their order.</p>
3982
+ <p>Index templates are only applied during index creation.
3983
+ Changes to index templates do not affect existing indices.
3984
+ Settings and mappings specified in create index API requests override any settings or mappings specified in an index template.</p>
3985
+ <p>You can use C-style <code>/* *\\/</code> block comments in index templates.
3986
+ You can include comments anywhere in the request body, except before the opening curly bracket.</p>
3987
+ <p><strong>Indices matching multiple templates</strong></p>
3988
+ <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.
3989
+ The order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them.
3990
+ NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order.</p>
3991
+
3992
+
3993
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-put-template>`_
3662
3994
 
3663
3995
  :param name: The name of the template
3664
3996
  :param aliases: Aliases for the index.
3665
- :param cause:
3997
+ :param cause: User defined reason for creating/updating the index template
3666
3998
  :param create: If true, this request cannot replace or update existing index
3667
3999
  templates.
3668
4000
  :param index_patterns: Array of wildcard expressions used to match the names
@@ -3737,29 +4069,30 @@ class IndicesClient(NamespacedClient):
3737
4069
  pretty: t.Optional[bool] = None,
3738
4070
  ) -> ObjectApiResponse[t.Any]:
3739
4071
  """
3740
- Get index recovery information. Get information about ongoing and completed shard
3741
- recoveries for one or more indices. For data streams, the API returns information
3742
- for the stream's backing indices. All recoveries, whether ongoing or complete,
3743
- are kept in the cluster state and may be reported on at any time. Shard recovery
3744
- is the process of initializing a shard copy, such as restoring a primary shard
3745
- from a snapshot or creating a replica shard from a primary shard. When a shard
3746
- recovery completes, the recovered shard is available for search and indexing.
3747
- Recovery automatically occurs during the following processes: * When creating
3748
- an index for the first time. * When a node rejoins the cluster and starts up
3749
- any missing primary shard copies using the data that it holds in its data path.
3750
- * Creation of new replica shard copies from the primary. * Relocation of a shard
3751
- copy to a different node in the same cluster. * A snapshot restore operation.
3752
- * A clone, shrink, or split operation. You can determine the cause of a shard
3753
- recovery using the recovery or cat recovery APIs. The index recovery API reports
3754
- information about completed recoveries only for shard copies that currently exist
3755
- in the cluster. It only reports the last recovery for each shard copy and does
3756
- not report historical information about earlier recoveries, nor does it report
3757
- information about the recoveries of shard copies that no longer exist. This means
3758
- that if a shard copy completes a recovery and then Elasticsearch relocates it
3759
- onto a different node then the information about the original recovery will not
3760
- be shown in the recovery API.
3761
-
3762
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-recovery.html>`_
4072
+ .. raw:: html
4073
+
4074
+ <p>Get index recovery information.
4075
+ Get information about ongoing and completed shard recoveries for one or more indices.
4076
+ For data streams, the API returns information for the stream's backing indices.</p>
4077
+ <p>All recoveries, whether ongoing or complete, are kept in the cluster state and may be reported on at any time.</p>
4078
+ <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.
4079
+ When a shard recovery completes, the recovered shard is available for search and indexing.</p>
4080
+ <p>Recovery automatically occurs during the following processes:</p>
4081
+ <ul>
4082
+ <li>When creating an index for the first time.</li>
4083
+ <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>
4084
+ <li>Creation of new replica shard copies from the primary.</li>
4085
+ <li>Relocation of a shard copy to a different node in the same cluster.</li>
4086
+ <li>A snapshot restore operation.</li>
4087
+ <li>A clone, shrink, or split operation.</li>
4088
+ </ul>
4089
+ <p>You can determine the cause of a shard recovery using the recovery or cat recovery APIs.</p>
4090
+ <p>The index recovery API reports information about completed recoveries only for shard copies that currently exist in the cluster.
4091
+ 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.
4092
+ 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>
4093
+
4094
+
4095
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-recovery>`_
3763
4096
 
3764
4097
  :param index: Comma-separated list of data streams, indices, and aliases used
3765
4098
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -3819,21 +4152,21 @@ class IndicesClient(NamespacedClient):
3819
4152
  pretty: t.Optional[bool] = None,
3820
4153
  ) -> ObjectApiResponse[t.Any]:
3821
4154
  """
3822
- Refresh an index. A refresh makes recent operations performed on one or more
3823
- indices available for search. For data streams, the API runs the refresh operation
3824
- on the stream’s backing indices. By default, Elasticsearch periodically refreshes
3825
- indices every second, but only on indices that have received one search request
3826
- or more in the last 30 seconds. You can change this default interval with the
3827
- `index.refresh_interval` setting. Refresh requests are synchronous and do not
3828
- return a response until the refresh operation completes. Refreshes are resource-intensive.
3829
- To ensure good cluster performance, it's recommended to wait for Elasticsearch's
3830
- periodic refresh rather than performing an explicit refresh when possible. If
3831
- your application workflow indexes documents and then runs a search to retrieve
3832
- the indexed document, it's recommended to use the index API's `refresh=wait_for`
3833
- query parameter option. This option ensures the indexing operation waits for
3834
- a periodic refresh before running the search.
3835
-
3836
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-refresh.html>`_
4155
+ .. raw:: html
4156
+
4157
+ <p>Refresh an index.
4158
+ A refresh makes recent operations performed on one or more indices available for search.
4159
+ For data streams, the API runs the refresh operation on the stream’s backing indices.</p>
4160
+ <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.
4161
+ You can change this default interval with the <code>index.refresh_interval</code> setting.</p>
4162
+ <p>Refresh requests are synchronous and do not return a response until the refresh operation completes.</p>
4163
+ <p>Refreshes are resource-intensive.
4164
+ To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.</p>
4165
+ <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.
4166
+ This option ensures the indexing operation waits for a periodic refresh before running the search.</p>
4167
+
4168
+
4169
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-refresh>`_
3837
4170
 
3838
4171
  :param index: Comma-separated list of data streams, indices, and aliases used
3839
4172
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -3899,25 +4232,25 @@ class IndicesClient(NamespacedClient):
3899
4232
  human: t.Optional[bool] = None,
3900
4233
  ignore_unavailable: t.Optional[bool] = None,
3901
4234
  pretty: t.Optional[bool] = None,
4235
+ resource: t.Optional[str] = None,
3902
4236
  ) -> ObjectApiResponse[t.Any]:
3903
4237
  """
3904
- Reload search analyzers. Reload an index's search analyzers and their resources.
3905
- For data streams, the API reloads search analyzers and resources for the stream's
3906
- backing indices. IMPORTANT: After reloading the search analyzers you should clear
3907
- the request cache to make sure it doesn't contain responses derived from the
3908
- previous versions of the analyzer. You can use the reload search analyzers API
3909
- to pick up changes to synonym files used in the `synonym_graph` or `synonym`
3910
- token filter of a search analyzer. To be eligible, the token filter must have
3911
- an `updateable` flag of `true` and only be used in search analyzers. NOTE: This
3912
- API does not perform a reload for each shard of an index. Instead, it performs
3913
- a reload for each node containing index shards. As a result, the total shard
3914
- count returned by the API can differ from the number of index shards. Because
3915
- reloading affects every node with an index shard, it is important to update the
3916
- synonym file on every data node in the cluster--including nodes that don't contain
3917
- a shard replica--before using this API. This ensures the synonym file is updated
3918
- everywhere in the cluster in case shards are relocated in the future.
3919
-
3920
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-reload-analyzers.html>`_
4238
+ .. raw:: html
4239
+
4240
+ <p>Reload search analyzers.
4241
+ Reload an index's search analyzers and their resources.
4242
+ For data streams, the API reloads search analyzers and resources for the stream's backing indices.</p>
4243
+ <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>
4244
+ <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.
4245
+ 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>
4246
+ <p>NOTE: This API does not perform a reload for each shard of an index.
4247
+ Instead, it performs a reload for each node containing index shards.
4248
+ As a result, the total shard count returned by the API can differ from the number of index shards.
4249
+ 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.
4250
+ This ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future.</p>
4251
+
4252
+
4253
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-reload-search-analyzers>`_
3921
4254
 
3922
4255
  :param index: A comma-separated list of index names to reload analyzers for
3923
4256
  :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
@@ -3927,6 +4260,7 @@ class IndicesClient(NamespacedClient):
3927
4260
  that are open, closed or both.
3928
4261
  :param ignore_unavailable: Whether specified concrete indices should be ignored
3929
4262
  when unavailable (missing or closed)
4263
+ :param resource: Changed resource to reload analyzers from if applicable
3930
4264
  """
3931
4265
  if index in SKIP_IN_PATH:
3932
4266
  raise ValueError("Empty value passed for parameter 'index'")
@@ -3947,6 +4281,8 @@ class IndicesClient(NamespacedClient):
3947
4281
  __query["ignore_unavailable"] = ignore_unavailable
3948
4282
  if pretty is not None:
3949
4283
  __query["pretty"] = pretty
4284
+ if resource is not None:
4285
+ __query["resource"] = resource
3950
4286
  __headers = {"accept": "application/json"}
3951
4287
  return await self.perform_request( # type: ignore[return-value]
3952
4288
  "POST",
@@ -3961,7 +4297,7 @@ class IndicesClient(NamespacedClient):
3961
4297
  async def resolve_cluster(
3962
4298
  self,
3963
4299
  *,
3964
- name: t.Union[str, t.Sequence[str]],
4300
+ name: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3965
4301
  allow_no_indices: t.Optional[bool] = None,
3966
4302
  error_trace: t.Optional[bool] = None,
3967
4303
  expand_wildcards: t.Optional[
@@ -3977,64 +4313,95 @@ class IndicesClient(NamespacedClient):
3977
4313
  ignore_throttled: t.Optional[bool] = None,
3978
4314
  ignore_unavailable: t.Optional[bool] = None,
3979
4315
  pretty: t.Optional[bool] = None,
4316
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3980
4317
  ) -> ObjectApiResponse[t.Any]:
3981
4318
  """
3982
- Resolve the cluster. Resolve the specified index expressions to return information
3983
- about each cluster, including the local cluster, if included. Multiple patterns
3984
- and remote clusters are supported. This endpoint is useful before doing a cross-cluster
3985
- search in order to determine which remote clusters should be included in a search.
3986
- You use the same index expression with this endpoint as you would for cross-cluster
3987
- search. Index and cluster exclusions are also supported with this endpoint. For
3988
- each cluster in the index expression, information is returned about: * Whether
3989
- the querying ("local") cluster is currently connected to each remote cluster
3990
- in the index expression scope. * Whether each remote cluster is configured with
3991
- `skip_unavailable` as `true` or `false`. * Whether there are any indices, aliases,
3992
- or data streams on that cluster that match the index expression. * Whether the
3993
- search is likely to have errors returned when you do the cross-cluster search
3994
- (including any authorization errors if you do not have permission to query the
3995
- index). * Cluster version information, including the Elasticsearch server version.
3996
- For example, `GET /_resolve/cluster/my-index-*,cluster*:my-index-*` returns information
3997
- about the local cluster and all remotely configured clusters that start with
3998
- the alias `cluster*`. Each cluster returns information about whether it has any
3999
- indices, aliases or data streams that match `my-index-*`. **Advantages of using
4000
- this endpoint before a cross-cluster search** You may want to exclude a cluster
4001
- or index from a search when: * A remote cluster is not currently connected and
4002
- is configured with `skip_unavailable=false`. Running a cross-cluster search under
4003
- those conditions will cause the entire search to fail. * A cluster has no matching
4004
- indices, aliases or data streams for the index expression (or your user does
4005
- not have permissions to search them). For example, suppose your index expression
4006
- is `logs*,remote1:logs*` and the remote1 cluster has no indices, aliases or data
4007
- streams that match `logs*`. In that case, that cluster will return no results
4008
- from that cluster if you include it in a cross-cluster search. * The index expression
4009
- (combined with any query parameters you specify) will likely cause an exception
4010
- to be thrown when you do the search. In these cases, the "error" field in the
4011
- `_resolve/cluster` response will be present. (This is also where security/permission
4012
- errors will be shown.) * A remote cluster is an older version that does not support
4013
- the feature you want to use in your search.
4014
-
4015
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-resolve-cluster-api.html>`_
4016
-
4017
- :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
4018
- and data streams to resolve. Resources on remote clusters can be specified
4019
- using the `<cluster>`:`<name>` syntax.
4319
+ .. raw:: html
4320
+
4321
+ <p>Resolve the cluster.</p>
4322
+ <p>Resolve the specified index expressions to return information about each cluster, including the local &quot;querying&quot; cluster, if included.
4323
+ If no index expression is provided, the API will return information about all the remote clusters that are configured on the querying cluster.</p>
4324
+ <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>
4325
+ <p>You use the same index expression with this endpoint as you would for cross-cluster search.
4326
+ Index and cluster exclusions are also supported with this endpoint.</p>
4327
+ <p>For each cluster in the index expression, information is returned about:</p>
4328
+ <ul>
4329
+ <li>Whether the querying (&quot;local&quot;) 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>
4330
+ <li>Whether each remote cluster is configured with <code>skip_unavailable</code> as <code>true</code> or <code>false</code>.</li>
4331
+ <li>Whether there are any indices, aliases, or data streams on that cluster that match the index expression.</li>
4332
+ <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>
4333
+ <li>Cluster version information, including the Elasticsearch server version.</li>
4334
+ </ul>
4335
+ <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>.
4336
+ Each cluster returns information about whether it has any indices, aliases or data streams that match <code>my-index-*</code>.</p>
4337
+ <h2>Note on backwards compatibility</h2>
4338
+ <p>The ability to query without an index expression was added in version 8.18, so when
4339
+ querying remote clusters older than that, the local cluster will send the index
4340
+ expression <code>dummy*</code> to those remote clusters. Thus, if an errors occur, you may see a reference
4341
+ to that index expression even though you didn't request it. If it causes a problem, you can
4342
+ instead include an index expression like <code>*:*</code> to bypass the issue.</p>
4343
+ <h2>Advantages of using this endpoint before a cross-cluster search</h2>
4344
+ <p>You may want to exclude a cluster or index from a search when:</p>
4345
+ <ul>
4346
+ <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>
4347
+ <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>
4348
+ <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 &quot;error&quot; field in the <code>_resolve/cluster</code> response will be present. (This is also where security/permission errors will be shown.)</li>
4349
+ <li>A remote cluster is an older version that does not support the feature you want to use in your search.</li>
4350
+ </ul>
4351
+ <h2>Test availability of remote clusters</h2>
4352
+ <p>The <code>remote/info</code> endpoint is commonly used to test whether the &quot;local&quot; 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.
4353
+ The remote cluster may be available, while the local cluster is not currently connected to it.</p>
4354
+ <p>You can use the <code>_resolve/cluster</code> API to attempt to reconnect to remote clusters.
4355
+ For example with <code>GET _resolve/cluster</code> or <code>GET _resolve/cluster/*:*</code>.
4356
+ The <code>connected</code> field in the response will indicate whether it was successful.
4357
+ If a connection was (re-)established, this will also cause the <code>remote/info</code> endpoint to now indicate a connected status.</p>
4358
+
4359
+
4360
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-resolve-cluster>`_
4361
+
4362
+ :param name: A comma-separated list of names or index patterns for the indices,
4363
+ aliases, and data streams to resolve. Resources on remote clusters can be
4364
+ specified using the `<cluster>`:`<name>` syntax. Index and cluster exclusions
4365
+ (e.g., `-cluster1:*`) are also supported. If no index expression is specified,
4366
+ information about all remote clusters configured on the local cluster is
4367
+ returned without doing any index matching
4020
4368
  :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.
4369
+ expression, index alias, or `_all` value targets only missing or closed indices.
4022
4370
  This behavior applies even if the request targets other open indices. For
4023
- example, a request targeting foo*,bar* returns an error if an index starts
4024
- with foo but no index starts with bar.
4371
+ example, a request targeting `foo*,bar*` returns an error if an index starts
4372
+ with `foo` but no index starts with `bar`. NOTE: This option is only supported
4373
+ when specifying an index expression. You will get an error if you specify
4374
+ index options to the `_resolve/cluster` API endpoint that takes no index
4375
+ expression.
4025
4376
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
4026
4377
  request can target data streams, this argument determines whether wildcard
4027
4378
  expressions match hidden data streams. Supports comma-separated values, such
4028
4379
  as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
4029
- :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
4030
- when frozen. Defaults to false.
4380
+ NOTE: This option is only supported when specifying an index expression.
4381
+ You will get an error if you specify index options to the `_resolve/cluster`
4382
+ API endpoint that takes no index expression.
4383
+ :param ignore_throttled: If true, concrete, expanded, or aliased indices are
4384
+ ignored when frozen. NOTE: This option is only supported when specifying
4385
+ an index expression. You will get an error if you specify index options to
4386
+ the `_resolve/cluster` API endpoint that takes no index expression.
4031
4387
  :param ignore_unavailable: If false, the request returns an error if it targets
4032
- a missing or closed index. Defaults to false.
4388
+ a missing or closed index. NOTE: This option is only supported when specifying
4389
+ an index expression. You will get an error if you specify index options to
4390
+ the `_resolve/cluster` API endpoint that takes no index expression.
4391
+ :param timeout: The maximum time to wait for remote clusters to respond. If a
4392
+ remote cluster does not respond within this timeout period, the API response
4393
+ will show the cluster as not connected and include an error message that
4394
+ the request timed out. The default timeout is unset and the query can take
4395
+ as long as the networking layer is configured to wait for remote clusters
4396
+ that are not responding (typically 30 seconds).
4033
4397
  """
4034
- if name in SKIP_IN_PATH:
4035
- raise ValueError("Empty value passed for parameter 'name'")
4036
- __path_parts: t.Dict[str, str] = {"name": _quote(name)}
4037
- __path = f'/_resolve/cluster/{__path_parts["name"]}'
4398
+ __path_parts: t.Dict[str, str]
4399
+ if name not in SKIP_IN_PATH:
4400
+ __path_parts = {"name": _quote(name)}
4401
+ __path = f'/_resolve/cluster/{__path_parts["name"]}'
4402
+ else:
4403
+ __path_parts = {}
4404
+ __path = "/_resolve/cluster"
4038
4405
  __query: t.Dict[str, t.Any] = {}
4039
4406
  if allow_no_indices is not None:
4040
4407
  __query["allow_no_indices"] = allow_no_indices
@@ -4052,6 +4419,8 @@ class IndicesClient(NamespacedClient):
4052
4419
  __query["ignore_unavailable"] = ignore_unavailable
4053
4420
  if pretty is not None:
4054
4421
  __query["pretty"] = pretty
4422
+ if timeout is not None:
4423
+ __query["timeout"] = timeout
4055
4424
  __headers = {"accept": "application/json"}
4056
4425
  return await self.perform_request( # type: ignore[return-value]
4057
4426
  "GET",
@@ -4083,10 +4452,14 @@ class IndicesClient(NamespacedClient):
4083
4452
  pretty: t.Optional[bool] = None,
4084
4453
  ) -> ObjectApiResponse[t.Any]:
4085
4454
  """
4086
- Resolve indices. Resolve the names and/or index patterns for indices, aliases,
4087
- and data streams. Multiple patterns and remote clusters are supported.
4455
+ .. raw:: html
4088
4456
 
4089
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-resolve-index-api.html>`_
4457
+ <p>Resolve indices.
4458
+ Resolve the names and/or index patterns for indices, aliases, and data streams.
4459
+ Multiple patterns and remote clusters are supported.</p>
4460
+
4461
+
4462
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-resolve-index>`_
4090
4463
 
4091
4464
  :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
4092
4465
  and data streams to resolve. Resources on remote clusters can be specified
@@ -4146,6 +4519,7 @@ class IndicesClient(NamespacedClient):
4146
4519
  error_trace: t.Optional[bool] = None,
4147
4520
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4148
4521
  human: t.Optional[bool] = None,
4522
+ lazy: t.Optional[bool] = None,
4149
4523
  mappings: t.Optional[t.Mapping[str, t.Any]] = None,
4150
4524
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4151
4525
  pretty: t.Optional[bool] = None,
@@ -4157,35 +4531,37 @@ class IndicesClient(NamespacedClient):
4157
4531
  body: t.Optional[t.Dict[str, t.Any]] = None,
4158
4532
  ) -> ObjectApiResponse[t.Any]:
4159
4533
  """
4160
- Roll over to a new index. TIP: It is recommended to use the index lifecycle rollover
4161
- action to automate rollovers. The rollover API creates a new index for a data
4162
- stream or index alias. The API behavior depends on the rollover target. **Roll
4163
- over a data stream** If you roll over a data stream, the API creates a new write
4164
- index for the stream. The stream's previous write index becomes a regular backing
4165
- index. A rollover also increments the data stream's generation. **Roll over an
4166
- index alias with a write index** TIP: Prior to Elasticsearch 7.9, you'd typically
4167
- use an index alias with a write index to manage time series data. Data streams
4168
- replace this functionality, require less maintenance, and automatically integrate
4169
- with data tiers. If an index alias points to multiple indices, one of the indices
4170
- must be a write index. The rollover API creates a new write index for the alias
4171
- with `is_write_index` set to `true`. The API also `sets is_write_index` to `false`
4172
- for the previous write index. **Roll over an index alias with one index** If
4173
- you roll over an index alias that points to only one index, the API creates a
4174
- new index for the alias and removes the original index from the alias. NOTE:
4175
- A rollover creates a new index and is subject to the `wait_for_active_shards`
4176
- setting. **Increment index names for an alias** When you roll over an index alias,
4177
- you can specify a name for the new index. If you don't specify a name and the
4178
- current index ends with `-` and a number, such as `my-index-000001` or `my-index-3`,
4179
- the new index name increments that number. For example, if you roll over an alias
4180
- with a current index of `my-index-000001`, the rollover creates a new index named
4181
- `my-index-000002`. This number is always six characters and zero-padded, regardless
4182
- of the previous index's name. If you use an index alias for time series data,
4183
- you can use date math in the index name to track the rollover date. For example,
4184
- you can create an alias that points to an index named `<my-index-{now/d}-000001>`.
4185
- If you create the index on May 6, 2099, the index's name is `my-index-2099.05.06-000001`.
4186
- If you roll over the alias on May 7, 2099, the new index's name is `my-index-2099.05.07-000002`.
4187
-
4188
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-rollover-index.html>`_
4534
+ .. raw:: html
4535
+
4536
+ <p>Roll over to a new index.
4537
+ TIP: It is recommended to use the index lifecycle rollover action to automate rollovers.</p>
4538
+ <p>The rollover API creates a new index for a data stream or index alias.
4539
+ The API behavior depends on the rollover target.</p>
4540
+ <p><strong>Roll over a data stream</strong></p>
4541
+ <p>If you roll over a data stream, the API creates a new write index for the stream.
4542
+ The stream's previous write index becomes a regular backing index.
4543
+ A rollover also increments the data stream's generation.</p>
4544
+ <p><strong>Roll over an index alias with a write index</strong></p>
4545
+ <p>TIP: Prior to Elasticsearch 7.9, you'd typically use an index alias with a write index to manage time series data.
4546
+ Data streams replace this functionality, require less maintenance, and automatically integrate with data tiers.</p>
4547
+ <p>If an index alias points to multiple indices, one of the indices must be a write index.
4548
+ The rollover API creates a new write index for the alias with <code>is_write_index</code> set to <code>true</code>.
4549
+ The API also <code>sets is_write_index</code> to <code>false</code> for the previous write index.</p>
4550
+ <p><strong>Roll over an index alias with one index</strong></p>
4551
+ <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>
4552
+ <p>NOTE: A rollover creates a new index and is subject to the <code>wait_for_active_shards</code> setting.</p>
4553
+ <p><strong>Increment index names for an alias</strong></p>
4554
+ <p>When you roll over an index alias, you can specify a name for the new index.
4555
+ 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.
4556
+ 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>.
4557
+ This number is always six characters and zero-padded, regardless of the previous index's name.</p>
4558
+ <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.
4559
+ For example, you can create an alias that points to an index named <code>&lt;my-index-{now/d}-000001&gt;</code>.
4560
+ If you create the index on May 6, 2099, the index's name is <code>my-index-2099.05.06-000001</code>.
4561
+ 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>
4562
+
4563
+
4564
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-rollover>`_
4189
4565
 
4190
4566
  :param alias: Name of the data stream or index alias to roll over.
4191
4567
  :param new_index: Name of the index to create. Supports date math. Data streams
@@ -4200,6 +4576,9 @@ class IndicesClient(NamespacedClient):
4200
4576
  conditions are satisfied.
4201
4577
  :param dry_run: If `true`, checks whether the current index satisfies the specified
4202
4578
  conditions but does not perform a rollover.
4579
+ :param lazy: If set to true, the rollover action will only mark a data stream
4580
+ to signal that it needs to be rolled over at the next write. Only allowed
4581
+ on data streams.
4203
4582
  :param mappings: Mapping for fields in the index. If specified, this mapping
4204
4583
  can include field names, field data types, and mapping paramaters.
4205
4584
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -4234,6 +4613,8 @@ class IndicesClient(NamespacedClient):
4234
4613
  __query["filter_path"] = filter_path
4235
4614
  if human is not None:
4236
4615
  __query["human"] = human
4616
+ if lazy is not None:
4617
+ __query["lazy"] = lazy
4237
4618
  if master_timeout is not None:
4238
4619
  __query["master_timeout"] = master_timeout
4239
4620
  if pretty is not None:
@@ -4285,14 +4666,16 @@ class IndicesClient(NamespacedClient):
4285
4666
  human: t.Optional[bool] = None,
4286
4667
  ignore_unavailable: t.Optional[bool] = None,
4287
4668
  pretty: t.Optional[bool] = None,
4288
- verbose: t.Optional[bool] = None,
4289
4669
  ) -> ObjectApiResponse[t.Any]:
4290
4670
  """
4291
- Get index segments. Get low-level information about the Lucene segments in index
4292
- shards. For data streams, the API returns information about the stream's backing
4293
- indices.
4671
+ .. raw:: html
4294
4672
 
4295
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-segments.html>`_
4673
+ <p>Get index segments.
4674
+ Get low-level information about the Lucene segments in index shards.
4675
+ For data streams, the API returns information about the stream's backing indices.</p>
4676
+
4677
+
4678
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-segments>`_
4296
4679
 
4297
4680
  :param index: Comma-separated list of data streams, indices, and aliases used
4298
4681
  to limit the request. Supports wildcards (`*`). To target all data streams
@@ -4306,7 +4689,6 @@ class IndicesClient(NamespacedClient):
4306
4689
  as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
4307
4690
  :param ignore_unavailable: If `false`, the request returns an error if it targets
4308
4691
  a missing or closed index.
4309
- :param verbose: If `true`, the request returns a verbose response.
4310
4692
  """
4311
4693
  __path_parts: t.Dict[str, str]
4312
4694
  if index not in SKIP_IN_PATH:
@@ -4330,8 +4712,6 @@ class IndicesClient(NamespacedClient):
4330
4712
  __query["ignore_unavailable"] = ignore_unavailable
4331
4713
  if pretty is not None:
4332
4714
  __query["pretty"] = pretty
4333
- if verbose is not None:
4334
- __query["verbose"] = verbose
4335
4715
  __headers = {"accept": "application/json"}
4336
4716
  return await self.perform_request( # type: ignore[return-value]
4337
4717
  "GET",
@@ -4369,16 +4749,22 @@ class IndicesClient(NamespacedClient):
4369
4749
  ] = None,
4370
4750
  ) -> ObjectApiResponse[t.Any]:
4371
4751
  """
4372
- Get index shard stores. Get store information about replica shards in one or
4373
- more indices. For data streams, the API retrieves store information for the stream's
4374
- backing indices. The index shard stores API returns the following information:
4375
- * The node on which each replica shard exists. * The allocation ID for each replica
4376
- shard. * A unique ID for each replica shard. * Any errors encountered while opening
4377
- the shard index or from an earlier failure. By default, the API returns store
4378
- information only for primary shards that are unassigned or have one or more unassigned
4379
- replica shards.
4752
+ .. raw:: html
4380
4753
 
4381
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-shards-stores.html>`_
4754
+ <p>Get index shard stores.
4755
+ Get store information about replica shards in one or more indices.
4756
+ For data streams, the API retrieves store information for the stream's backing indices.</p>
4757
+ <p>The index shard stores API returns the following information:</p>
4758
+ <ul>
4759
+ <li>The node on which each replica shard exists.</li>
4760
+ <li>The allocation ID for each replica shard.</li>
4761
+ <li>A unique ID for each replica shard.</li>
4762
+ <li>Any errors encountered while opening the shard index or from an earlier failure.</li>
4763
+ </ul>
4764
+ <p>By default, the API returns store information only for primary shards that are unassigned or have one or more unassigned replica shards.</p>
4765
+
4766
+
4767
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-shard-stores>`_
4382
4768
 
4383
4769
  :param index: List of data streams, indices, and aliases used to limit the request.
4384
4770
  :param allow_no_indices: If false, the request returns an error if any wildcard
@@ -4447,41 +4833,40 @@ class IndicesClient(NamespacedClient):
4447
4833
  body: t.Optional[t.Dict[str, t.Any]] = None,
4448
4834
  ) -> ObjectApiResponse[t.Any]:
4449
4835
  """
4450
- Shrink an index. Shrink an index into a new index with fewer primary shards.
4451
- Before you can shrink an index: * The index must be read-only. * A copy of every
4452
- shard in the index must reside on the same node. * The index must have a green
4453
- health status. To make shard allocation easier, we recommend you also remove
4454
- the index's replica shards. You can later re-add replica shards as part of the
4455
- shrink operation. The requested number of primary shards in the target index
4456
- must be a factor of the number of shards in the source index. For example an
4457
- index with 8 primary shards can be shrunk into 4, 2 or 1 primary shards or an
4458
- index with 15 primary shards can be shrunk into 5, 3 or 1. If the number of shards
4459
- in the index is a prime number it can only be shrunk into a single primary shard
4460
- Before shrinking, a (primary or replica) copy of every shard in the index must
4461
- be present on the same node. The current write index on a data stream cannot
4462
- be shrunk. In order to shrink the current write index, the data stream must first
4463
- be rolled over so that a new write index is created and then the previous write
4464
- index can be shrunk. A shrink operation: * Creates a new target index with the
4465
- same definition as the source index, but with a smaller number of primary shards.
4466
- * Hard-links segments from the source index into the target index. If the file
4467
- system does not support hard-linking, then all segments are copied into the new
4468
- index, which is a much more time consuming process. Also if using multiple data
4469
- paths, shards on different data paths require a full copy of segment files if
4470
- they are not on the same disk since hardlinks do not work across disks. * Recovers
4471
- the target index as though it were a closed index which had just been re-opened.
4472
- Recovers shards to the `.routing.allocation.initial_recovery._id` index setting.
4473
- IMPORTANT: Indices can only be shrunk if they satisfy the following requirements:
4474
- * The target index must not exist. * The source index must have more primary
4475
- shards than the target index. * The number of primary shards in the target index
4476
- must be a factor of the number of primary shards in the source index. The source
4477
- index must have more primary shards than the target index. * The index must not
4478
- contain more than 2,147,483,519 documents in total across all shards that will
4479
- be shrunk into a single shard on the target index as this is the maximum number
4480
- of docs that can fit into a single shard. * The node handling the shrink process
4481
- must have sufficient free disk space to accommodate a second copy of the existing
4482
- index.
4483
-
4484
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-shrink-index.html>`_
4836
+ .. raw:: html
4837
+
4838
+ <p>Shrink an index.
4839
+ Shrink an index into a new index with fewer primary shards.</p>
4840
+ <p>Before you can shrink an index:</p>
4841
+ <ul>
4842
+ <li>The index must be read-only.</li>
4843
+ <li>A copy of every shard in the index must reside on the same node.</li>
4844
+ <li>The index must have a green health status.</li>
4845
+ </ul>
4846
+ <p>To make shard allocation easier, we recommend you also remove the index's replica shards.
4847
+ You can later re-add replica shards as part of the shrink operation.</p>
4848
+ <p>The requested number of primary shards in the target index must be a factor of the number of shards in the source index.
4849
+ 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.
4850
+ If the number of shards in the index is a prime number it can only be shrunk into a single primary shard
4851
+ Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node.</p>
4852
+ <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>
4853
+ <p>A shrink operation:</p>
4854
+ <ul>
4855
+ <li>Creates a new target index with the same definition as the source index, but with a smaller number of primary shards.</li>
4856
+ <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>
4857
+ <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>
4858
+ </ul>
4859
+ <p>IMPORTANT: Indices can only be shrunk if they satisfy the following requirements:</p>
4860
+ <ul>
4861
+ <li>The target index must not exist.</li>
4862
+ <li>The source index must have more primary shards than the target index.</li>
4863
+ <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>
4864
+ <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>
4865
+ <li>The node handling the shrink process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
4866
+ </ul>
4867
+
4868
+
4869
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-shrink>`_
4485
4870
 
4486
4871
  :param index: Name of the source index to shrink.
4487
4872
  :param target: Name of the target index to create.
@@ -4546,6 +4931,8 @@ class IndicesClient(NamespacedClient):
4546
4931
  self,
4547
4932
  *,
4548
4933
  name: str,
4934
+ cause: t.Optional[str] = None,
4935
+ create: t.Optional[bool] = None,
4549
4936
  error_trace: t.Optional[bool] = None,
4550
4937
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4551
4938
  human: t.Optional[bool] = None,
@@ -4554,12 +4941,19 @@ class IndicesClient(NamespacedClient):
4554
4941
  pretty: t.Optional[bool] = None,
4555
4942
  ) -> ObjectApiResponse[t.Any]:
4556
4943
  """
4557
- Simulate an index. Get the index configuration that would be applied to the specified
4558
- index from an existing index template.
4944
+ .. raw:: html
4945
+
4946
+ <p>Simulate an index.
4947
+ Get the index configuration that would be applied to the specified index from an existing index template.</p>
4559
4948
 
4560
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-index.html>`_
4949
+
4950
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-simulate-index-template>`_
4561
4951
 
4562
4952
  :param name: Name of the index to simulate
4953
+ :param cause: User defined reason for dry-run creating the new template for simulation
4954
+ purposes
4955
+ :param create: Whether the index template we optionally defined in the body should
4956
+ only be dry-run added if new or can also replace an existing one
4563
4957
  :param include_defaults: If true, returns all relevant default configurations
4564
4958
  for the index template.
4565
4959
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -4571,6 +4965,10 @@ class IndicesClient(NamespacedClient):
4571
4965
  __path_parts: t.Dict[str, str] = {"name": _quote(name)}
4572
4966
  __path = f'/_index_template/_simulate_index/{__path_parts["name"]}'
4573
4967
  __query: t.Dict[str, t.Any] = {}
4968
+ if cause is not None:
4969
+ __query["cause"] = cause
4970
+ if create is not None:
4971
+ __query["create"] = create
4574
4972
  if error_trace is not None:
4575
4973
  __query["error_trace"] = error_trace
4576
4974
  if filter_path is not None:
@@ -4613,6 +5011,7 @@ class IndicesClient(NamespacedClient):
4613
5011
  *,
4614
5012
  name: t.Optional[str] = None,
4615
5013
  allow_auto_create: t.Optional[bool] = None,
5014
+ cause: t.Optional[str] = None,
4616
5015
  composed_of: t.Optional[t.Sequence[str]] = None,
4617
5016
  create: t.Optional[bool] = None,
4618
5017
  data_stream: t.Optional[t.Mapping[str, t.Any]] = None,
@@ -4632,10 +5031,13 @@ class IndicesClient(NamespacedClient):
4632
5031
  body: t.Optional[t.Dict[str, t.Any]] = None,
4633
5032
  ) -> ObjectApiResponse[t.Any]:
4634
5033
  """
4635
- Simulate an index template. Get the index configuration that would be applied
4636
- by a particular index template.
5034
+ .. raw:: html
5035
+
5036
+ <p>Simulate an index template.
5037
+ Get the index configuration that would be applied by a particular index template.</p>
5038
+
4637
5039
 
4638
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-template.html>`_
5040
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-simulate-template>`_
4639
5041
 
4640
5042
  :param name: Name of the index template to simulate. To test a template configuration
4641
5043
  before you add it to the cluster, omit this parameter and specify the template
@@ -4646,6 +5048,8 @@ class IndicesClient(NamespacedClient):
4646
5048
  via `actions.auto_create_index`. If set to `false`, then indices or data
4647
5049
  streams matching the template must always be explicitly created, and may
4648
5050
  never be automatically created.
5051
+ :param cause: User defined reason for dry-run creating the new template for simulation
5052
+ purposes
4649
5053
  :param composed_of: An ordered list of component template names. Component templates
4650
5054
  are merged in the order specified, meaning that the last component template
4651
5055
  specified has the highest precedence.
@@ -4690,6 +5094,8 @@ class IndicesClient(NamespacedClient):
4690
5094
  __path = "/_index_template/_simulate"
4691
5095
  __query: t.Dict[str, t.Any] = {}
4692
5096
  __body: t.Dict[str, t.Any] = body if body is not None else {}
5097
+ if cause is not None:
5098
+ __query["cause"] = cause
4693
5099
  if create is not None:
4694
5100
  __query["create"] = create
4695
5101
  if error_trace is not None:
@@ -4764,33 +5170,46 @@ class IndicesClient(NamespacedClient):
4764
5170
  body: t.Optional[t.Dict[str, t.Any]] = None,
4765
5171
  ) -> ObjectApiResponse[t.Any]:
4766
5172
  """
4767
- Split an index. Split an index into a new index with more primary shards. * Before
4768
- you can split an index: * The index must be read-only. * The cluster health status
4769
- must be green. You can do make an index read-only with the following request
4770
- using the add index block API: ``` PUT /my_source_index/_block/write ``` The
4771
- current write index on a data stream cannot be split. In order to split the current
4772
- write index, the data stream must first be rolled over so that a new write index
4773
- is created and then the previous write index can be split. The number of times
4774
- the index can be split (and the number of shards that each original shard can
4775
- be split into) is determined by the `index.number_of_routing_shards` setting.
4776
- The number of routing shards specifies the hashing space that is used internally
4777
- to distribute documents across shards with consistent hashing. For instance,
4778
- a 5 shard index with `number_of_routing_shards` set to 30 (5 x 2 x 3) could be
4779
- split by a factor of 2 or 3. A split operation: * Creates a new target index
4780
- with the same definition as the source index, but with a larger number of primary
4781
- shards. * Hard-links segments from the source index into the target index. If
4782
- the file system doesn't support hard-linking, all segments are copied into the
4783
- new index, which is a much more time consuming process. * Hashes all documents
4784
- again, after low level files are created, to delete documents that belong to
4785
- a different shard. * Recovers the target index as though it were a closed index
4786
- which had just been re-opened. IMPORTANT: Indices can only be split if they satisfy
4787
- the following requirements: * The target index must not exist. * The source index
4788
- must have fewer primary shards than the target index. * The number of primary
4789
- shards in the target index must be a multiple of the number of primary shards
4790
- in the source index. * The node handling the split process must have sufficient
4791
- free disk space to accommodate a second copy of the existing index.
4792
-
4793
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-split-index.html>`_
5173
+ .. raw:: html
5174
+
5175
+ <p>Split an index.
5176
+ Split an index into a new index with more primary shards.</p>
5177
+ <ul>
5178
+ <li>
5179
+ <p>Before you can split an index:</p>
5180
+ </li>
5181
+ <li>
5182
+ <p>The index must be read-only.</p>
5183
+ </li>
5184
+ <li>
5185
+ <p>The cluster health status must be green.</p>
5186
+ </li>
5187
+ </ul>
5188
+ <p>You can do make an index read-only with the following request using the add index block API:</p>
5189
+ <pre><code>PUT /my_source_index/_block/write
5190
+ </code></pre>
5191
+ <p>The current write index on a data stream cannot be split.
5192
+ 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>
5193
+ <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.
5194
+ The number of routing shards specifies the hashing space that is used internally to distribute documents across shards with consistent hashing.
5195
+ 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>
5196
+ <p>A split operation:</p>
5197
+ <ul>
5198
+ <li>Creates a new target index with the same definition as the source index, but with a larger number of primary shards.</li>
5199
+ <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>
5200
+ <li>Hashes all documents again, after low level files are created, to delete documents that belong to a different shard.</li>
5201
+ <li>Recovers the target index as though it were a closed index which had just been re-opened.</li>
5202
+ </ul>
5203
+ <p>IMPORTANT: Indices can only be split if they satisfy the following requirements:</p>
5204
+ <ul>
5205
+ <li>The target index must not exist.</li>
5206
+ <li>The source index must have fewer primary shards than the target index.</li>
5207
+ <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>
5208
+ <li>The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index.</li>
5209
+ </ul>
5210
+
5211
+
5212
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-split>`_
4794
5213
 
4795
5214
  :param index: Name of the source index to split.
4796
5215
  :param target: Name of the target index to create.
@@ -4880,16 +5299,19 @@ class IndicesClient(NamespacedClient):
4880
5299
  pretty: t.Optional[bool] = None,
4881
5300
  ) -> ObjectApiResponse[t.Any]:
4882
5301
  """
4883
- Get index statistics. For data streams, the API retrieves statistics for the
4884
- stream's backing indices. By default, the returned statistics are index-level
4885
- with `primaries` and `total` aggregations. `primaries` are the values for only
4886
- the primary shards. `total` are the accumulated values for both primary and replica
4887
- shards. To get shard-level statistics, set the `level` parameter to `shards`.
4888
- NOTE: When moving to another node, the shard-level statistics for a shard are
4889
- cleared. Although the shard is no longer part of the node, that node retains
4890
- any node-level statistics to which the shard contributed.
5302
+ .. raw:: html
5303
+
5304
+ <p>Get index statistics.
5305
+ For data streams, the API retrieves statistics for the stream's backing indices.</p>
5306
+ <p>By default, the returned statistics are index-level with <code>primaries</code> and <code>total</code> aggregations.
5307
+ <code>primaries</code> are the values for only the primary shards.
5308
+ <code>total</code> are the accumulated values for both primary and replica shards.</p>
5309
+ <p>To get shard-level statistics, set the <code>level</code> parameter to <code>shards</code>.</p>
5310
+ <p>NOTE: When moving to another node, the shard-level statistics for a shard are cleared.
5311
+ Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed.</p>
4891
5312
 
4892
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-stats.html>`_
5313
+
5314
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-stats>`_
4893
5315
 
4894
5316
  :param index: A comma-separated list of index names; use `_all` or empty string
4895
5317
  to perform the operation on all indices
@@ -4966,89 +5388,6 @@ class IndicesClient(NamespacedClient):
4966
5388
  path_parts=__path_parts,
4967
5389
  )
4968
5390
 
4969
- @_rewrite_parameters()
4970
- async def unfreeze(
4971
- self,
4972
- *,
4973
- index: str,
4974
- allow_no_indices: t.Optional[bool] = None,
4975
- error_trace: t.Optional[bool] = None,
4976
- expand_wildcards: t.Optional[
4977
- t.Union[
4978
- t.Sequence[
4979
- t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
4980
- ],
4981
- t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
4982
- ]
4983
- ] = None,
4984
- filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4985
- human: t.Optional[bool] = None,
4986
- ignore_unavailable: t.Optional[bool] = None,
4987
- master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4988
- pretty: t.Optional[bool] = None,
4989
- timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4990
- wait_for_active_shards: t.Optional[str] = None,
4991
- ) -> ObjectApiResponse[t.Any]:
4992
- """
4993
- Unfreeze an index. When a frozen index is unfrozen, the index goes through the
4994
- normal recovery process and becomes writeable again.
4995
-
4996
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/unfreeze-index-api.html>`_
4997
-
4998
- :param index: Identifier for the index.
4999
- :param allow_no_indices: If `false`, the request returns an error if any wildcard
5000
- expression, index alias, or `_all` value targets only missing or closed indices.
5001
- This behavior applies even if the request targets other open indices.
5002
- :param expand_wildcards: Type of index that wildcard patterns can match. If the
5003
- request can target data streams, this argument determines whether wildcard
5004
- expressions match hidden data streams. Supports comma-separated values, such
5005
- as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
5006
- :param ignore_unavailable: If `false`, the request returns an error if it targets
5007
- a missing or closed index.
5008
- :param master_timeout: Period to wait for a connection to the master node. If
5009
- no response is received before the timeout expires, the request fails and
5010
- returns an error.
5011
- :param timeout: Period to wait for a response. If no response is received before
5012
- the timeout expires, the request fails and returns an error.
5013
- :param wait_for_active_shards: The number of shard copies that must be active
5014
- before proceeding with the operation. Set to `all` or any positive integer
5015
- up to the total number of shards in the index (`number_of_replicas+1`).
5016
- """
5017
- if index in SKIP_IN_PATH:
5018
- raise ValueError("Empty value passed for parameter 'index'")
5019
- __path_parts: t.Dict[str, str] = {"index": _quote(index)}
5020
- __path = f'/{__path_parts["index"]}/_unfreeze'
5021
- __query: t.Dict[str, t.Any] = {}
5022
- if allow_no_indices is not None:
5023
- __query["allow_no_indices"] = allow_no_indices
5024
- if error_trace is not None:
5025
- __query["error_trace"] = error_trace
5026
- if expand_wildcards is not None:
5027
- __query["expand_wildcards"] = expand_wildcards
5028
- if filter_path is not None:
5029
- __query["filter_path"] = filter_path
5030
- if human is not None:
5031
- __query["human"] = human
5032
- if ignore_unavailable is not None:
5033
- __query["ignore_unavailable"] = ignore_unavailable
5034
- if master_timeout is not None:
5035
- __query["master_timeout"] = master_timeout
5036
- if pretty is not None:
5037
- __query["pretty"] = pretty
5038
- if timeout is not None:
5039
- __query["timeout"] = timeout
5040
- if wait_for_active_shards is not None:
5041
- __query["wait_for_active_shards"] = wait_for_active_shards
5042
- __headers = {"accept": "application/json"}
5043
- return await self.perform_request( # type: ignore[return-value]
5044
- "POST",
5045
- __path,
5046
- params=__query,
5047
- headers=__headers,
5048
- endpoint_id="indices.unfreeze",
5049
- path_parts=__path_parts,
5050
- )
5051
-
5052
5391
  @_rewrite_parameters(
5053
5392
  body_fields=("actions",),
5054
5393
  )
@@ -5065,9 +5404,13 @@ class IndicesClient(NamespacedClient):
5065
5404
  body: t.Optional[t.Dict[str, t.Any]] = None,
5066
5405
  ) -> ObjectApiResponse[t.Any]:
5067
5406
  """
5068
- Create or update an alias. Adds a data stream or index to an alias.
5407
+ .. raw:: html
5408
+
5409
+ <p>Create or update an alias.
5410
+ Adds a data stream or index to an alias.</p>
5069
5411
 
5070
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html>`_
5412
+
5413
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-update-aliases>`_
5071
5414
 
5072
5415
  :param actions: Actions to perform.
5073
5416
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -5140,9 +5483,13 @@ class IndicesClient(NamespacedClient):
5140
5483
  body: t.Optional[t.Dict[str, t.Any]] = None,
5141
5484
  ) -> ObjectApiResponse[t.Any]:
5142
5485
  """
5143
- Validate a query. Validates a query without running it.
5486
+ .. raw:: html
5487
+
5488
+ <p>Validate a query.
5489
+ Validates a query without running it.</p>
5490
+
5144
5491
 
5145
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-validate.html>`_
5492
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-indices-validate-query>`_
5146
5493
 
5147
5494
  :param index: Comma-separated list of data streams, indices, and aliases to search.
5148
5495
  Supports wildcards (`*`). To search all data streams or indices, omit this