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
@@ -44,14 +44,24 @@ class SnapshotClient(NamespacedClient):
44
44
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
45
45
  ) -> ObjectApiResponse[t.Any]:
46
46
  """
47
- Clean up the snapshot repository. Trigger the review of the contents of a snapshot
48
- repository and delete any stale data not referenced by existing snapshots.
47
+ .. raw:: html
49
48
 
50
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clean-up-snapshot-repo-api.html>`_
49
+ <p>Clean up the snapshot repository.
50
+ Trigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots.</p>
51
51
 
52
- :param name: Snapshot repository to clean up.
53
- :param master_timeout: Period to wait for a connection to the master node.
54
- :param timeout: Period to wait for a response.
52
+
53
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-cleanup-repository>`_
54
+
55
+ :param name: The name of the snapshot repository to clean up.
56
+ :param master_timeout: The period to wait for a connection to the master node.
57
+ If the master node is not available before the timeout expires, the request
58
+ fails and returns an error. To indicate that the request should never timeout,
59
+ set it to `-1`
60
+ :param timeout: The period to wait for a response from all relevant nodes in
61
+ the cluster after updating the cluster metadata. If no response is received
62
+ before the timeout expires, the cluster metadata update still applies but
63
+ the response will indicate that it was not completely acknowledged. To indicate
64
+ that the request should never timeout, set it to `-1`.
55
65
  """
56
66
  if name in SKIP_IN_PATH:
57
67
  raise ValueError("Empty value passed for parameter 'name'")
@@ -95,21 +105,26 @@ class SnapshotClient(NamespacedClient):
95
105
  human: t.Optional[bool] = None,
96
106
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
97
107
  pretty: t.Optional[bool] = None,
98
- timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
99
108
  body: t.Optional[t.Dict[str, t.Any]] = None,
100
109
  ) -> ObjectApiResponse[t.Any]:
101
110
  """
102
- Clone a snapshot. Clone part of all of a snapshot into another snapshot in the
103
- same repository.
111
+ .. raw:: html
104
112
 
105
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clone-snapshot-api.html>`_
113
+ <p>Clone a snapshot.
114
+ Clone part of all of a snapshot into another snapshot in the same repository.</p>
106
115
 
107
- :param repository: A repository name
108
- :param snapshot: The name of the snapshot to clone from
109
- :param target_snapshot: The name of the cloned snapshot to create
110
- :param indices:
111
- :param master_timeout: Explicit operation timeout for connection to master node
112
- :param timeout:
116
+
117
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-clone>`_
118
+
119
+ :param repository: The name of the snapshot repository that both source and target
120
+ snapshot belong to.
121
+ :param snapshot: The source snapshot name.
122
+ :param target_snapshot: The target snapshot name.
123
+ :param indices: A comma-separated list of indices to include in the snapshot.
124
+ Multi-target syntax is supported.
125
+ :param master_timeout: The period to wait for the master node. If the master
126
+ node is not available before the timeout expires, the request fails and returns
127
+ an error. To indicate that the request should never timeout, set it to `-1`.
113
128
  """
114
129
  if repository in SKIP_IN_PATH:
115
130
  raise ValueError("Empty value passed for parameter 'repository'")
@@ -137,8 +152,6 @@ class SnapshotClient(NamespacedClient):
137
152
  __query["master_timeout"] = master_timeout
138
153
  if pretty is not None:
139
154
  __query["pretty"] = pretty
140
- if timeout is not None:
141
- __query["timeout"] = timeout
142
155
  if not __body:
143
156
  if indices is not None:
144
157
  __body["indices"] = indices
@@ -155,6 +168,7 @@ class SnapshotClient(NamespacedClient):
155
168
 
