elasticsearch 8.11.1__py3-none-any.whl → 8.12.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 (90) hide show
  1. elasticsearch/_async/client/__init__.py +493 -347
  2. elasticsearch/_async/client/async_search.py +108 -72
  3. elasticsearch/_async/client/autoscaling.py +13 -8
  4. elasticsearch/_async/client/cat.py +26 -26
  5. elasticsearch/_async/client/ccr.py +178 -117
  6. elasticsearch/_async/client/cluster.py +56 -48
  7. elasticsearch/_async/client/dangling_indices.py +3 -3
  8. elasticsearch/_async/client/enrich.py +15 -13
  9. elasticsearch/_async/client/eql.py +53 -36
  10. elasticsearch/_async/client/esql.py +99 -0
  11. elasticsearch/_async/client/features.py +2 -2
  12. elasticsearch/_async/client/fleet.py +111 -71
  13. elasticsearch/_async/client/graph.py +13 -11
  14. elasticsearch/_async/client/ilm.py +33 -27
  15. elasticsearch/_async/client/indices.py +326 -227
  16. elasticsearch/_async/client/inference.py +212 -0
  17. elasticsearch/_async/client/ingest.py +28 -24
  18. elasticsearch/_async/client/license.py +15 -13
  19. elasticsearch/_async/client/logstash.py +13 -10
  20. elasticsearch/_async/client/migration.py +3 -3
  21. elasticsearch/_async/client/ml.py +758 -538
  22. elasticsearch/_async/client/monitoring.py +10 -5
  23. elasticsearch/_async/client/nodes.py +13 -11
  24. elasticsearch/_async/client/query_ruleset.py +12 -10
  25. elasticsearch/_async/client/rollup.py +59 -46
  26. elasticsearch/_async/client/search_application.py +23 -16
  27. elasticsearch/_async/client/searchable_snapshots.py +23 -16
  28. elasticsearch/_async/client/security.py +391 -289
  29. elasticsearch/_async/client/shutdown.py +18 -14
  30. elasticsearch/_async/client/slm.py +23 -21
  31. elasticsearch/_async/client/snapshot.py +91 -65
  32. elasticsearch/_async/client/sql.py +81 -58
  33. elasticsearch/_async/client/ssl.py +1 -1
  34. elasticsearch/_async/client/synonyms.py +23 -19
  35. elasticsearch/_async/client/tasks.py +3 -3
  36. elasticsearch/_async/client/text_structure.py +10 -5
  37. elasticsearch/_async/client/transform.py +111 -75
  38. elasticsearch/_async/client/watcher.py +77 -55
  39. elasticsearch/_async/client/xpack.py +2 -2
  40. elasticsearch/_async/helpers.py +1 -1
  41. elasticsearch/_sync/client/__init__.py +493 -347
  42. elasticsearch/_sync/client/async_search.py +108 -72
  43. elasticsearch/_sync/client/autoscaling.py +13 -8
  44. elasticsearch/_sync/client/cat.py +26 -26
  45. elasticsearch/_sync/client/ccr.py +178 -117
  46. elasticsearch/_sync/client/cluster.py +56 -48
  47. elasticsearch/_sync/client/dangling_indices.py +3 -3
  48. elasticsearch/_sync/client/enrich.py +15 -13
  49. elasticsearch/_sync/client/eql.py +53 -36
  50. elasticsearch/_sync/client/esql.py +99 -0
  51. elasticsearch/_sync/client/features.py +2 -2
  52. elasticsearch/_sync/client/fleet.py +111 -71
  53. elasticsearch/_sync/client/graph.py +13 -11
  54. elasticsearch/_sync/client/ilm.py +33 -27
  55. elasticsearch/_sync/client/indices.py +326 -227
  56. elasticsearch/_sync/client/inference.py +212 -0
  57. elasticsearch/_sync/client/ingest.py +28 -24
  58. elasticsearch/_sync/client/license.py +15 -13
  59. elasticsearch/_sync/client/logstash.py +13 -10
  60. elasticsearch/_sync/client/migration.py +3 -3
  61. elasticsearch/_sync/client/ml.py +758 -538
  62. elasticsearch/_sync/client/monitoring.py +10 -5
  63. elasticsearch/_sync/client/nodes.py +13 -11
  64. elasticsearch/_sync/client/query_ruleset.py +12 -10
  65. elasticsearch/_sync/client/rollup.py +59 -46
  66. elasticsearch/_sync/client/search_application.py +23 -16
  67. elasticsearch/_sync/client/searchable_snapshots.py +23 -16
  68. elasticsearch/_sync/client/security.py +391 -289
  69. elasticsearch/_sync/client/shutdown.py +18 -14
  70. elasticsearch/_sync/client/slm.py +23 -21
  71. elasticsearch/_sync/client/snapshot.py +91 -65
  72. elasticsearch/_sync/client/sql.py +81 -58
  73. elasticsearch/_sync/client/ssl.py +1 -1
  74. elasticsearch/_sync/client/synonyms.py +23 -19
  75. elasticsearch/_sync/client/tasks.py +3 -3
  76. elasticsearch/_sync/client/text_structure.py +10 -5
  77. elasticsearch/_sync/client/transform.py +111 -75
  78. elasticsearch/_sync/client/utils.py +34 -10
  79. elasticsearch/_sync/client/watcher.py +77 -55
  80. elasticsearch/_sync/client/xpack.py +2 -2
  81. elasticsearch/_version.py +1 -1
  82. elasticsearch/client.py +2 -0
  83. elasticsearch/helpers/actions.py +1 -1
  84. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/METADATA +2 -3
  85. elasticsearch-8.12.0.dist-info/RECORD +103 -0
  86. elasticsearch-8.11.1.dist-info/RECORD +0 -99
  87. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/LICENSE +0 -0
  88. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/NOTICE +0 -0
  89. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/WHEEL +0 -0
  90. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/top_level.txt +0 -0
