elasticsearch 8.12.1__py3-none-any.whl → 8.13.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/__init__.py +7 -0
- elasticsearch/_async/client/__init__.py +477 -128
- elasticsearch/_async/client/_base.py +41 -1
- elasticsearch/_async/client/async_search.py +40 -12
- elasticsearch/_async/client/autoscaling.py +37 -11
- elasticsearch/_async/client/cat.py +260 -69
- elasticsearch/_async/client/ccr.py +123 -38
- elasticsearch/_async/client/cluster.py +153 -42
- elasticsearch/_async/client/dangling_indices.py +27 -8
- elasticsearch/_async/client/enrich.py +48 -14
- elasticsearch/_async/client/eql.py +38 -12
- elasticsearch/_async/client/esql.py +10 -2
- elasticsearch/_async/client/features.py +17 -4
- elasticsearch/_async/client/fleet.py +30 -7
- elasticsearch/_async/client/graph.py +11 -3
- elasticsearch/_async/client/ilm.py +101 -29
- elasticsearch/_async/client/indices.py +688 -181
- elasticsearch/_async/client/inference.py +111 -44
- elasticsearch/_async/client/ingest.py +59 -16
- elasticsearch/_async/client/license.py +58 -14
- elasticsearch/_async/client/logstash.py +31 -9
- elasticsearch/_async/client/migration.py +28 -7
- elasticsearch/_async/client/ml.py +781 -214
- elasticsearch/_async/client/monitoring.py +10 -2
- elasticsearch/_async/client/nodes.py +103 -29
- elasticsearch/_async/client/query_ruleset.py +37 -11
- elasticsearch/_async/client/rollup.py +79 -24
- elasticsearch/_async/client/search_application.py +76 -23
- elasticsearch/_async/client/searchable_snapshots.py +49 -12
- elasticsearch/_async/client/security.py +544 -143
- elasticsearch/_async/client/shutdown.py +28 -6
- elasticsearch/_async/client/slm.py +80 -22
- elasticsearch/_async/client/snapshot.py +140 -54
- elasticsearch/_async/client/sql.py +55 -15
- elasticsearch/_async/client/ssl.py +9 -2
- elasticsearch/_async/client/synonyms.py +75 -21
- elasticsearch/_async/client/tasks.py +29 -8
- elasticsearch/_async/client/text_structure.py +74 -2
- elasticsearch/_async/client/transform.py +106 -32
- elasticsearch/_async/client/watcher.py +110 -31
- elasticsearch/_async/client/xpack.py +16 -4
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_otel.py +92 -0
- elasticsearch/_sync/client/__init__.py +477 -128
- elasticsearch/_sync/client/_base.py +41 -1
- elasticsearch/_sync/client/async_search.py +40 -12
- elasticsearch/_sync/client/autoscaling.py +37 -11
- elasticsearch/_sync/client/cat.py +260 -69
- elasticsearch/_sync/client/ccr.py +123 -38
- elasticsearch/_sync/client/cluster.py +153 -42
- elasticsearch/_sync/client/dangling_indices.py +27 -8
- elasticsearch/_sync/client/enrich.py +48 -14
- elasticsearch/_sync/client/eql.py +38 -12
- elasticsearch/_sync/client/esql.py +10 -2
- elasticsearch/_sync/client/features.py +17 -4
- elasticsearch/_sync/client/fleet.py +30 -7
- elasticsearch/_sync/client/graph.py +11 -3
- elasticsearch/_sync/client/ilm.py +101 -29
- elasticsearch/_sync/client/indices.py +688 -181
- elasticsearch/_sync/client/inference.py +111 -44
- elasticsearch/_sync/client/ingest.py +59 -16
- elasticsearch/_sync/client/license.py +58 -14
- elasticsearch/_sync/client/logstash.py +31 -9
- elasticsearch/_sync/client/migration.py +28 -7
- elasticsearch/_sync/client/ml.py +781 -214
- elasticsearch/_sync/client/monitoring.py +10 -2
- elasticsearch/_sync/client/nodes.py +103 -29
- elasticsearch/_sync/client/query_ruleset.py +37 -11
- elasticsearch/_sync/client/rollup.py +79 -24
- elasticsearch/_sync/client/search_application.py +76 -23
- elasticsearch/_sync/client/searchable_snapshots.py +49 -12
- elasticsearch/_sync/client/security.py +544 -143
- elasticsearch/_sync/client/shutdown.py +28 -6
- elasticsearch/_sync/client/slm.py +80 -22
- elasticsearch/_sync/client/snapshot.py +140 -54
- elasticsearch/_sync/client/sql.py +55 -15
- elasticsearch/_sync/client/ssl.py +9 -2
- elasticsearch/_sync/client/synonyms.py +75 -21
- elasticsearch/_sync/client/tasks.py +29 -8
- elasticsearch/_sync/client/text_structure.py +74 -2
- elasticsearch/_sync/client/transform.py +106 -32
- elasticsearch/_sync/client/watcher.py +110 -31
- elasticsearch/_sync/client/xpack.py +16 -4
- elasticsearch/_version.py +1 -1
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/__init__.py +62 -0
- elasticsearch/helpers/vectorstore/_async/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_async/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_async/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_async/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +391 -0
- elasticsearch/helpers/vectorstore/_sync/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_sync/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_sync/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_sync/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +388 -0
- elasticsearch/helpers/vectorstore/_utils.py +116 -0
- elasticsearch/serializer.py +14 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/METADATA +28 -8
- elasticsearch-8.13.1.dist-info/RECORD +116 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/WHEEL +1 -1
- elasticsearch-8.12.1.dist-info/RECORD +0 -103
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/LICENSE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/NOTICE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/top_level.txt +0 -0
|
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class SnapshotClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters()
|
|
28
29
|
async def cleanup_repository(
|
|
29
30
|
self,
|
|
@@ -41,7 +42,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
41
42
|
"""
|
|
42
43
|
Removes stale data from repository.
|
|
43
44
|
|
|
44
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
45
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/clean-up-snapshot-repo-api.html>`_
|
|
45
46
|
|
|
46
47
|
:param name: Snapshot repository to clean up.
|
|
47
48
|
:param master_timeout: Period to wait for a connection to the master node.
|
|
@@ -49,7 +50,8 @@ class SnapshotClient(NamespacedClient):
|
|
|
49
50
|
"""
|
|
50
51
|
if name in SKIP_IN_PATH:
|
|
51
52
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
52
|
-
|
|
53
|
+
__path_parts: t.Dict[str, str] = {"repository": _quote(name)}
|
|
54
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/_cleanup'
|
|
53
55
|
__query: t.Dict[str, t.Any] = {}
|
|
54
56
|
if error_trace is not None:
|
|
55
57
|
__query["error_trace"] = error_trace
|
|
@@ -65,7 +67,12 @@ class SnapshotClient(NamespacedClient):
|
|
|
65
67
|
__query["timeout"] = timeout
|
|
66
68
|
__headers = {"accept": "application/json"}
|
|
67
69
|
return await self.perform_request( # type: ignore[return-value]
|
|
68
|
-
"POST",
|
|
70
|
+
"POST",
|
|
71
|
+
__path,
|
|
72
|
+
params=__query,
|
|
73
|
+
headers=__headers,
|
|
74
|
+
endpoint_id="snapshot.cleanup_repository",
|
|
75
|
+
path_parts=__path_parts,
|
|
69
76
|
)
|
|
70
77
|
|
|
71
78
|
@_rewrite_parameters(
|
|
@@ -91,7 +98,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
91
98
|
"""
|
|
92
99
|
Clones indices from one snapshot into another snapshot in the same repository.
|
|
93
100
|
|
|
94
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
101
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
95
102
|
|
|
96
103
|
:param repository: A repository name
|
|
97
104
|
:param snapshot: The name of the snapshot to clone from
|
|
@@ -108,7 +115,12 @@ class SnapshotClient(NamespacedClient):
|
|
|
108
115
|
raise ValueError("Empty value passed for parameter 'target_snapshot'")
|
|
109
116
|
if indices is None and body is None:
|
|
110
117
|
raise ValueError("Empty value passed for parameter 'indices'")
|
|
111
|
-
|
|
118
|
+
__path_parts: t.Dict[str, str] = {
|
|
119
|
+
"repository": _quote(repository),
|
|
120
|
+
"snapshot": _quote(snapshot),
|
|
121
|
+
"target_snapshot": _quote(target_snapshot),
|
|
122
|
+
}
|
|
123
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}/_clone/{__path_parts["target_snapshot"]}'
|
|
112
124
|
__query: t.Dict[str, t.Any] = {}
|
|
113
125
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
114
126
|
if error_trace is not None:
|
|
@@ -128,7 +140,13 @@ class SnapshotClient(NamespacedClient):
|
|
|
128
140
|
__body["indices"] = indices
|
|
129
141
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
130
142
|
return await self.perform_request( # type: ignore[return-value]
|
|
131
|
-
"PUT",
|
|
143
|
+
"PUT",
|
|
144
|
+
__path,
|
|
145
|
+
params=__query,
|
|
146
|
+
headers=__headers,
|
|
147
|
+
body=__body,
|
|
148
|
+
endpoint_id="snapshot.clone",
|
|
149
|
+
path_parts=__path_parts,
|
|
132
150
|
)
|
|
133
151
|
|
|
134
152
|
@_rewrite_parameters(
|
|
@@ -165,7 +183,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
165
183
|
"""
|
|
166
184
|
Creates a snapshot in a repository.
|
|
167
185
|
|
|
168
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
186
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
169
187
|
|
|
170
188
|
:param repository: Repository for the snapshot.
|
|
171
189
|
:param snapshot: Name of the snapshot. Must be unique in the repository.
|
|
@@ -202,7 +220,11 @@ class SnapshotClient(NamespacedClient):
|
|
|
202
220
|
raise ValueError("Empty value passed for parameter 'repository'")
|
|
203
221
|
if snapshot in SKIP_IN_PATH:
|
|
204
222
|
raise ValueError("Empty value passed for parameter 'snapshot'")
|
|
205
|
-
|
|
223
|
+
__path_parts: t.Dict[str, str] = {
|
|
224
|
+
"repository": _quote(repository),
|
|
225
|
+
"snapshot": _quote(snapshot),
|
|
226
|
+
}
|
|
227
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}'
|
|
206
228
|
__query: t.Dict[str, t.Any] = {}
|
|
207
229
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
208
230
|
if error_trace is not None:
|
|
@@ -236,18 +258,24 @@ class SnapshotClient(NamespacedClient):
|
|
|
236
258
|
if __body is not None:
|
|
237
259
|
__headers["content-type"] = "application/json"
|
|
238
260
|
return await self.perform_request( # type: ignore[return-value]
|
|
239
|
-
"PUT",
|
|
261
|
+
"PUT",
|
|
262
|
+
__path,
|
|
263
|
+
params=__query,
|
|
264
|
+
headers=__headers,
|
|
265
|
+
body=__body,
|
|
266
|
+
endpoint_id="snapshot.create",
|
|
267
|
+
path_parts=__path_parts,
|
|
240
268
|
)
|
|
241
269
|
|
|
242
270
|
@_rewrite_parameters(
|
|
243
|
-
|
|
271
|
+
body_name="repository",
|
|
244
272
|
)
|
|
245
273
|
async def create_repository(
|
|
246
274
|
self,
|
|
247
275
|
*,
|
|
248
276
|
name: str,
|
|
249
|
-
|
|
250
|
-
|
|
277
|
+
repository: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
278
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
251
279
|
error_trace: t.Optional[bool] = None,
|
|
252
280
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
253
281
|
human: t.Optional[bool] = None,
|
|
@@ -255,33 +283,31 @@ class SnapshotClient(NamespacedClient):
|
|
|
255
283
|
t.Union["t.Literal[-1]", "t.Literal[0]", str]
|
|
256
284
|
] = None,
|
|
257
285
|
pretty: t.Optional[bool] = None,
|
|
258
|
-
repository: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
259
286
|
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
|
|
260
287
|
verify: t.Optional[bool] = None,
|
|
261
|
-
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
262
288
|
) -> ObjectApiResponse[t.Any]:
|
|
263
289
|
"""
|
|
264
290
|
Creates a repository.
|
|
265
291
|
|
|
266
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
292
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
267
293
|
|
|
268
294
|
:param name: A repository name
|
|
269
|
-
:param settings:
|
|
270
|
-
:param type:
|
|
271
|
-
:param master_timeout: Explicit operation timeout for connection to master node
|
|
272
295
|
:param repository:
|
|
296
|
+
:param master_timeout: Explicit operation timeout for connection to master node
|
|
273
297
|
:param timeout: Explicit operation timeout
|
|
274
298
|
:param verify: Whether to verify the repository after creation
|
|
275
299
|
"""
|
|
276
300
|
if name in SKIP_IN_PATH:
|
|
277
301
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
278
|
-
if
|
|
279
|
-
raise ValueError(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
302
|
+
if repository is None and body is None:
|
|
303
|
+
raise ValueError(
|
|
304
|
+
"Empty value passed for parameters 'repository' and 'body', one of them should be set."
|
|
305
|
+
)
|
|
306
|
+
elif repository is not None and body is not None:
|
|
307
|
+
raise ValueError("Cannot set both 'repository' and 'body'")
|
|
308
|
+
__path_parts: t.Dict[str, str] = {"repository": _quote(name)}
|
|
309
|
+
__path = f'/_snapshot/{__path_parts["repository"]}'
|
|
283
310
|
__query: t.Dict[str, t.Any] = {}
|
|
284
|
-
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
285
311
|
if error_trace is not None:
|
|
286
312
|
__query["error_trace"] = error_trace
|
|
287
313
|
if filter_path is not None:
|
|
@@ -296,16 +322,16 @@ class SnapshotClient(NamespacedClient):
|
|
|
296
322
|
__query["timeout"] = timeout
|
|
297
323
|
if verify is not None:
|
|
298
324
|
__query["verify"] = verify
|
|
299
|
-
if not
|
|
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
|
|
325
|
+
__body = repository if repository is not None else body
|
|
306
326
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
307
327
|
return await self.perform_request( # type: ignore[return-value]
|
|
308
|
-
"PUT",
|
|
328
|
+
"PUT",
|
|
329
|
+
__path,
|
|
330
|
+
params=__query,
|
|
331
|
+
headers=__headers,
|
|
332
|
+
body=__body,
|
|
333
|
+
endpoint_id="snapshot.create_repository",
|
|
334
|
+
path_parts=__path_parts,
|
|
309
335
|
)
|
|
310
336
|
|
|
311
337
|
@_rewrite_parameters()
|
|
@@ -325,7 +351,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
325
351
|
"""
|
|
326
352
|
Deletes one or more snapshots.
|
|
327
353
|
|
|
328
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
354
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
329
355
|
|
|
330
356
|
:param repository: A repository name
|
|
331
357
|
:param snapshot: A comma-separated list of snapshot names
|
|
@@ -335,7 +361,11 @@ class SnapshotClient(NamespacedClient):
|
|
|
335
361
|
raise ValueError("Empty value passed for parameter 'repository'")
|
|
336
362
|
if snapshot in SKIP_IN_PATH:
|
|
337
363
|
raise ValueError("Empty value passed for parameter 'snapshot'")
|
|
338
|
-
|
|
364
|
+
__path_parts: t.Dict[str, str] = {
|
|
365
|
+
"repository": _quote(repository),
|
|
366
|
+
"snapshot": _quote(snapshot),
|
|
367
|
+
}
|
|
368
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}'
|
|
339
369
|
__query: t.Dict[str, t.Any] = {}
|
|
340
370
|
if error_trace is not None:
|
|
341
371
|
__query["error_trace"] = error_trace
|
|
@@ -349,7 +379,12 @@ class SnapshotClient(NamespacedClient):
|
|
|
349
379
|
__query["pretty"] = pretty
|
|
350
380
|
__headers = {"accept": "application/json"}
|
|
351
381
|
return await self.perform_request( # type: ignore[return-value]
|
|
352
|
-
"DELETE",
|
|
382
|
+
"DELETE",
|
|
383
|
+
__path,
|
|
384
|
+
params=__query,
|
|
385
|
+
headers=__headers,
|
|
386
|
+
endpoint_id="snapshot.delete",
|
|
387
|
+
path_parts=__path_parts,
|
|
353
388
|
)
|
|
354
389
|
|
|
355
390
|
@_rewrite_parameters()
|
|
@@ -369,7 +404,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
369
404
|
"""
|
|
370
405
|
Deletes a repository.
|
|
371
406
|
|
|
372
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
407
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
373
408
|
|
|
374
409
|
:param name: Name of the snapshot repository to unregister. Wildcard (`*`) patterns
|
|
375
410
|
are supported.
|
|
@@ -378,7 +413,8 @@ class SnapshotClient(NamespacedClient):
|
|
|
378
413
|
"""
|
|
379
414
|
if name in SKIP_IN_PATH:
|
|
380
415
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
381
|
-
|
|
416
|
+
__path_parts: t.Dict[str, str] = {"repository": _quote(name)}
|
|
417
|
+
__path = f'/_snapshot/{__path_parts["repository"]}'
|
|
382
418
|
__query: t.Dict[str, t.Any] = {}
|
|
383
419
|
if error_trace is not None:
|
|
384
420
|
__query["error_trace"] = error_trace
|
|
@@ -394,7 +430,12 @@ class SnapshotClient(NamespacedClient):
|
|
|
394
430
|
__query["timeout"] = timeout
|
|
395
431
|
__headers = {"accept": "application/json"}
|
|
396
432
|
return await self.perform_request( # type: ignore[return-value]
|
|
397
|
-
"DELETE",
|
|
433
|
+
"DELETE",
|
|
434
|
+
__path,
|
|
435
|
+
params=__query,
|
|
436
|
+
headers=__headers,
|
|
437
|
+
endpoint_id="snapshot.delete_repository",
|
|
438
|
+
path_parts=__path_parts,
|
|
398
439
|
)
|
|
399
440
|
|
|
400
441
|
@_rewrite_parameters()
|
|
@@ -431,7 +472,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
431
472
|
"""
|
|
432
473
|
Returns information about a snapshot.
|
|
433
474
|
|
|
434
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
475
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
435
476
|
|
|
436
477
|
:param repository: Comma-separated list of snapshot repository names used to
|
|
437
478
|
limit the request. Wildcard (*) expressions are supported.
|
|
@@ -478,7 +519,11 @@ class SnapshotClient(NamespacedClient):
|
|
|
478
519
|
raise ValueError("Empty value passed for parameter 'repository'")
|
|
479
520
|
if snapshot in SKIP_IN_PATH:
|
|
480
521
|
raise ValueError("Empty value passed for parameter 'snapshot'")
|
|
481
|
-
|
|
522
|
+
__path_parts: t.Dict[str, str] = {
|
|
523
|
+
"repository": _quote(repository),
|
|
524
|
+
"snapshot": _quote(snapshot),
|
|
525
|
+
}
|
|
526
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}'
|
|
482
527
|
__query: t.Dict[str, t.Any] = {}
|
|
483
528
|
if after is not None:
|
|
484
529
|
__query["after"] = after
|
|
@@ -516,7 +561,12 @@ class SnapshotClient(NamespacedClient):
|
|
|
516
561
|
__query["verbose"] = verbose
|
|
517
562
|
__headers = {"accept": "application/json"}
|
|
518
563
|
return await self.perform_request( # type: ignore[return-value]
|
|
519
|
-
"GET",
|
|
564
|
+
"GET",
|
|
565
|
+
__path,
|
|
566
|
+
params=__query,
|
|
567
|
+
headers=__headers,
|
|
568
|
+
endpoint_id="snapshot.get",
|
|
569
|
+
path_parts=__path_parts,
|
|
520
570
|
)
|
|
521
571
|
|
|
522
572
|
@_rewrite_parameters()
|
|
@@ -536,16 +586,19 @@ class SnapshotClient(NamespacedClient):
|
|
|
536
586
|
"""
|
|
537
587
|
Returns information about a repository.
|
|
538
588
|
|
|
539
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
589
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
540
590
|
|
|
541
591
|
:param name: A comma-separated list of repository names
|
|
542
592
|
:param local: Return local information, do not retrieve the state from master
|
|
543
593
|
node (default: false)
|
|
544
594
|
:param master_timeout: Explicit operation timeout for connection to master node
|
|
545
595
|
"""
|
|
596
|
+
__path_parts: t.Dict[str, str]
|
|
546
597
|
if name not in SKIP_IN_PATH:
|
|
547
|
-
|
|
598
|
+
__path_parts = {"repository": _quote(name)}
|
|
599
|
+
__path = f'/_snapshot/{__path_parts["repository"]}'
|
|
548
600
|
else:
|
|
601
|
+
__path_parts = {}
|
|
549
602
|
__path = "/_snapshot"
|
|
550
603
|
__query: t.Dict[str, t.Any] = {}
|
|
551
604
|
if error_trace is not None:
|
|
@@ -562,7 +615,12 @@ class SnapshotClient(NamespacedClient):
|
|
|
562
615
|
__query["pretty"] = pretty
|
|
563
616
|
__headers = {"accept": "application/json"}
|
|
564
617
|
return await self.perform_request( # type: ignore[return-value]
|
|
565
|
-
"GET",
|
|
618
|
+
"GET",
|
|
619
|
+
__path,
|
|
620
|
+
params=__query,
|
|
621
|
+
headers=__headers,
|
|
622
|
+
endpoint_id="snapshot.get_repository",
|
|
623
|
+
path_parts=__path_parts,
|
|
566
624
|
)
|
|
567
625
|
|
|
568
626
|
@_rewrite_parameters(
|
|
@@ -607,7 +665,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
607
665
|
"""
|
|
608
666
|
Restores a snapshot.
|
|
609
667
|
|
|
610
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
668
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
611
669
|
|
|
612
670
|
:param repository: A repository name
|
|
613
671
|
:param snapshot: A snapshot name
|
|
@@ -629,7 +687,11 @@ class SnapshotClient(NamespacedClient):
|
|
|
629
687
|
raise ValueError("Empty value passed for parameter 'repository'")
|
|
630
688
|
if snapshot in SKIP_IN_PATH:
|
|
631
689
|
raise ValueError("Empty value passed for parameter 'snapshot'")
|
|
632
|
-
|
|
690
|
+
__path_parts: t.Dict[str, str] = {
|
|
691
|
+
"repository": _quote(repository),
|
|
692
|
+
"snapshot": _quote(snapshot),
|
|
693
|
+
}
|
|
694
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}/_restore'
|
|
633
695
|
__query: t.Dict[str, t.Any] = {}
|
|
634
696
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
635
697
|
if error_trace is not None:
|
|
@@ -671,7 +733,13 @@ class SnapshotClient(NamespacedClient):
|
|
|
671
733
|
if __body is not None:
|
|
672
734
|
__headers["content-type"] = "application/json"
|
|
673
735
|
return await self.perform_request( # type: ignore[return-value]
|
|
674
|
-
"POST",
|
|
736
|
+
"POST",
|
|
737
|
+
__path,
|
|
738
|
+
params=__query,
|
|
739
|
+
headers=__headers,
|
|
740
|
+
body=__body,
|
|
741
|
+
endpoint_id="snapshot.restore",
|
|
742
|
+
path_parts=__path_parts,
|
|
675
743
|
)
|
|
676
744
|
|
|
677
745
|
@_rewrite_parameters()
|
|
@@ -692,7 +760,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
692
760
|
"""
|
|
693
761
|
Returns information about the status of a snapshot.
|
|
694
762
|
|
|
695
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
763
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
696
764
|
|
|
697
765
|
:param repository: A repository name
|
|
698
766
|
:param snapshot: A comma-separated list of snapshot names
|
|
@@ -700,11 +768,18 @@ class SnapshotClient(NamespacedClient):
|
|
|
700
768
|
to false which means a SnapshotMissingException is thrown
|
|
701
769
|
:param master_timeout: Explicit operation timeout for connection to master node
|
|
702
770
|
"""
|
|
771
|
+
__path_parts: t.Dict[str, str]
|
|
703
772
|
if repository not in SKIP_IN_PATH and snapshot not in SKIP_IN_PATH:
|
|
704
|
-
|
|
773
|
+
__path_parts = {
|
|
774
|
+
"repository": _quote(repository),
|
|
775
|
+
"snapshot": _quote(snapshot),
|
|
776
|
+
}
|
|
777
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/{__path_parts["snapshot"]}/_status'
|
|
705
778
|
elif repository not in SKIP_IN_PATH:
|
|
706
|
-
|
|
779
|
+
__path_parts = {"repository": _quote(repository)}
|
|
780
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/_status'
|
|
707
781
|
else:
|
|
782
|
+
__path_parts = {}
|
|
708
783
|
__path = "/_snapshot/_status"
|
|
709
784
|
__query: t.Dict[str, t.Any] = {}
|
|
710
785
|
if error_trace is not None:
|
|
@@ -721,7 +796,12 @@ class SnapshotClient(NamespacedClient):
|
|
|
721
796
|
__query["pretty"] = pretty
|
|
722
797
|
__headers = {"accept": "application/json"}
|
|
723
798
|
return await self.perform_request( # type: ignore[return-value]
|
|
724
|
-
"GET",
|
|
799
|
+
"GET",
|
|
800
|
+
__path,
|
|
801
|
+
params=__query,
|
|
802
|
+
headers=__headers,
|
|
803
|
+
endpoint_id="snapshot.status",
|
|
804
|
+
path_parts=__path_parts,
|
|
725
805
|
)
|
|
726
806
|
|
|
727
807
|
@_rewrite_parameters()
|
|
@@ -741,7 +821,7 @@ class SnapshotClient(NamespacedClient):
|
|
|
741
821
|
"""
|
|
742
822
|
Verifies a repository.
|
|
743
823
|
|
|
744
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
824
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/modules-snapshots.html>`_
|
|
745
825
|
|
|
746
826
|
:param name: A repository name
|
|
747
827
|
:param master_timeout: Explicit operation timeout for connection to master node
|
|
@@ -749,7 +829,8 @@ class SnapshotClient(NamespacedClient):
|
|
|
749
829
|
"""
|
|
750
830
|
if name in SKIP_IN_PATH:
|
|
751
831
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
752
|
-
|
|
832
|
+
__path_parts: t.Dict[str, str] = {"repository": _quote(name)}
|
|
833
|
+
__path = f'/_snapshot/{__path_parts["repository"]}/_verify'
|
|
753
834
|
__query: t.Dict[str, t.Any] = {}
|
|
754
835
|
if error_trace is not None:
|
|
755
836
|
__query["error_trace"] = error_trace
|
|
@@ -765,5 +846,10 @@ class SnapshotClient(NamespacedClient):
|
|
|
765
846
|
__query["timeout"] = timeout
|
|
766
847
|
__headers = {"accept": "application/json"}
|
|
767
848
|
return await self.perform_request( # type: ignore[return-value]
|
|
768
|
-
"POST",
|
|
849
|
+
"POST",
|
|
850
|
+
__path,
|
|
851
|
+
params=__query,
|
|
852
|
+
headers=__headers,
|
|
853
|
+
endpoint_id="snapshot.verify_repository",
|
|
854
|
+
path_parts=__path_parts,
|
|
769
855
|
)
|
|
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class SqlClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters(
|
|
28
29
|
body_fields=("cursor",),
|
|
29
30
|
)
|
|
@@ -40,12 +41,13 @@ class SqlClient(NamespacedClient):
|
|
|
40
41
|
"""
|
|
41
42
|
Clears the SQL cursor
|
|
42
43
|
|
|
43
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
44
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/clear-sql-cursor-api.html>`_
|
|
44
45
|
|
|
45
46
|
:param cursor: Cursor to clear.
|
|
46
47
|
"""
|
|
47
48
|
if cursor is None and body is None:
|
|
48
49
|
raise ValueError("Empty value passed for parameter 'cursor'")
|
|
50
|
+
__path_parts: t.Dict[str, str] = {}
|
|
49
51
|
__path = "/_sql/close"
|
|
50
52
|
__query: t.Dict[str, t.Any] = {}
|
|
51
53
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -62,7 +64,13 @@ class SqlClient(NamespacedClient):
|
|
|
62
64
|
__body["cursor"] = cursor
|
|
63
65
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
64
66
|
return await self.perform_request( # type: ignore[return-value]
|
|
65
|
-
"POST",
|
|
67
|
+
"POST",
|
|
68
|
+
__path,
|
|
69
|
+
params=__query,
|
|
70
|
+
headers=__headers,
|
|
71
|
+
body=__body,
|
|
72
|
+
endpoint_id="sql.clear_cursor",
|
|
73
|
+
path_parts=__path_parts,
|
|
66
74
|
)
|
|
67
75
|
|
|
68
76
|
@_rewrite_parameters()
|
|
@@ -79,13 +87,14 @@ class SqlClient(NamespacedClient):
|
|
|
79
87
|
Deletes an async SQL search or a stored synchronous SQL search. If the search
|
|
80
88
|
is still running, the API cancels it.
|
|
81
89
|
|
|
82
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
90
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-async-sql-search-api.html>`_
|
|
83
91
|
|
|
84
92
|
:param id: Identifier for the search.
|
|
85
93
|
"""
|
|
86
94
|
if id in SKIP_IN_PATH:
|
|
87
95
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
88
|
-
|
|
96
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
97
|
+
__path = f'/_sql/async/delete/{__path_parts["id"]}'
|
|
89
98
|
__query: t.Dict[str, t.Any] = {}
|
|
90
99
|
if error_trace is not None:
|
|
91
100
|
__query["error_trace"] = error_trace
|
|
@@ -97,7 +106,12 @@ class SqlClient(NamespacedClient):
|
|
|
97
106
|
__query["pretty"] = pretty
|
|
98
107
|
__headers = {"accept": "application/json"}
|
|
99
108
|
return await self.perform_request( # type: ignore[return-value]
|
|
100
|
-
"DELETE",
|
|
109
|
+
"DELETE",
|
|
110
|
+
__path,
|
|
111
|
+
params=__query,
|
|
112
|
+
headers=__headers,
|
|
113
|
+
endpoint_id="sql.delete_async",
|
|
114
|
+
path_parts=__path_parts,
|
|
101
115
|
)
|
|
102
116
|
|
|
103
117
|
@_rewrite_parameters()
|
|
@@ -120,7 +134,7 @@ class SqlClient(NamespacedClient):
|
|
|
120
134
|
Returns the current status and available results for an async SQL search or stored
|
|
121
135
|
synchronous SQL search
|
|
122
136
|
|
|
123
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
137
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-async-sql-search-api.html>`_
|
|
124
138
|
|
|
125
139
|
:param id: Identifier for the search.
|
|
126
140
|
:param delimiter: Separator for CSV results. The API only supports this parameter
|
|
@@ -135,7 +149,8 @@ class SqlClient(NamespacedClient):
|
|
|
135
149
|
"""
|
|
136
150
|
if id in SKIP_IN_PATH:
|
|
137
151
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
138
|
-
|
|
152
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
153
|
+
__path = f'/_sql/async/{__path_parts["id"]}'
|
|
139
154
|
__query: t.Dict[str, t.Any] = {}
|
|
140
155
|
if delimiter is not None:
|
|
141
156
|
__query["delimiter"] = delimiter
|
|
@@ -155,7 +170,12 @@ class SqlClient(NamespacedClient):
|
|
|
155
170
|
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
156
171
|
__headers = {"accept": "application/json"}
|
|
157
172
|
return await self.perform_request( # type: ignore[return-value]
|
|
158
|
-
"GET",
|
|
173
|
+
"GET",
|
|
174
|
+
__path,
|
|
175
|
+
params=__query,
|
|
176
|
+
headers=__headers,
|
|
177
|
+
endpoint_id="sql.get_async",
|
|
178
|
+
path_parts=__path_parts,
|
|
159
179
|
)
|
|
160
180
|
|
|
161
181
|
@_rewrite_parameters()
|
|
@@ -172,13 +192,14 @@ class SqlClient(NamespacedClient):
|
|
|
172
192
|
Returns the current status of an async SQL search or a stored synchronous SQL
|
|
173
193
|
search
|
|
174
194
|
|
|
175
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
195
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-async-sql-search-status-api.html>`_
|
|
176
196
|
|
|
177
197
|
:param id: Identifier for the search.
|
|
178
198
|
"""
|
|
179
199
|
if id in SKIP_IN_PATH:
|
|
180
200
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
181
|
-
|
|
201
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
202
|
+
__path = f'/_sql/async/status/{__path_parts["id"]}'
|
|
182
203
|
__query: t.Dict[str, t.Any] = {}
|
|
183
204
|
if error_trace is not None:
|
|
184
205
|
__query["error_trace"] = error_trace
|
|
@@ -190,7 +211,12 @@ class SqlClient(NamespacedClient):
|
|
|
190
211
|
__query["pretty"] = pretty
|
|
191
212
|
__headers = {"accept": "application/json"}
|
|
192
213
|
return await self.perform_request( # type: ignore[return-value]
|
|
193
|
-
"GET",
|
|
214
|
+
"GET",
|
|
215
|
+
__path,
|
|
216
|
+
params=__query,
|
|
217
|
+
headers=__headers,
|
|
218
|
+
endpoint_id="sql.get_async_status",
|
|
219
|
+
path_parts=__path_parts,
|
|
194
220
|
)
|
|
195
221
|
|
|
196
222
|
@_rewrite_parameters(
|
|
@@ -247,7 +273,7 @@ class SqlClient(NamespacedClient):
|
|
|
247
273
|
"""
|
|
248
274
|
Executes a SQL request
|
|
249
275
|
|
|
250
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
276
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/sql-search-api.html>`_
|
|
251
277
|
|
|
252
278
|
:param catalog: Default catalog (cluster) for queries. If unspecified, the queries
|
|
253
279
|
execute on the data in the local cluster only.
|
|
@@ -280,6 +306,7 @@ class SqlClient(NamespacedClient):
|
|
|
280
306
|
to no timeout, meaning the request waits for complete search results. If
|
|
281
307
|
the search doesn’t finish within this period, the search becomes async.
|
|
282
308
|
"""
|
|
309
|
+
__path_parts: t.Dict[str, str] = {}
|
|
283
310
|
__path = "/_sql"
|
|
284
311
|
__query: t.Dict[str, t.Any] = {}
|
|
285
312
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -328,7 +355,13 @@ class SqlClient(NamespacedClient):
|
|
|
328
355
|
__body["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
329
356
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
330
357
|
return await self.perform_request( # type: ignore[return-value]
|
|
331
|
-
"POST",
|
|
358
|
+
"POST",
|
|
359
|
+
__path,
|
|
360
|
+
params=__query,
|
|
361
|
+
headers=__headers,
|
|
362
|
+
body=__body,
|
|
363
|
+
endpoint_id="sql.query",
|
|
364
|
+
path_parts=__path_parts,
|
|
332
365
|
)
|
|
333
366
|
|
|
334
367
|
@_rewrite_parameters(
|
|
@@ -350,7 +383,7 @@ class SqlClient(NamespacedClient):
|
|
|
350
383
|
"""
|
|
351
384
|
Translates SQL into Elasticsearch queries
|
|
352
385
|
|
|
353
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
386
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/sql-translate-api.html>`_
|
|
354
387
|
|
|
355
388
|
:param query: SQL query to run.
|
|
356
389
|
:param fetch_size: The maximum number of rows (or entries) to return in one response.
|
|
@@ -359,6 +392,7 @@ class SqlClient(NamespacedClient):
|
|
|
359
392
|
"""
|
|
360
393
|
if query is None and body is None:
|
|
361
394
|
raise ValueError("Empty value passed for parameter 'query'")
|
|
395
|
+
__path_parts: t.Dict[str, str] = {}
|
|
362
396
|
__path = "/_sql/translate"
|
|
363
397
|
__query: t.Dict[str, t.Any] = {}
|
|
364
398
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -381,5 +415,11 @@ class SqlClient(NamespacedClient):
|
|
|
381
415
|
__body["time_zone"] = time_zone
|
|
382
416
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
383
417
|
return await self.perform_request( # type: ignore[return-value]
|
|
384
|
-
"POST",
|
|
418
|
+
"POST",
|
|
419
|
+
__path,
|
|
420
|
+
params=__query,
|
|
421
|
+
headers=__headers,
|
|
422
|
+
body=__body,
|
|
423
|
+
endpoint_id="sql.translate",
|
|
424
|
+
path_parts=__path_parts,
|
|
385
425
|
)
|
|
@@ -24,6 +24,7 @@ from .utils import _rewrite_parameters
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class SslClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters()
|
|
28
29
|
async def certificates(
|
|
29
30
|
self,
|
|
@@ -37,8 +38,9 @@ class SslClient(NamespacedClient):
|
|
|
37
38
|
Retrieves information about the X.509 certificates used to encrypt communications
|
|
38
39
|
in the cluster.
|
|
39
40
|
|
|
40
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
41
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/security-api-ssl.html>`_
|
|
41
42
|
"""
|
|
43
|
+
__path_parts: t.Dict[str, str] = {}
|
|
42
44
|
__path = "/_ssl/certificates"
|
|
43
45
|
__query: t.Dict[str, t.Any] = {}
|
|
44
46
|
if error_trace is not None:
|
|
@@ -51,5 +53,10 @@ class SslClient(NamespacedClient):
|
|
|
51
53
|
__query["pretty"] = pretty
|
|
52
54
|
__headers = {"accept": "application/json"}
|
|
53
55
|
return await self.perform_request( # type: ignore[return-value]
|
|
54
|
-
"GET",
|
|
56
|
+
"GET",
|
|
57
|
+
__path,
|
|
58
|
+
params=__query,
|
|
59
|
+
headers=__headers,
|
|
60
|
+
endpoint_id="ssl.certificates",
|
|
61
|
+
path_parts=__path_parts,
|
|
55
62
|
)
|