156
169
  @_rewrite_parameters(
157
170
  body_fields=(
171
+ "expand_wildcards",
158
172
  "feature_states",
159
173
  "ignore_unavailable",
160
174
  "include_global_state",
@@ -169,6 +183,14 @@ class SnapshotClient(NamespacedClient):
169
183
  repository: str,
170
184
  snapshot: str,
171
185
  error_trace: t.Optional[bool] = None,
186
+ expand_wildcards: t.Optional[
187
+ t.Union[
188
+ t.Sequence[
189
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
190
+ ],
191
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
192
+ ]
193
+ ] = None,
172
194
  feature_states: t.Optional[t.Sequence[str]] = None,
173
195
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
174
196
  human: t.Optional[bool] = None,
@@ -183,17 +205,28 @@ class SnapshotClient(NamespacedClient):
183
205
  body: t.Optional[t.Dict[str, t.Any]] = None,
184
206
  ) -> ObjectApiResponse[t.Any]:
185
207
  """
186
- Create a snapshot. Take a snapshot of a cluster or of data streams and indices.
208
+ .. raw:: html
187
209
 
188
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/create-snapshot-api.html>`_
210
+ <p>Create a snapshot.
211
+ Take a snapshot of a cluster or of data streams and indices.</p>
189
212
 
190
- :param repository: Repository for the snapshot.
191
- :param snapshot: Name of the snapshot. Must be unique in the repository.
192
- :param feature_states: Feature states to include in the snapshot. Each feature
213
+
214
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-create>`_
215
+
216
+ :param repository: The name of the repository for the snapshot.
217
+ :param snapshot: The name of the snapshot. It supportes date math. It must be
218
+ unique in the repository.
219
+ :param expand_wildcards: Determines how wildcard patterns in the `indices` parameter
220
+ match data streams and indices. It supports comma-separated values such as
221
+ `open,hidden`.
222
+ :param feature_states: The feature states to include in the snapshot. Each feature
193
223
  state includes one or more system indices containing related data. You can
194
224
  view a list of eligible features using the get features API. If `include_global_state`
195
225
  is `true`, all current feature states are included by default. If `include_global_state`
196
- is `false`, no feature states are included by default.
226
+ is `false`, no feature states are included by default. Note that specifying
227
+ an empty array will result in the default behavior. To exclude all feature
228
+ states, regardless of the `include_global_state` value, specify an array
229
+ with only the value `none` (`["none"]`).
197
230
  :param ignore_unavailable: If `true`, the request ignores data streams and indices
198
231
  in `indices` that are missing or closed. If `false`, the request returns
199
232
  an error for any data stream or index that is missing or closed.
@@ -202,18 +235,24 @@ class SnapshotClient(NamespacedClient):
202
235
  composable index templates, legacy index templates, ingest pipelines, and
203
236
  ILM policies. It also includes data stored in system indices, such as Watches
204
237
  and task records (configurable via `feature_states`).
205
- :param indices: Data streams and indices to include in the snapshot. Supports
206
- multi-target syntax. Includes all data streams and indices by default.
207
- :param master_timeout: Period to wait for a connection to the master node. If
208
- no response is received before the timeout expires, the request fails and
209
- returns an error.
210
- :param metadata: Optional metadata for the snapshot. May have any contents. Must
211
- be less than 1024 bytes. This map is not automatically generated by Elasticsearch.
212
- :param partial: If `true`, allows restoring a partial snapshot of indices with
213
- unavailable shards. Only shards that were successfully included in the snapshot
214
- will be restored. All missing shards will be recreated as empty. If `false`,
215
- the entire restore operation will fail if one or more indices included in
216
- the snapshot do not have all primary shards available.
238
+ :param indices: A comma-separated list of data streams and indices to include
239
+ in the snapshot. It supports a multi-target syntax. The default is an empty
240
+ array (`[]`), which includes all regular data streams and regular indices.
241
+ To exclude all data streams and indices, use `-*`. You can't use this parameter
242
+ to include or exclude system indices or system data streams from a snapshot.
243
+ Use `feature_states` instead.
244
+ :param master_timeout: The period to wait for a connection to the master node.
245
+ If no response is received before the timeout expires, the request fails
246
+ and returns an error.
247
+ :param metadata: Arbitrary metadata to the snapshot, such as a record of who
248
+ took the snapshot, why it was taken, or any other useful data. It can have
249
+ any contents but it must be less than 1024 bytes. This information is not
250
+ automatically generated by Elasticsearch.
251
+ :param partial: If `true`, it enables you to restore a partial snapshot of indices
252
+ with unavailable shards. Only shards that were successfully included in the
253
+ snapshot will be restored. All missing shards will be recreated as empty.
254
+ If `false`, the entire restore operation will fail if one or more indices
255
+ included in the snapshot do not have all primary shards available.
217
256
  :param wait_for_completion: If `true`, the request returns a response when the
218
257
  snapshot is complete. If `false`, the request returns a response when the
219
258
  snapshot initializes.
@@ -242,6 +281,8 @@ class SnapshotClient(NamespacedClient):
242
281
  if wait_for_completion is not None:
243
282
  __query["wait_for_completion"] = wait_for_completion
244
283
  if not __body:
284
+ if expand_wildcards is not None:
285
+ __body["expand_wildcards"] = expand_wildcards
245
286
  if feature_states is not None:
246
287
  __body["feature_states"] = feature_states
247
288
  if ignore_unavailable is not None:
@@ -287,19 +328,32 @@ class SnapshotClient(NamespacedClient):
287
328
  verify: t.Optional[bool] = None,
288
329
  ) -> ObjectApiResponse[t.Any]:
289
330
  """
290
- Create or update a snapshot repository. IMPORTANT: If you are migrating searchable
291
- snapshots, the repository name must be identical in the source and destination
292
- clusters. To register a snapshot repository, the cluster's global metadata must
293
- be writeable. Ensure there are no cluster blocks (for example, `cluster.blocks.read_only`
294
- and `clsuter.blocks.read_only_allow_delete` settings) that prevent write access.
331
+ .. raw:: html
332
+
333
+ <p>Create or update a snapshot repository.
334
+ IMPORTANT: If you are migrating searchable snapshots, the repository name must be identical in the source and destination clusters.
335
+ To register a snapshot repository, the cluster's global metadata must be writeable.
336
+ Ensure there are no cluster blocks (for example, <code>cluster.blocks.read_only</code> and <code>clsuter.blocks.read_only_allow_delete</code> settings) that prevent write access.</p>
337
+ <p>Several options for this API can be specified using a query parameter or a request body parameter.
338
+ If both parameters are specified, only the query parameter is used.</p>
295
339
 
296
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html>`_
297
340
 
298
- :param name: A repository name
341
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-create-repository>`_
342
+
343
+ :param name: The name of the snapshot repository to register or update.
299
344
  :param repository:
300
- :param master_timeout: Explicit operation timeout for connection to master node
301
- :param timeout: Explicit operation timeout
302
- :param verify: Whether to verify the repository after creation
345
+ :param master_timeout: The period to wait for the master node. If the master
346
+ node is not available before the timeout expires, the request fails and returns
347
+ an error. To indicate that the request should never timeout, set it to `-1`.
348
+ :param timeout: The period to wait for a response from all relevant nodes in
349
+ the cluster after updating the cluster metadata. If no response is received
350
+ before the timeout expires, the cluster metadata update still applies but
351
+ the response will indicate that it was not completely acknowledged. To indicate
352
+ that the request should never timeout, set it to `-1`.
353
+ :param verify: If `true`, the request verifies the repository is functional on
354
+ all master and data nodes in the cluster. If `false`, this verification is
355
+ skipped. You can also perform this verification with the verify snapshot
356
+ repository API.
303
357
  """
304
358
  if name in SKIP_IN_PATH:
305
359
  raise ValueError("Empty value passed for parameter 'name'")
@@ -351,13 +405,19 @@ class SnapshotClient(NamespacedClient):
351
405
  pretty: t.Optional[bool] = None,
352
406
  ) -> ObjectApiResponse[t.Any]:
353
407
  """
354
- Delete snapshots.
408
+ .. raw:: html
409
+
410
+ <p>Delete snapshots.</p>
411
+
355
412
 
356
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-snapshot-api.html>`_
413
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-delete>`_
357
414
 
358
- :param repository: A repository name
359
- :param snapshot: A comma-separated list of snapshot names
360
- :param master_timeout: Explicit operation timeout for connection to master node
415
+ :param repository: The name of the repository to delete a snapshot from.
416
+ :param snapshot: A comma-separated list of snapshot names to delete. It also
417
+ accepts wildcards (`*`).
418
+ :param master_timeout: The period to wait for the master node. If the master
419
+ node is not available before the timeout expires, the request fails and returns
420
+ an error. To indicate that the request should never timeout, set it to `-1`.
361
421
  """
362
422
  if repository in SKIP_IN_PATH:
363
423
  raise ValueError("Empty value passed for parameter 'repository'")
@@ -402,16 +462,25 @@ class SnapshotClient(NamespacedClient):
402
462
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
403
463
  ) -> ObjectApiResponse[t.Any]:
404
464
  """
405
- Delete snapshot repositories. When a repository is unregistered, Elasticsearch
406
- removes only the reference to the location where the repository is storing the
407
- snapshots. The snapshots themselves are left untouched and in place.
465
+ .. raw:: html
408
466
 
409
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-snapshot-repo-api.html>`_
467
+ <p>Delete snapshot repositories.
468
+ When a repository is unregistered, Elasticsearch removes only the reference to the location where the repository is storing the snapshots.
469
+ The snapshots themselves are left untouched and in place.</p>
410
470
 
411
- :param name: Name of the snapshot repository to unregister. Wildcard (`*`) patterns
412
- are supported.
413
- :param master_timeout: Explicit operation timeout for connection to master node
414
- :param timeout: Explicit operation timeout
471
+
472
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-delete-repository>`_
473
+
474
+ :param name: The ame of the snapshot repositories to unregister. Wildcard (`*`)
475
+ patterns are supported.
476
+ :param master_timeout: The period to wait for the master node. If the master
477
+ node is not available before the timeout expires, the request fails and returns
478
+ an error. To indicate that the request should never timeout, set it to `-1`.
479
+ :param timeout: The period to wait for a response from all relevant nodes in
480
+ the cluster after updating the cluster metadata. If no response is received
481
+ before the timeout expires, the cluster metadata update still applies but
482
+ the response will indicate that it was not completely acknowledged. To indicate
483
+ that the request should never timeout, set it to `-1`.
415
484
  """
416
485
  if name in SKIP_IN_PATH:
417
486
  raise ValueError("Empty value passed for parameter 'name'")
@@ -478,50 +547,67 @@ class SnapshotClient(NamespacedClient):
478
547
  verbose: t.Optional[bool] = None,
479
548
  ) -> ObjectApiResponse[t.Any]:
480
549
  """
481
- Get snapshot information.
482
-
483
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-snapshot-api.html>`_
484
-
485
- :param repository: Comma-separated list of snapshot repository names used to
486
- limit the request. Wildcard (*) expressions are supported.
487
- :param snapshot: Comma-separated list of snapshot names to retrieve. Also accepts
488
- wildcards (*). - To get information about all snapshots in a registered repository,
489
- use a wildcard (*) or _all. - To get information about any snapshots that
490
- are currently running, use _current.
491
- :param after: Offset identifier to start pagination from as returned by the next
492
- field in the response body.
493
- :param from_sort_value: Value of the current sort column at which to start retrieval.
494
- Can either be a string snapshot- or repository name when sorting by snapshot
495
- or repository name, a millisecond time value or a number when sorting by
496
- index- or shard count.
497
- :param ignore_unavailable: If false, the request returns an error for any snapshots
550
+ .. raw:: html
551
+
552
+ <p>Get snapshot information.</p>
553
+ <p>NOTE: The <code>after</code> parameter and <code>next</code> field enable you to iterate through snapshots with some consistency guarantees regarding concurrent creation or deletion of snapshots.
554
+ It is guaranteed that any snapshot that exists at the beginning of the iteration and is not concurrently deleted will be seen during the iteration.
555
+ Snapshots concurrently created may be seen during an iteration.</p>
556
+
557
+
558
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-get>`_
559
+
560
+ :param repository: A comma-separated list of snapshot repository names used to
561
+ limit the request. Wildcard (`*`) expressions are supported.
562
+ :param snapshot: A comma-separated list of snapshot names to retrieve Wildcards
563
+ (`*`) are supported. * To get information about all snapshots in a registered
564
+ repository, use a wildcard (`*`) or `_all`. * To get information about any
565
+ snapshots that are currently running, use `_current`.
566
+ :param after: An offset identifier to start pagination from as returned by the
567
+ next field in the response body.
568
+ :param from_sort_value: The value of the current sort column at which to start
569
+ retrieval. It can be a string `snapshot-` or a repository name when sorting
570
+ by snapshot or repository name. It can be a millisecond time value or a number
571
+ when sorting by `index-` or shard count.
572
+ :param ignore_unavailable: If `false`, the request returns an error for any snapshots
498
573
  that are unavailable.
499
- :param include_repository: If true, returns the repository name in each snapshot.
500
- :param index_details: If true, returns additional information about each index
501
- in the snapshot comprising the number of shards in the index, the total size
502
- of the index in bytes, and the maximum number of segments per shard in the
503
- index. Defaults to false, meaning that this information is omitted.
504
- :param index_names: If true, returns the name of each index in each snapshot.
505
- :param master_timeout: Period to wait for a connection to the master node. If
506
- no response is received before the timeout expires, the request fails and
507
- returns an error.
574
+ :param include_repository: If `true`, the response includes the repository name
575
+ in each snapshot.
576
+ :param index_details: If `true`, the response includes additional information
577
+ about each index in the snapshot comprising the number of shards in the index,
578
+ the total size of the index in bytes, and the maximum number of segments
579
+ per shard in the index. The default is `false`, meaning that this information
580
+ is omitted.
581
+ :param index_names: If `true`, the response includes the name of each index in
582
+ each snapshot.
583
+ :param master_timeout: The period to wait for a connection to the master node.
584
+ If no response is received before the timeout expires, the request fails
585
+ and returns an error.
508
586
  :param offset: Numeric offset to start pagination from based on the snapshots
509
587
  matching this request. Using a non-zero value for this parameter is mutually
510
588
  exclusive with using the after parameter. Defaults to 0.
511
- :param order: Sort order. Valid values are asc for ascending and desc for descending
512
- order. Defaults to asc, meaning ascending order.
513
- :param size: Maximum number of snapshots to return. Defaults to 0 which means
514
- return all that match the request without limit.
515
- :param slm_policy_filter: Filter snapshots by a comma-separated list of SLM policy
516
- names that snapshots belong to. Also accepts wildcards (*) and combinations
517
- of wildcards followed by exclude patterns starting with -. To include snapshots
518
- not created by an SLM policy you can use the special pattern _none that will
519
- match all snapshots without an SLM policy.
520
- :param sort: Allows setting a sort order for the result. Defaults to start_time,
521
- i.e. sorting by snapshot start time stamp.
522
- :param verbose: If true, returns additional information about each snapshot such
523
- as the version of Elasticsearch which took the snapshot, the start and end
524
- times of the snapshot, and the number of shards snapshotted.
589
+ :param order: The sort order. Valid values are `asc` for ascending and `desc`
590
+ for descending order. The default behavior is ascending order.
591
+ :param size: The maximum number of snapshots to return. The default is 0, which
592
+ means to return all that match the request without limit.
593
+ :param slm_policy_filter: Filter snapshots by a comma-separated list of snapshot
594
+ lifecycle management (SLM) policy names that snapshots belong to. You can
595
+ use wildcards (`*`) and combinations of wildcards followed by exclude patterns
596
+ starting with `-`. For example, the pattern `*,-policy-a-\\*` will return
597
+ all snapshots except for those that were created by an SLM policy with a
598
+ name starting with `policy-a-`. Note that the wildcard pattern `*` matches
599
+ all snapshots created by an SLM policy but not those snapshots that were
600
+ not created by an SLM policy. To include snapshots that were not created
601
+ by an SLM policy, you can use the special pattern `_none` that will match
602
+ all snapshots without an SLM policy.
603
+ :param sort: The sort order for the result. The default behavior is sorting by
604
+ snapshot start time stamp.
605
+ :param verbose: If `true`, returns additional information about each snapshot
606
+ such as the version of Elasticsearch which took the snapshot, the start and
607
+ end times of the snapshot, and the number of shards snapshotted. NOTE: The
608
+ parameters `size`, `order`, `after`, `from_sort_value`, `offset`, `slm_policy_filter`,
609
+ and `sort` are not supported when you set `verbose=false` and the sort order
610
+ for requests with `verbose=false` is undefined.
525
611
  """
526
612
  if repository in SKIP_IN_PATH:
527
613
  raise ValueError("Empty value passed for parameter 'repository'")
@@ -590,14 +676,23 @@ class SnapshotClient(NamespacedClient):
590
676
  pretty: t.Optional[bool] = None,
591
677
  ) -> ObjectApiResponse[t.Any]:
592
678
  """
593
- Get snapshot repository information.
679
+ .. raw:: html
680
+
681
+ <p>Get snapshot repository information.</p>
682
+
594
683
 
595
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-snapshot-repo-api.html>`_
684
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-get-repository>`_
596
685
 
597
- :param name: A comma-separated list of repository names
598
- :param local: Return local information, do not retrieve the state from master
599
- node (default: false)
600
- :param master_timeout: Explicit operation timeout for connection to master node
686
+ :param name: A comma-separated list of snapshot repository names used to limit
687
+ the request. Wildcard (`*`) expressions are supported including combining
688
+ wildcards with exclude patterns starting with `-`. To get information about
689
+ all snapshot repositories registered in the cluster, omit this parameter
690
+ or use `*` or `_all`.
691
+ :param local: If `true`, the request gets information from the local node only.
692
+ If `false`, the request gets information from the master node.
693
+ :param master_timeout: The period to wait for the master node. If the master
694
+ node is not available before the timeout expires, the request fails and returns
695
+ an error. To indicate that the request should never timeout, set it to `-1`.
601
696
  """
602
697
  __path_parts: t.Dict[str, str]
603
698
  if name not in SKIP_IN_PATH:
@@ -652,122 +747,85 @@ class SnapshotClient(NamespacedClient):
652
747
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
653
748
  ) -> ObjectApiResponse[t.Any]:
654
749
  """
655
- Analyze a snapshot repository. Analyze the performance characteristics and any
656
- incorrect behaviour found in a repository. The response exposes implementation
657
- details of the analysis which may change from version to version. The response
658
- body format is therefore not considered stable and may be different in newer
659
- versions. There are a large number of third-party storage systems available,
660
- not all of which are suitable for use as a snapshot repository by Elasticsearch.
661
- Some storage systems behave incorrectly, or perform poorly, especially when accessed
662
- concurrently by multiple clients as the nodes of an Elasticsearch cluster do.
663
- This API performs a collection of read and write operations on your repository
664
- which are designed to detect incorrect behaviour and to measure the performance
665
- characteristics of your storage system. The default values for the parameters
666
- are deliberately low to reduce the impact of running an analysis inadvertently
667
- and to provide a sensible starting point for your investigations. Run your first
668
- analysis with the default parameter values to check for simple problems. If successful,
669
- run a sequence of increasingly large analyses until you encounter a failure or
670
- you reach a `blob_count` of at least `2000`, a `max_blob_size` of at least `2gb`,
671
- a `max_total_data_size` of at least `1tb`, and a `register_operation_count` of
672
- at least `100`. Always specify a generous timeout, possibly `1h` or longer, to
673
- allow time for each analysis to run to completion. Perform the analyses using
674
- a multi-node cluster of a similar size to your production cluster so that it
675
- can detect any problems that only arise when the repository is accessed by many
676
- nodes at once. If the analysis fails, Elasticsearch detected that your repository
677
- behaved unexpectedly. This usually means you are using a third-party storage
678
- system with an incorrect or incompatible implementation of the API it claims
679
- to support. If so, this storage system is not suitable for use as a snapshot
680
- repository. You will need to work with the supplier of your storage system to
681
- address the incompatibilities that Elasticsearch detects. If the analysis is
682
- successful, the API returns details of the testing process, optionally including
683
- how long each operation took. You can use this information to determine the performance
684
- of your storage system. If any operation fails or returns an incorrect result,
685
- the API returns an error. If the API returns an error, it may not have removed
686
- all the data it wrote to the repository. The error will indicate the location
687
- of any leftover data and this path is also recorded in the Elasticsearch logs.
688
- You should verify that this location has been cleaned up correctly. If there
689
- is still leftover data at the specified location, you should manually remove
690
- it. If the connection from your client to Elasticsearch is closed while the client
691
- is waiting for the result of the analysis, the test is cancelled. Some clients
692
- are configured to close their connection if no response is received within a
693
- certain timeout. An analysis takes a long time to complete so you might need
694
- to relax any such client-side timeouts. On cancellation the analysis attempts
695
- to clean up the data it was writing, but it may not be able to remove it all.
696
- The path to the leftover data is recorded in the Elasticsearch logs. You should
697
- verify that this location has been cleaned up correctly. If there is still leftover
698
- data at the specified location, you should manually remove it. If the analysis
699
- is successful then it detected no incorrect behaviour, but this does not mean
700
- that correct behaviour is guaranteed. The analysis attempts to detect common
701
- bugs but it does not offer 100% coverage. Additionally, it does not test the
702
- following: * Your repository must perform durable writes. Once a blob has been
703
- written it must remain in place until it is deleted, even after a power loss
704
- or similar disaster. * Your repository must not suffer from silent data corruption.
705
- Once a blob has been written, its contents must remain unchanged until it is
706
- deliberately modified or deleted. * Your repository must behave correctly even
707
- if connectivity from the cluster is disrupted. Reads and writes may fail in this
708
- case, but they must not return incorrect results. IMPORTANT: An analysis writes
709
- a substantial amount of data to your repository and then reads it back again.
710
- This consumes bandwidth on the network between the cluster and the repository,
711
- and storage space and I/O bandwidth on the repository itself. You must ensure
712
- this load does not affect other users of these systems. Analyses respect the
713
- repository settings `max_snapshot_bytes_per_sec` and `max_restore_bytes_per_sec`
714
- if available and the cluster setting `indices.recovery.max_bytes_per_sec` which
715
- you can use to limit the bandwidth they consume. NOTE: This API is intended for
716
- exploratory use by humans. You should expect the request parameters and the response
717
- format to vary in future versions. NOTE: Different versions of Elasticsearch
718
- may perform different checks for repository compatibility, with newer versions
719
- typically being stricter than older ones. A storage system that passes repository
720
- analysis with one version of Elasticsearch may fail with a different version.
721
- This indicates it behaves incorrectly in ways that the former version did not
722
- detect. You must work with the supplier of your storage system to address the
723
- incompatibilities detected by the repository analysis API in any version of Elasticsearch.
724
- NOTE: This API may not work correctly in a mixed-version cluster. *Implementation
725
- details* NOTE: This section of documentation describes how the repository analysis
726
- API works in this version of Elasticsearch, but you should expect the implementation
727
- to vary between versions. The request parameters and response format depend on
728
- details of the implementation so may also be different in newer versions. The
729
- analysis comprises a number of blob-level tasks, as set by the `blob_count` parameter
730
- and a number of compare-and-exchange operations on linearizable registers, as
731
- set by the `register_operation_count` parameter. These tasks are distributed
732
- over the data and master-eligible nodes in the cluster for execution. For most
733
- blob-level tasks, the executing node first writes a blob to the repository and
734
- then instructs some of the other nodes in the cluster to attempt to read the
735
- data it just wrote. The size of the blob is chosen randomly, according to the
736
- `max_blob_size` and `max_total_data_size` parameters. If any of these reads fails
737
- then the repository does not implement the necessary read-after-write semantics
738
- that Elasticsearch requires. For some blob-level tasks, the executing node will
739
- instruct some of its peers to attempt to read the data before the writing process
740
- completes. These reads are permitted to fail, but must not return partial data.
741
- If any read returns partial data then the repository does not implement the necessary
742
- atomicity semantics that Elasticsearch requires. For some blob-level tasks, the
743
- executing node will overwrite the blob while its peers are reading it. In this
744
- case the data read may come from either the original or the overwritten blob,
745
- but the read operation must not return partial data or a mix of data from the
746
- two blobs. If any of these reads returns partial data or a mix of the two blobs
747
- then the repository does not implement the necessary atomicity semantics that
748
- Elasticsearch requires for overwrites. The executing node will use a variety
749
- of different methods to write the blob. For instance, where applicable, it will
750
- use both single-part and multi-part uploads. Similarly, the reading nodes will
751
- use a variety of different methods to read the data back again. For instance
752
- they may read the entire blob from start to end or may read only a subset of
753
- the data. For some blob-level tasks, the executing node will cancel the write
754
- before it is complete. In this case, it still instructs some of the other nodes
755
- in the cluster to attempt to read the blob but all of these reads must fail to
756
- find the blob. Linearizable registers are special blobs that Elasticsearch manipulates
757
- using an atomic compare-and-exchange operation. This operation ensures correct
758
- and strongly-consistent behavior even when the blob is accessed by multiple nodes
759
- at the same time. The detailed implementation of the compare-and-exchange operation
760
- on linearizable registers varies by repository type. Repository analysis verifies
761
- that that uncontended compare-and-exchange operations on a linearizable register
762
- blob always succeed. Repository analysis also verifies that contended operations
763
- either succeed or report the contention but do not return incorrect results.
764
- If an operation fails due to contention, Elasticsearch retries the operation
765
- until it succeeds. Most of the compare-and-exchange operations performed by repository
766
- analysis atomically increment a counter which is represented as an 8-byte blob.
767
- Some operations also verify the behavior on small blobs with sizes other than
768
- 8 bytes.
769
-
770
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/repo-analysis-api.html>`_
750
+ .. raw:: html
751
+
752
+ <p>Analyze a snapshot repository.
753
+ Analyze the performance characteristics and any incorrect behaviour found in a repository.</p>
754
+ <p>The response exposes implementation details of the analysis which may change from version to version.
755
+ The response body format is therefore not considered stable and may be different in newer versions.</p>
756
+ <p>There are a large number of third-party storage systems available, not all of which are suitable for use as a snapshot repository by Elasticsearch.
757
+ Some storage systems behave incorrectly, or perform poorly, especially when accessed concurrently by multiple clients as the nodes of an Elasticsearch cluster do. This API performs a collection of read and write operations on your repository which are designed to detect incorrect behaviour and to measure the performance characteristics of your storage system.</p>
758
+ <p>The default values for the parameters are deliberately low to reduce the impact of running an analysis inadvertently and to provide a sensible starting point for your investigations.
759
+ Run your first analysis with the default parameter values to check for simple problems.
760
+ If successful, run a sequence of increasingly large analyses until you encounter a failure or you reach a <code>blob_count</code> of at least <code>2000</code>, a <code>max_blob_size</code> of at least <code>2gb</code>, a <code>max_total_data_size</code> of at least <code>1tb</code>, and a <code>register_operation_count</code> of at least <code>100</code>.
761
+ Always specify a generous timeout, possibly <code>1h</code> or longer, to allow time for each analysis to run to completion.
762
+ Perform the analyses using a multi-node cluster of a similar size to your production cluster so that it can detect any problems that only arise when the repository is accessed by many nodes at once.</p>
763
+ <p>If the analysis fails, Elasticsearch detected that your repository behaved unexpectedly.
764
+ This usually means you are using a third-party storage system with an incorrect or incompatible implementation of the API it claims to support.
765
+ If so, this storage system is not suitable for use as a snapshot repository.
766
+ You will need to work with the supplier of your storage system to address the incompatibilities that Elasticsearch detects.</p>
767
+ <p>If the analysis is successful, the API returns details of the testing process, optionally including how long each operation took.
768
+ You can use this information to determine the performance of your storage system.
769
+ If any operation fails or returns an incorrect result, the API returns an error.
770
+ If the API returns an error, it may not have removed all the data it wrote to the repository.
771
+ The error will indicate the location of any leftover data and this path is also recorded in the Elasticsearch logs.
772
+ You should verify that this location has been cleaned up correctly.
773
+ If there is still leftover data at the specified location, you should manually remove it.</p>
774
+ <p>If the connection from your client to Elasticsearch is closed while the client is waiting for the result of the analysis, the test is cancelled.
775
+ Some clients are configured to close their connection if no response is received within a certain timeout.
776
+ An analysis takes a long time to complete so you might need to relax any such client-side timeouts.
777
+ On cancellation the analysis attempts to clean up the data it was writing, but it may not be able to remove it all.
778
+ The path to the leftover data is recorded in the Elasticsearch logs.
779
+ You should verify that this location has been cleaned up correctly.
780
+ If there is still leftover data at the specified location, you should manually remove it.</p>
781
+ <p>If the analysis is successful then it detected no incorrect behaviour, but this does not mean that correct behaviour is guaranteed.
782
+ The analysis attempts to detect common bugs but it does not offer 100% coverage.
783
+ Additionally, it does not test the following:</p>
784
+ <ul>
785
+ <li>Your repository must perform durable writes. Once a blob has been written it must remain in place until it is deleted, even after a power loss or similar disaster.</li>
786
+ <li>Your repository must not suffer from silent data corruption. Once a blob has been written, its contents must remain unchanged until it is deliberately modified or deleted.</li>
787
+ <li>Your repository must behave correctly even if connectivity from the cluster is disrupted. Reads and writes may fail in this case, but they must not return incorrect results.</li>
788
+ </ul>
789
+ <p>IMPORTANT: An analysis writes a substantial amount of data to your repository and then reads it back again.
790
+ This consumes bandwidth on the network between the cluster and the repository, and storage space and I/O bandwidth on the repository itself.
791
+ You must ensure this load does not affect other users of these systems.
792
+ Analyses respect the repository settings <code>max_snapshot_bytes_per_sec</code> and <code>max_restore_bytes_per_sec</code> if available and the cluster setting <code>indices.recovery.max_bytes_per_sec</code> which you can use to limit the bandwidth they consume.</p>
793
+ <p>NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.</p>
794
+ <p>NOTE: Different versions of Elasticsearch may perform different checks for repository compatibility, with newer versions typically being stricter than older ones.
795
+ A storage system that passes repository analysis with one version of Elasticsearch may fail with a different version.
796
+ This indicates it behaves incorrectly in ways that the former version did not detect.
797
+ You must work with the supplier of your storage system to address the incompatibilities detected by the repository analysis API in any version of Elasticsearch.</p>
798
+ <p>NOTE: This API may not work correctly in a mixed-version cluster.</p>
799
+ <p><em>Implementation details</em></p>
800
+ <p>NOTE: This section of documentation describes how the repository analysis API works in this version of Elasticsearch, but you should expect the implementation to vary between versions. The request parameters and response format depend on details of the implementation so may also be different in newer versions.</p>
801
+ <p>The analysis comprises a number of blob-level tasks, as set by the <code>blob_count</code> parameter and a number of compare-and-exchange operations on linearizable registers, as set by the <code>register_operation_count</code> parameter.
802
+ These tasks are distributed over the data and master-eligible nodes in the cluster for execution.</p>
803
+ <p>For most blob-level tasks, the executing node first writes a blob to the repository and then instructs some of the other nodes in the cluster to attempt to read the data it just wrote.
804
+ The size of the blob is chosen randomly, according to the <code>max_blob_size</code> and <code>max_total_data_size</code> parameters.
805
+ If any of these reads fails then the repository does not implement the necessary read-after-write semantics that Elasticsearch requires.</p>
806
+ <p>For some blob-level tasks, the executing node will instruct some of its peers to attempt to read the data before the writing process completes.
807
+ These reads are permitted to fail, but must not return partial data.
808
+ If any read returns partial data then the repository does not implement the necessary atomicity semantics that Elasticsearch requires.</p>
809
+ <p>For some blob-level tasks, the executing node will overwrite the blob while its peers are reading it.
810
+ In this case the data read may come from either the original or the overwritten blob, but the read operation must not return partial data or a mix of data from the two blobs.
811
+ If any of these reads returns partial data or a mix of the two blobs then the repository does not implement the necessary atomicity semantics that Elasticsearch requires for overwrites.</p>
812
+ <p>The executing node will use a variety of different methods to write the blob.
813
+ For instance, where applicable, it will use both single-part and multi-part uploads.
814
+ Similarly, the reading nodes will use a variety of different methods to read the data back again.
815
+ For instance they may read the entire blob from start to end or may read only a subset of the data.</p>
816
+ <p>For some blob-level tasks, the executing node will cancel the write before it is complete.
817
+ In this case, it still instructs some of the other nodes in the cluster to attempt to read the blob but all of these reads must fail to find the blob.</p>
818
+ <p>Linearizable registers are special blobs that Elasticsearch manipulates using an atomic compare-and-exchange operation.
819
+ This operation ensures correct and strongly-consistent behavior even when the blob is accessed by multiple nodes at the same time.
820
+ The detailed implementation of the compare-and-exchange operation on linearizable registers varies by repository type.
821
+ Repository analysis verifies that that uncontended compare-and-exchange operations on a linearizable register blob always succeed.
822
+ Repository analysis also verifies that contended operations either succeed or report the contention but do not return incorrect results.
823
+ If an operation fails due to contention, Elasticsearch retries the operation until it succeeds.
824
+ Most of the compare-and-exchange operations performed by repository analysis atomically increment a counter which is represented as an 8-byte blob.
825
+ Some operations also verify the behavior on small blobs with sizes other than 8 bytes.</p>
826
+
827
+
828
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-repository-analyze>`_
771
829
 
772
830
  :param name: The name of the repository.
773
831
  :param blob_count: The total number of blobs to write to the repository during
@@ -868,54 +926,63 @@ class SnapshotClient(NamespacedClient):
868
926
  verify_blob_contents: t.Optional[bool] = None,
869
927
  ) -> ObjectApiResponse[t.Any]:
870
928
  """
871
- Verify the repository integrity. Verify the integrity of the contents of a snapshot
872
- repository. This API enables you to perform a comprehensive check of the contents
873
- of a repository, looking for any anomalies in its data or metadata which might
874
- prevent you from restoring snapshots from the repository or which might cause
875
- future snapshot create or delete operations to fail. If you suspect the integrity
876
- of the contents of one of your snapshot repositories, cease all write activity
877
- to this repository immediately, set its `read_only` option to `true`, and use
878
- this API to verify its integrity. Until you do so: * It may not be possible to
879
- restore some snapshots from this repository. * Searchable snapshots may report
880
- errors when searched or may have unassigned shards. * Taking snapshots into this
881
- repository may fail or may appear to succeed but have created a snapshot which
882
- cannot be restored. * Deleting snapshots from this repository may fail or may
883
- appear to succeed but leave the underlying data on disk. * Continuing to write
884
- to the repository while it is in an invalid state may causing additional damage
885
- to its contents. If the API finds any problems with the integrity of the contents
886
- of your repository, Elasticsearch will not be able to repair the damage. The
887
- only way to bring the repository back into a fully working state after its contents
888
- have been damaged is by restoring its contents from a repository backup which
889
- was taken before the damage occurred. You must also identify what caused the
890
- damage and take action to prevent it from happening again. If you cannot restore
891
- a repository backup, register a new repository and use this for all future snapshot
892
- operations. In some cases it may be possible to recover some of the contents
893
- of a damaged repository, either by restoring as many of its snapshots as needed
894
- and taking new snapshots of the restored data, or by using the reindex API to
895
- copy data from any searchable snapshots mounted from the damaged repository.
896
- Avoid all operations which write to the repository while the verify repository
897
- integrity API is running. If something changes the repository contents while
898
- an integrity verification is running then Elasticsearch may incorrectly report
899
- having detected some anomalies in its contents due to the concurrent writes.
900
- It may also incorrectly fail to report some anomalies that the concurrent writes
901
- prevented it from detecting. NOTE: This API is intended for exploratory use by
902
- humans. You should expect the request parameters and the response format to vary
903
- in future versions. NOTE: This API may not work correctly in a mixed-version
904
- cluster.
905
-
906
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/verify-repo-integrity-api.html>`_
907
-
908
- :param name: A repository name
909
- :param blob_thread_pool_concurrency: Number of threads to use for reading blob
910
- contents
911
- :param index_snapshot_verification_concurrency: Number of snapshots to verify
912
- concurrently within each index
913
- :param index_verification_concurrency: Number of indices to verify concurrently
914
- :param max_bytes_per_sec: Rate limit for individual blob verification
915
- :param max_failed_shard_snapshots: Maximum permitted number of failed shard snapshots
916
- :param meta_thread_pool_concurrency: Number of threads to use for reading metadata
917
- :param snapshot_verification_concurrency: Number of snapshots to verify concurrently
918
- :param verify_blob_contents: Whether to verify the contents of individual blobs
929
+ .. raw:: html
930
+
931
+ <p>Verify the repository integrity.
932
+ Verify the integrity of the contents of a snapshot repository.</p>
933
+ <p>This API enables you to perform a comprehensive check of the contents of a repository, looking for any anomalies in its data or metadata which might prevent you from restoring snapshots from the repository or which might cause future snapshot create or delete operations to fail.</p>
934
+ <p>If you suspect the integrity of the contents of one of your snapshot repositories, cease all write activity to this repository immediately, set its <code>read_only</code> option to <code>true</code>, and use this API to verify its integrity.
935
+ Until you do so:</p>
936
+ <ul>
937
+ <li>It may not be possible to restore some snapshots from this repository.</li>
938
+ <li>Searchable snapshots may report errors when searched or may have unassigned shards.</li>
939
+ <li>Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.</li>
940
+ <li>Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.</li>
941
+ <li>Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.</li>
942
+ </ul>
943
+ <p>If the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage.
944
+ The only way to bring the repository back into a fully working state after its contents have been damaged is by restoring its contents from a repository backup which was taken before the damage occurred.
945
+ You must also identify what caused the damage and take action to prevent it from happening again.</p>
946
+ <p>If you cannot restore a repository backup, register a new repository and use this for all future snapshot operations.
947
+ In some cases it may be possible to recover some of the contents of a damaged repository, either by restoring as many of its snapshots as needed and taking new snapshots of the restored data, or by using the reindex API to copy data from any searchable snapshots mounted from the damaged repository.</p>
948
+ <p>Avoid all operations which write to the repository while the verify repository integrity API is running.
949
+ If something changes the repository contents while an integrity verification is running then Elasticsearch may incorrectly report having detected some anomalies in its contents due to the concurrent writes.
950
+ It may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.</p>
951
+ <p>NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.</p>
952
+ <p>NOTE: This API may not work correctly in a mixed-version cluster.</p>
953
+ <p>The default values for the parameters of this API are designed to limit the impact of the integrity verification on other activities in your cluster.
954
+ For instance, by default it will only use at most half of the <code>snapshot_meta</code> threads to verify the integrity of each snapshot, allowing other snapshot operations to use the other half of this thread pool.
955
+ If you modify these parameters to speed up the verification process, you risk disrupting other snapshot-related operations in your cluster.
956
+ For large repositories, consider setting up a separate single-node Elasticsearch cluster just for running the integrity verification API.</p>
957
+ <p>The response exposes implementation details of the analysis which may change from version to version.
958
+ The response body format is therefore not considered stable and may be different in newer versions.</p>
959
+
960
+
961
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-repository-verify-integrity>`_
962
+
963
+ :param name: The name of the snapshot repository.
964
+ :param blob_thread_pool_concurrency: If `verify_blob_contents` is `true`, this
965
+ parameter specifies how many blobs to verify at once.
966
+ :param index_snapshot_verification_concurrency: The maximum number of index snapshots
967
+ to verify concurrently within each index verification.
968
+ :param index_verification_concurrency: The number of indices to verify concurrently.
969
+ The default behavior is to use the entire `snapshot_meta` thread pool.
970
+ :param max_bytes_per_sec: If `verify_blob_contents` is `true`, this parameter
971
+ specifies the maximum amount of data that Elasticsearch will read from the
972
+ repository every second.
973
+ :param max_failed_shard_snapshots: The number of shard snapshot failures to track
974
+ during integrity verification, in order to avoid excessive resource usage.
975
+ If your repository contains more than this number of shard snapshot failures,
976
+ the verification will fail.
977
+ :param meta_thread_pool_concurrency: The maximum number of snapshot metadata
978
+ operations to run concurrently. The default behavior is to use at most half
979
+ of the `snapshot_meta` thread pool at once.
980
+ :param snapshot_verification_concurrency: The number of snapshots to verify concurrently.
981
+ The default behavior is to use at most half of the `snapshot_meta` thread
982
+ pool at once.
983
+ :param verify_blob_contents: Indicates whether to verify the checksum of every
984
+ data blob in the repository. If this feature is enabled, Elasticsearch will
985
+ read the entire repository contents, which may be extremely slow and expensive.
919
986
  """