@@ -126,14 +126,16 @@ class ShutdownClient(NamespacedClient):
126
126
  )
127
127
 
128
128
  @_rewrite_parameters(
129
- body_fields=True,
129
+ body_fields=("reason", "type", "allocation_delay", "target_node_name"),
130
130
  )
131
131
  async def put_node(
132
132
  self,
133
133
  *,
134
134
  node_id: str,
135
- reason: str,
136
- type: t.Union["t.Literal['remove', 'replace', 'restart']", str],
135
+ reason: t.Optional[str] = None,
136
+ type: t.Optional[
137
+ t.Union["t.Literal['remove', 'replace', 'restart']", str]
138
+ ] = None,
137
139
  allocation_delay: t.Optional[str] = None,
138
140
  error_trace: t.Optional[bool] = None,
139
141
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -146,6 +148,7 @@ class ShutdownClient(NamespacedClient):
146
148
  timeout: t.Optional[
147
149
  t.Union["t.Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's']", str]
148
150
  ] = None,
151
+ body: t.Optional[t.Dict[str, t.Any]] = None,
149
152
  ) -> ObjectApiResponse[t.Any]:
150
153
  """
151
154
  Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct
@@ -188,19 +191,13 @@ class ShutdownClient(NamespacedClient):
188
191
  """
189
192
  if node_id in SKIP_IN_PATH:
190
193
  raise ValueError("Empty value passed for parameter 'node_id'")
191
- if reason is None:
194
+ if reason is None and body is None:
192
195
  raise ValueError("Empty value passed for parameter 'reason'")
193
- if type is None:
196
+ if type is None and body is None:
194
197
  raise ValueError("Empty value passed for parameter 'type'")
195
198
  __path = f"/_nodes/{_quote(node_id)}/shutdown"
196
- __body: t.Dict[str, t.Any] = {}
197
199
  __query: t.Dict[str, t.Any] = {}
198
- if reason is not None:
199
- __body["reason"] = reason
200
- if type is not None:
201
- __body["type"] = type
202
- if allocation_delay is not None:
203
- __body["allocation_delay"] = allocation_delay
200
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
204
201
  if error_trace is not None:
205
202
  __query["error_trace"] = error_trace
206
203
  if filter_path is not None:
@@ -211,10 +208,17 @@ class ShutdownClient(NamespacedClient):
211
208
  __query["master_timeout"] = master_timeout
212
209
  if pretty is not None:
213
210
  __query["pretty"] = pretty
214
- if target_node_name is not None:
215
- __body["target_node_name"] = target_node_name
216
211
  if timeout is not None:
217
212
  __query["timeout"] = timeout