920
987
  if name in SKIP_IN_PATH:
921
988
  raise ValueError("Empty value passed for parameter 'name'")
@@ -998,38 +1065,81 @@ class SnapshotClient(NamespacedClient):
998
1065
  body: t.Optional[t.Dict[str, t.Any]] = None,
999
1066
  ) -> ObjectApiResponse[t.Any]:
1000
1067
  """
1001
- Restore a snapshot. Restore a snapshot of a cluster or data streams and indices.
1002
- You can restore a snapshot only to a running cluster with an elected master node.
1003
- The snapshot repository must be registered and available to the cluster. The
1004
- snapshot and cluster versions must be compatible. To restore a snapshot, the
1005
- cluster's global metadata must be writable. Ensure there are't any cluster blocks
1006
- that prevent writes. The restore operation ignores index blocks. Before you restore
1007
- a data stream, ensure the cluster contains a matching index template with data
1008
- streams enabled. To check, use the index management feature in Kibana or the
1009
- get index template API: ``` GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream
1010
- ``` If no such template exists, you can create one or restore a cluster state
1011
- that contains one. Without a matching index template, a data stream can't roll
1012
- over or create backing indices. If your snapshot contains data from App Search
1013
- or Workplace Search, you must restore the Enterprise Search encryption key before
1014
- you restore the snapshot.
1015
-
1016
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/restore-snapshot-api.html>`_
1017
-
1018
- :param repository: A repository name
1019
- :param snapshot: A snapshot name
1020
- :param feature_states:
1021
- :param ignore_index_settings:
1022
- :param ignore_unavailable:
1023
- :param include_aliases:
1024
- :param include_global_state:
1025
- :param index_settings:
1026
- :param indices:
1027
- :param master_timeout: Explicit operation timeout for connection to master node
1028
- :param partial:
1029
- :param rename_pattern:
1030
- :param rename_replacement:
1031
- :param wait_for_completion: Should this request wait until the operation has
1032
- completed before returning
1068
+ .. raw:: html
1069
+
1070
+ <p>Restore a snapshot.
1071
+ Restore a snapshot of a cluster or data streams and indices.</p>
1072
+ <p>You can restore a snapshot only to a running cluster with an elected master node.
1073
+ The snapshot repository must be registered and available to the cluster.
1074
+ The snapshot and cluster versions must be compatible.</p>
1075
+ <p>To restore a snapshot, the cluster's global metadata must be writable. Ensure there are't any cluster blocks that prevent writes. The restore operation ignores index blocks.</p>
1076
+ <p>Before you restore a data stream, ensure the cluster contains a matching index template with data streams enabled. To check, use the index management feature in Kibana or the get index template API:</p>
1077
+ <pre><code>GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream
1078
+ </code></pre>
1079
+ <p>If no such template exists, you can create one or restore a cluster state that contains one. Without a matching index template, a data stream can't roll over or create backing indices.</p>
1080
+ <p>If your snapshot contains data from App Search or Workplace Search, you must restore the Enterprise Search encryption key before you restore the snapshot.</p>
1081
+
1082
+
1083
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-restore>`_
1084
+
1085
+ :param repository: The name of the repository to restore a snapshot from.
1086
+ :param snapshot: The name of the snapshot to restore.
1087
+ :param feature_states: The feature states to restore. If `include_global_state`
1088
+ is `true`, the request restores all feature states in the snapshot by default.
1089
+ If `include_global_state` is `false`, the request restores no feature states
1090
+ by default. Note that specifying an empty array will result in the default
1091
+ behavior. To restore no feature states, regardless of the `include_global_state`
1092
+ value, specify an array containing only the value `none` (`["none"]`).
1093
+ :param ignore_index_settings: The index settings to not restore from the snapshot.
1094
+ You can't use this option to ignore `index.number_of_shards`. For data streams,
1095
+ this option applies only to restored backing indices. New backing indices
1096
+ are configured using the data stream's matching index template.
1097
+ :param ignore_unavailable: If `true`, the request ignores any index or data stream
1098
+ in indices that's missing from the snapshot. If `false`, the request returns
1099
+ an error for any missing index or data stream.
1100
+ :param include_aliases: If `true`, the request restores aliases for any restored
1101
+ data streams and indices. If `false`, the request doesn’t restore aliases.
1102
+ :param include_global_state: If `true`, restore the cluster state. The cluster
1103
+ state includes: * Persistent cluster settings * Index templates * Legacy
1104
+ index templates * Ingest pipelines * Index lifecycle management (ILM) policies
1105
+ * Stored scripts * For snapshots taken after 7.12.0, feature states If `include_global_state`
1106
+ is `true`, the restore operation merges the legacy index templates in your
1107
+ cluster with the templates contained in the snapshot, replacing any existing
1108
+ ones whose name matches one in the snapshot. It completely removes all persistent
1109
+ settings, non-legacy index templates, ingest pipelines, and ILM lifecycle
1110
+ policies that exist in your cluster and replaces them with the corresponding
1111
+ items from the snapshot. Use the `feature_states` parameter to configure
1112
+ how feature states are restored. If `include_global_state` is `true` and
1113
+ a snapshot was created without a global state then the restore request will
1114
+ fail.
1115
+ :param index_settings: Index settings to add or change in restored indices, including
1116
+ backing indices. You can't use this option to change `index.number_of_shards`.
1117
+ For data streams, this option applies only to restored backing indices. New
1118
+ backing indices are configured using the data stream's matching index template.
1119
+ :param indices: A comma-separated list of indices and data streams to restore.
1120
+ It supports a multi-target syntax. The default behavior is all regular indices
1121
+ and regular data streams in the snapshot. You can't use this parameter to
1122
+ restore system indices or system data streams. Use `feature_states` instead.
1123
+ :param master_timeout: The period to wait for the master node. If the master
1124
+ node is not available before the timeout expires, the request fails and returns
1125
+ an error. To indicate that the request should never timeout, set it to `-1`.
1126
+ :param partial: If `false`, the entire restore operation will fail if one or
1127
+ more indices included in the snapshot do not have all primary shards available.
1128
+ If true, it allows restoring a partial snapshot of indices with unavailable
1129
+ shards. Only shards that were successfully included in the snapshot will
1130
+ be restored. All missing shards will be recreated as empty.
1131
+ :param rename_pattern: A rename pattern to apply to restored data streams and
1132
+ indices. Data streams and indices matching the rename pattern will be renamed
1133
+ according to `rename_replacement`. The rename pattern is applied as defined
1134
+ by the regular expression that supports referencing the original text, according
1135
+ to the `appendReplacement` logic.
1136
+ :param rename_replacement: The rename replacement string that is used with the
1137
+ `rename_pattern`.
1138
+ :param wait_for_completion: If `true`, the request returns a response when the
1139
+ restore operation completes. The operation is complete when it finishes all
1140
+ attempts to recover primary shards for restored indices. This applies even
1141
+ if one or more of the recovery attempts fail. If `false`, the request returns
1142
+ a response when the restore operation initializes.
1033
1143
  """
1034
1144
  if repository in SKIP_IN_PATH:
1035
1145
  raise ValueError("Empty value passed for parameter 'repository'")
@@ -1104,26 +1214,34 @@ class SnapshotClient(NamespacedClient):
1104
1214
  pretty: t.Optional[bool] = None,
1105
1215
  ) -> ObjectApiResponse[t.Any]:
1106
1216
  """
1107
- Get the snapshot status. Get a detailed description of the current state for
1108
- each shard participating in the snapshot. Note that this API should be used only
1109
- to obtain detailed shard-level information for ongoing snapshots. If this detail
1110
- is not needed or you want to obtain information about one or more existing snapshots,
1111
- use the get snapshot API. WARNING: Using the API to return the status of any
1112
- snapshots other than currently running snapshots can be expensive. The API requires
1113
- a read from the repository for each shard in each snapshot. For example, if you
1114
- have 100 snapshots with 1,000 shards each, an API request that includes all snapshots
1115
- will require 100,000 reads (100 snapshots x 1,000 shards). Depending on the latency
1116
- of your storage, such requests can take an extremely long time to return results.
1117
- These requests can also tax machine resources and, when using cloud storage,
1118
- incur high processing costs.
1119
-
1120
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-snapshot-status-api.html>`_
1121
-
1122
- :param repository: A repository name
1123
- :param snapshot: A comma-separated list of snapshot names
1124
- :param ignore_unavailable: Whether to ignore unavailable snapshots, defaults
1125
- to false which means a SnapshotMissingException is thrown
1126
- :param master_timeout: Explicit operation timeout for connection to master node
1217
+ .. raw:: html
1218
+
1219
+ <p>Get the snapshot status.
1220
+ Get a detailed description of the current state for each shard participating in the snapshot.</p>
1221
+ <p>Note that this API should be used only to obtain detailed shard-level information for ongoing snapshots.
1222
+ If this detail is not needed or you want to obtain information about one or more existing snapshots, use the get snapshot API.</p>
1223
+ <p>If you omit the <code>&lt;snapshot&gt;</code> request path parameter, the request retrieves information only for currently running snapshots.
1224
+ This usage is preferred.
1225
+ If needed, you can specify <code>&lt;repository&gt;</code> and <code>&lt;snapshot&gt;</code> to retrieve information for specific snapshots, even if they're not currently running.</p>
1226
+ <p>WARNING: Using the API to return the status of any snapshots other than currently running snapshots can be expensive.
1227
+ The API requires a read from the repository for each shard in each snapshot.
1228
+ For example, if you have 100 snapshots with 1,000 shards each, an API request that includes all snapshots will require 100,000 reads (100 snapshots x 1,000 shards).</p>
1229
+ <p>Depending on the latency of your storage, such requests can take an extremely long time to return results.
1230
+ These requests can also tax machine resources and, when using cloud storage, incur high processing costs.</p>
1231
+
1232
+
1233
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-status>`_
1234
+
1235
+ :param repository: The snapshot repository name used to limit the request. It
1236
+ supports wildcards (`*`) if `<snapshot>` isn't specified.
1237
+ :param snapshot: A comma-separated list of snapshots to retrieve status for.
1238
+ The default is currently running snapshots. Wildcards (`*`) are not supported.
1239
+ :param ignore_unavailable: If `false`, the request returns an error for any snapshots
1240
+ that are unavailable. If `true`, the request ignores snapshots that are unavailable,
1241
+ such as those that are corrupted or temporarily cannot be returned.
1242
+ :param master_timeout: The period to wait for the master node. If the master
1243
+ node is not available before the timeout expires, the request fails and returns
1244
+ an error. To indicate that the request should never timeout, set it to `-1`.
1127
1245
  """