213
+ if not __body:
214
+ if reason is not None:
215
+ __body["reason"] = reason
216
+ if type is not None:
217
+ __body["type"] = type
218
+ if allocation_delay is not None:
219
+ __body["allocation_delay"] = allocation_delay
220
+ if target_node_name is not None:
221
+ __body["target_node_name"] = target_node_name
218
222
  __headers = {"accept": "application/json", "content-type": "application/json"}
219
223
  return await self.perform_request( # type: ignore[return-value]
220
224
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -37,7 +37,7 @@ class SlmClient(NamespacedClient):
37
37
  """
38
38
  Deletes an existing snapshot lifecycle policy.
39
39
 
40
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-delete-policy.html>`_
40
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-delete-policy.html>`_
41
41
 
42
42
  :param policy_id: The id of the snapshot lifecycle policy to remove
43
43
  """
@@ -72,7 +72,7 @@ class SlmClient(NamespacedClient):
72
72
  Immediately creates a snapshot according to the lifecycle policy, without waiting
73
73
  for the scheduled time.
74
74
 
75
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-execute-lifecycle.html>`_
75
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-execute-lifecycle.html>`_
76
76
 
77
77
  :param policy_id: The id of the snapshot lifecycle policy to be executed
78
78
  """
@@ -105,7 +105,7 @@ class SlmClient(NamespacedClient):
105
105
  """
106
106
  Deletes any snapshots that are expired according to the policy's retention rules.
107
107
 
108
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-execute-retention.html>`_
108
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-execute-retention.html>`_
109
109
  """
110
110
  __path = "/_slm/_execute_retention"
111
111
  __query: t.Dict[str, t.Any] = {}
@@ -136,7 +136,7 @@ class SlmClient(NamespacedClient):
136
136
  Retrieves one or more snapshot lifecycle policy definitions and information about
137
137
  the latest snapshot attempts.
138
138
 
139
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-get-policy.html>`_
139
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-get-policy.html>`_
140
140
 
141
141
  :param policy_id: Comma-separated list of snapshot lifecycle policies to retrieve
142
142
  """
@@ -171,7 +171,7 @@ class SlmClient(NamespacedClient):
171
171
  Returns global and policy-level statistics about actions taken by snapshot lifecycle
172
172
  management.
173
173
 
174
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-get-stats.html>`_
174
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-get-stats.html>`_
175
175
  """
176
176
  __path = "/_slm/stats"
177
177
  __query: t.Dict[str, t.Any] = {}
@@ -200,7 +200,7 @@ class SlmClient(NamespacedClient):
200
200
  """
201
201
  Retrieves the status of snapshot lifecycle management (SLM).
202
202
 
203
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-get-status.html>`_
203
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-get-status.html>`_
204
204
  """
205
205
  __path = "/_slm/status"
206
206
  __query: t.Dict[str, t.Any] = {}
@@ -218,7 +218,7 @@ class SlmClient(NamespacedClient):
218
218
  )
219
219
 
220
220
  @_rewrite_parameters(
221
- body_fields=True,
221
+ body_fields=("config", "name", "repository", "retention", "schedule"),
222
222
  )
223
223
  async def put_lifecycle(
224
224
  self,
@@ -237,11 +237,12 @@ class SlmClient(NamespacedClient):
237
237
  retention: t.Optional[t.Mapping[str, t.Any]] = None,
238
238
  schedule: t.Optional[str] = None,
239
239
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
240
+ body: t.Optional[t.Dict[str, t.Any]] = None,
240
241
  ) -> ObjectApiResponse[t.Any]:
241
242
  """
242
243
  Creates or updates a snapshot lifecycle policy.
243
244
 
244
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-put-policy.html>`_
245
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-put-policy.html>`_
245
246
 
246
247
  :param policy_id: ID for the snapshot lifecycle policy you want to create or
247
248
  update.
@@ -265,10 +266,8 @@ class SlmClient(NamespacedClient):
265
266
  if policy_id in SKIP_IN_PATH:
266
267
  raise ValueError("Empty value passed for parameter 'policy_id'")
267
268
  __path = f"/_slm/policy/{_quote(policy_id)}"
268
- __body: t.Dict[str, t.Any] = {}
269
269
  __query: t.Dict[str, t.Any] = {}
270
- if config is not None:
271
- __body["config"] = config
270
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
272
271
  if error_trace is not None:
273
272
  __query["error_trace"] = error_trace
274
273
  if filter_path is not None:
@@ -277,18 +276,21 @@ class SlmClient(NamespacedClient):
277
276
  __query["human"] = human
278
277
  if master_timeout is not None:
279
278
  __query["master_timeout"] = master_timeout
280
- if name is not None:
281
- __body["name"] = name
282
279
  if pretty is not None:
283
280
  __query["pretty"] = pretty
284
- if repository is not None:
285
- __body["repository"] = repository
286
- if retention is not None:
287
- __body["retention"] = retention
288
- if schedule is not None:
289
- __body["schedule"] = schedule
290
281
  if timeout is not None:
291
282
  __query["timeout"] = timeout
283
+ if not __body:
284
+ if config is not None:
285
+ __body["config"] = config
286
+ if name is not None:
287
+ __body["name"] = name
288
+ if repository is not None:
289
+ __body["repository"] = repository
290
+ if retention is not None:
291
+ __body["retention"] = retention
292
+ if schedule is not None:
293
+ __body["schedule"] = schedule
292
294
  if not __body:
293
295
  __body = None # type: ignore[assignment]
294
296
  __headers = {"accept": "application/json"}
@@ -310,7 +312,7 @@ class SlmClient(NamespacedClient):
310
312
  """
311
313
  Turns on snapshot lifecycle management (SLM).
312
314
 
313
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-start.html>`_
315
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-start.html>`_
314
316
  """
315
317
  __path = "/_slm/start"
316
318
  __query: t.Dict[str, t.Any] = {}
@@ -339,7 +341,7 @@ class SlmClient(NamespacedClient):
339
341
  """
340
342
  Turns off snapshot lifecycle management (SLM).
341
343
 
342
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/slm-api-stop.html>`_
344
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/slm-api-stop.html>`_
343
345
  """
344
346
  __path = "/_slm/stop"
345
347
  __query: t.Dict[str, t.Any] = {}
@@ -41,7 +41,7 @@ class SnapshotClient(NamespacedClient):
41
41
  """
42
42
  Removes stale data from repository.
43
43
 
44
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/clean-up-snapshot-repo-api.html>`_
44
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/clean-up-snapshot-repo-api.html>`_
45
45
 
46
46
  :param name: Snapshot repository to clean up.
47
47
  :param master_timeout: Period to wait for a connection to the master node.
@@ -69,7 +69,7 @@ class SnapshotClient(NamespacedClient):
69
69
  )
70
70
 
71
71
  @_rewrite_parameters(
72
- body_fields=True,
72
+ body_fields=("indices",),
73
73
  )
74
74
  async def clone(
75
75
  self,
@@ -77,7 +77,7 @@ class SnapshotClient(NamespacedClient):
77
77
  repository: str,
78
78
  snapshot: str,
79
79
  target_snapshot: str,
80
- indices: str,
80
+ indices: t.Optional[str] = None,
81
81
  error_trace: t.Optional[bool] = None,
82
82
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
83
83
  human: t.Optional[bool] = None,
@@ -86,11 +86,12 @@ class SnapshotClient(NamespacedClient):
86
86
  ] = None,
87
87
  pretty: t.Optional[bool] = None,
88
88
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
89
+ body: t.Optional[t.Dict[str, t.Any]] = None,
89
90
  ) -> ObjectApiResponse[t.Any]:
90
91
  """
91
92
  Clones indices from one snapshot into another snapshot in the same repository.
92
93
 
93
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
94
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
94
95
 
95
96
  :param repository: A repository name
96
97
  :param snapshot: The name of the snapshot to clone from
@@ -105,13 +106,11 @@ class SnapshotClient(NamespacedClient):
105
106
  raise ValueError("Empty value passed for parameter 'snapshot'")
106
107
  if target_snapshot in SKIP_IN_PATH:
107
108
  raise ValueError("Empty value passed for parameter 'target_snapshot'")
108
- if indices is None:
109
+ if indices is None and body is None:
109
110
  raise ValueError("Empty value passed for parameter 'indices'")
110
111
  __path = f"/_snapshot/{_quote(repository)}/{_quote(snapshot)}/_clone/{_quote(target_snapshot)}"
111
- __body: t.Dict[str, t.Any] = {}
112
112
  __query: t.Dict[str, t.Any] = {}
113
- if indices is not None:
114
- __body["indices"] = indices
113
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
115
114
  if error_trace is not None:
116
115
  __query["error_trace"] = error_trace
117
116
  if filter_path is not None:
@@ -124,13 +123,23 @@ class SnapshotClient(NamespacedClient):
124
123
  __query["pretty"] = pretty
125
124
  if timeout is not None:
126
125
  __query["timeout"] = timeout
126
+ if not __body:
127
+ if indices is not None:
128
+ __body["indices"] = indices
127
129
  __headers = {"accept": "application/json", "content-type": "application/json"}
128
130
  return await self.perform_request( # type: ignore[return-value]
129
131
  "PUT", __path, params=__query, headers=__headers, body=__body
130
132
  )
131
133
 
132
134
  @_rewrite_parameters(
133
- body_fields=True,
135
+ body_fields=(
136
+ "feature_states",
137
+ "ignore_unavailable",
138
+ "include_global_state",
139
+ "indices",
140
+ "metadata",
141
+ "partial",
142
+ ),
134
143
  )
135
144
  async def create(
136
145
  self,
@@ -151,11 +160,12 @@ class SnapshotClient(NamespacedClient):
151
160
  partial: t.Optional[bool] = None,
152
161
  pretty: t.Optional[bool] = None,
153
162
  wait_for_completion: t.Optional[bool] = None,
163
+ body: t.Optional[t.Dict[str, t.Any]] = None,
154
164
  ) -> ObjectApiResponse[t.Any]:
155
165
  """
156
166
  Creates a snapshot in a repository.
157
167
 
158
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
168
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
159
169
 
160
170
  :param repository: Repository for the snapshot.
161
171
  :param snapshot: Name of the snapshot. Must be unique in the repository.
@@ -194,31 +204,32 @@ class SnapshotClient(NamespacedClient):
194
204
  raise ValueError("Empty value passed for parameter 'snapshot'")
195
205
  __path = f"/_snapshot/{_quote(repository)}/{_quote(snapshot)}"
196
206
  __query: t.Dict[str, t.Any] = {}
197
- __body: t.Dict[str, t.Any] = {}
207
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
198
208
  if error_trace is not None:
199
209
  __query["error_trace"] = error_trace
200
- if feature_states is not None:
201
- __body["feature_states"] = feature_states
202
210
  if filter_path is not None:
203
211
  __query["filter_path"] = filter_path
204
212
  if human is not None:
205
213
  __query["human"] = human
206
- if ignore_unavailable is not None:
207
- __body["ignore_unavailable"] = ignore_unavailable
208
- if include_global_state is not None:
209
- __body["include_global_state"] = include_global_state
210
- if indices is not None:
211
- __body["indices"] = indices
212
214
  if master_timeout is not None:
213
215
  __query["master_timeout"] = master_timeout
214
- if metadata is not None:
215
- __body["metadata"] = metadata
216
- if partial is not None:
217
- __body["partial"] = partial
218
216
  if pretty is not None:
219
217
  __query["pretty"] = pretty
220
218
  if wait_for_completion is not None:
221
219
  __query["wait_for_completion"] = wait_for_completion
220
+ if not __body:
221
+ if feature_states is not None:
222
+ __body["feature_states"] = feature_states
223
+ if ignore_unavailable is not None:
224
+ __body["ignore_unavailable"] = ignore_unavailable
225
+ if include_global_state is not None:
226
+ __body["include_global_state"] = include_global_state
227
+ if indices is not None:
228
+ __body["indices"] = indices
229
+ if metadata is not None:
230
+ __body["metadata"] = metadata
231
+ if partial is not None:
232
+ __body["partial"] = partial
222
233
  if not __body:
223
234
  __body = None # type: ignore[assignment]
224
235
  __headers = {"accept": "application/json"}
@@ -229,14 +240,14 @@ class SnapshotClient(NamespacedClient):
229
240
  )
230
241
 
231
242
  @_rewrite_parameters(
232
- body_fields=True,
243
+ body_fields=("settings", "type", "repository"),
233
244
  )
234
245
  async def create_repository(
235
246
  self,
236
247
  *,
237
248
  name: str,
238
- settings: t.Mapping[str, t.Any],
239
- type: str,
249
+ settings: t.Optional[t.Mapping[str, t.Any]] = None,
250
+ type: t.Optional[str] = None,
240
251
  error_trace: t.Optional[bool] = None,
241
252
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
242
253
  human: t.Optional[bool] = None,
@@ -247,11 +258,12 @@ class SnapshotClient(NamespacedClient):
247
258
  repository: t.Optional[t.Mapping[str, t.Any]] = None,
248
259
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
249
260
  verify: t.Optional[bool] = None,
261
+ body: t.Optional[t.Dict[str, t.Any]] = None,
250
262
  ) -> ObjectApiResponse[t.Any]:
251
263
  """
252
264
  Creates a repository.
253
265
 
254
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
266
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
255
267
 
256
268
  :param name: A repository name
257
269
  :param settings:
@@ -263,17 +275,13 @@ class SnapshotClient(NamespacedClient):
263
275
  """
264
276
  if name in SKIP_IN_PATH:
265
277
  raise ValueError("Empty value passed for parameter 'name'")
266
- if settings is None:
278
+ if settings is None and body is None:
267
279
  raise ValueError("Empty value passed for parameter 'settings'")
268
- if type is None:
280
+ if type is None and body is None:
269
281
  raise ValueError("Empty value passed for parameter 'type'")
270
282
  __path = f"/_snapshot/{_quote(name)}"
271
- __body: t.Dict[str, t.Any] = {}
272
283
  __query: t.Dict[str, t.Any] = {}
273
- if settings is not None:
274
- __body["settings"] = settings
275
- if type is not None:
276
- __body["type"] = type
284
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
277
285
  if error_trace is not None:
278
286
  __query["error_trace"] = error_trace
279
287
  if filter_path is not None:
@@ -284,12 +292,17 @@ class SnapshotClient(NamespacedClient):
284
292
  __query["master_timeout"] = master_timeout
285
293
  if pretty is not None:
286
294
  __query["pretty"] = pretty
287
- if repository is not None:
288
- __body["repository"] = repository
289
295
  if timeout is not None:
290
296
  __query["timeout"] = timeout
291
297
  if verify is not None:
292
298
  __query["verify"] = verify
299
+ if not __body:
300
+ if settings is not None:
301
+ __body["settings"] = settings
302
+ if type is not None:
303
+ __body["type"] = type
304
+ if repository is not None:
305
+ __body["repository"] = repository
293
306
  __headers = {"accept": "application/json", "content-type": "application/json"}
294
307
  return await self.perform_request( # type: ignore[return-value]
295
308
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -312,7 +325,7 @@ class SnapshotClient(NamespacedClient):
312
325
  """
313
326
  Deletes one or more snapshots.
314
327
 
315
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
328
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
316
329
 
317
330
  :param repository: A repository name
318
331
  :param snapshot: A comma-separated list of snapshot names
@@ -356,7 +369,7 @@ class SnapshotClient(NamespacedClient):
356
369
  """
357
370
  Deletes a repository.
358
371
 
359
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
372
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
360
373
 
361
374
  :param name: Name of the snapshot repository to unregister. Wildcard (`*`) patterns
362
375
  are supported.
@@ -418,7 +431,7 @@ class SnapshotClient(NamespacedClient):
418
431
  """
419
432
  Returns information about a snapshot.
420
433
 
421
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
434
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
422
435
 
423
436
  :param repository: Comma-separated list of snapshot repository names used to
424
437
  limit the request. Wildcard (*) expressions are supported.
@@ -523,7 +536,7 @@ class SnapshotClient(NamespacedClient):
523
536
  """
524
537
  Returns information about a repository.
525
538
 
526
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
539
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
527
540
 
528
541
  :param name: A comma-separated list of repository names
529
542
  :param local: Return local information, do not retrieve the state from master
@@ -553,7 +566,18 @@ class SnapshotClient(NamespacedClient):
553
566
  )
554
567
 
555
568
  @_rewrite_parameters(
556
- body_fields=True,
569
+ body_fields=(
570
+ "feature_states",
571
+ "ignore_index_settings",
572
+ "ignore_unavailable",
573
+ "include_aliases",
574
+ "include_global_state",
575
+ "index_settings",
576
+ "indices",
577
+ "partial",
578
+ "rename_pattern",
579
+ "rename_replacement",
580
+ ),
557
581
  )
558
582
  async def restore(
559
583
  self,
@@ -578,11 +602,12 @@ class SnapshotClient(NamespacedClient):
578
602
  rename_pattern: t.Optional[str] = None,
579
603
  rename_replacement: t.Optional[str] = None,
580
604
  wait_for_completion: t.Optional[bool] = None,
605
+ body: t.Optional[t.Dict[str, t.Any]] = None,
581
606
  ) -> ObjectApiResponse[t.Any]:
582
607
  """
583
608
  Restores a snapshot.
584
609
 
585
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
610
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
586
611
 
587
612
  :param repository: A repository name
588
613
  :param snapshot: A snapshot name
@@ -606,39 +631,40 @@ class SnapshotClient(NamespacedClient):
606
631
  raise ValueError("Empty value passed for parameter 'snapshot'")
607
632
  __path = f"/_snapshot/{_quote(repository)}/{_quote(snapshot)}/_restore"
608
633
  __query: t.Dict[str, t.Any] = {}
609
- __body: t.Dict[str, t.Any] = {}
634
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
610
635
  if error_trace is not None:
611
636
  __query["error_trace"] = error_trace
612
- if feature_states is not None:
613
- __body["feature_states"] = feature_states
614
637
  if filter_path is not None:
615
638
  __query["filter_path"] = filter_path
616
639
  if human is not None:
617
640
  __query["human"] = human
618
- if ignore_index_settings is not None:
619
- __body["ignore_index_settings"] = ignore_index_settings
620
- if ignore_unavailable is not None:
621
- __body["ignore_unavailable"] = ignore_unavailable
622
- if include_aliases is not None:
623
- __body["include_aliases"] = include_aliases
624
- if include_global_state is not None:
625
- __body["include_global_state"] = include_global_state
626
- if index_settings is not None:
627
- __body["index_settings"] = index_settings
628
- if indices is not None:
629
- __body["indices"] = indices
630
641
  if master_timeout is not None:
631
642
  __query["master_timeout"] = master_timeout
632
- if partial is not None:
633
- __body["partial"] = partial
634
643
  if pretty is not None:
635
644
  __query["pretty"] = pretty
636
- if rename_pattern is not None:
637
- __body["rename_pattern"] = rename_pattern
638
- if rename_replacement is not None:
639
- __body["rename_replacement"] = rename_replacement
640
645
  if wait_for_completion is not None:
641
646
  __query["wait_for_completion"] = wait_for_completion
647
+ if not __body:
648
+ if feature_states is not None:
649
+ __body["feature_states"] = feature_states
650
+ if ignore_index_settings is not None:
651
+ __body["ignore_index_settings"] = ignore_index_settings
652
+ if ignore_unavailable is not None:
653
+ __body["ignore_unavailable"] = ignore_unavailable
654
+ if include_aliases is not None:
655
+ __body["include_aliases"] = include_aliases
656
+ if include_global_state is not None:
657
+ __body["include_global_state"] = include_global_state
658
+ if index_settings is not None:
659
+ __body["index_settings"] = index_settings
660
+ if indices is not None:
661
+ __body["indices"] = indices
662
+ if partial is not None:
663
+ __body["partial"] = partial
664
+ if rename_pattern is not None:
665
+ __body["rename_pattern"] = rename_pattern
666
+ if rename_replacement is not None:
667
+ __body["rename_replacement"] = rename_replacement
642
668
  if not __body:
643
669
  __body = None # type: ignore[assignment]
644
670
  __headers = {"accept": "application/json"}
@@ -666,7 +692,7 @@ class SnapshotClient(NamespacedClient):
666
692
  """
667
693
  Returns information about the status of a snapshot.
668
694
 
669
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
695
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
670
696
 
671
697
  :param repository: A repository name
672
698
  :param snapshot: A comma-separated list of snapshot names
@@ -715,7 +741,7 @@ class SnapshotClient(NamespacedClient):
715
741
  """
716
742
  Verifies a repository.
717
743
 
718
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-snapshots.html>`_
744
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-snapshots.html>`_
719
745
 
720
746
  :param name: A repository name
721
747
  :param master_timeout: Explicit operation timeout for connection to master node