1128
1246
  __path_parts: t.Dict[str, str]
1129
1247
  if repository not in SKIP_IN_PATH and snapshot not in SKIP_IN_PATH:
@@ -1174,14 +1292,23 @@ class SnapshotClient(NamespacedClient):
1174
1292
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1175
1293
  ) -> ObjectApiResponse[t.Any]:
1176
1294
  """
1177
- Verify a snapshot repository. Check for common misconfigurations in a snapshot
1178
- repository.
1295
+ .. raw:: html
1296
+
1297
+ <p>Verify a snapshot repository.
1298
+ Check for common misconfigurations in a snapshot repository.</p>
1299
+
1179
1300
 
1180
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/verify-snapshot-repo-api.html>`_
1301
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-snapshot-verify-repository>`_
1181
1302
 
1182
- :param name: A repository name
1183
- :param master_timeout: Explicit operation timeout for connection to master node
1184
- :param timeout: Explicit operation timeout
1303
+ :param name: The name of the snapshot repository to verify.
1304
+ :param master_timeout: The period to wait for the master node. If the master
1305
+ node is not available before the timeout expires, the request fails and returns
1306
+ an error. To indicate that the request should never timeout, set it to `-1`.
1307
+ :param timeout: The period to wait for a response from all relevant nodes in
1308
+ the cluster after updating the cluster metadata. If no response is received
1309
+ before the timeout expires, the cluster metadata update still applies but
1310
+ the response will indicate that it was not completely acknowledged. To indicate
1311
+ that the request should never timeout, set it to `-1`.
1185
1312
  """
1186
1313
  if name in SKIP_IN_PATH:
1187
1314
  raise ValueError("Empty value passed for parameter 'name'")