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 IndicesClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters()
|
|
28
29
|
async def add_block(
|
|
29
30
|
self,
|
|
@@ -52,7 +53,7 @@ class IndicesClient(NamespacedClient):
|
|
|
52
53
|
"""
|
|
53
54
|
Adds a block to an index.
|
|
54
55
|
|
|
55
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
56
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/index-modules-blocks.html>`_
|
|
56
57
|
|
|
57
58
|
:param index: A comma separated list of indices to add a block to
|
|
58
59
|
:param block: The block to add (one of read, write, read_only or metadata)
|
|
@@ -70,7 +71,11 @@ class IndicesClient(NamespacedClient):
|
|
|
70
71
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
71
72
|
if block in SKIP_IN_PATH:
|
|
72
73
|
raise ValueError("Empty value passed for parameter 'block'")
|
|
73
|
-
|
|
74
|
+
__path_parts: t.Dict[str, str] = {
|
|
75
|
+
"index": _quote(index),
|
|
76
|
+
"block": _quote(block),
|
|
77
|
+
}
|
|
78
|
+
__path = f'/{__path_parts["index"]}/_block/{__path_parts["block"]}'
|
|
74
79
|
__query: t.Dict[str, t.Any] = {}
|
|
75
80
|
if allow_no_indices is not None:
|
|
76
81
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -92,7 +97,12 @@ class IndicesClient(NamespacedClient):
|
|
|
92
97
|
__query["timeout"] = timeout
|
|
93
98
|
__headers = {"accept": "application/json"}
|
|
94
99
|
return await self.perform_request( # type: ignore[return-value]
|
|
95
|
-
"PUT",
|
|
100
|
+
"PUT",
|
|
101
|
+
__path,
|
|
102
|
+
params=__query,
|
|
103
|
+
headers=__headers,
|
|
104
|
+
endpoint_id="indices.add_block",
|
|
105
|
+
path_parts=__path_parts,
|
|
96
106
|
)
|
|
97
107
|
|
|
98
108
|
@_rewrite_parameters(
|
|
@@ -131,7 +141,7 @@ class IndicesClient(NamespacedClient):
|
|
|
131
141
|
Performs the analysis process on a text and return the tokens breakdown of the
|
|
132
142
|
text.
|
|
133
143
|
|
|
134
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
144
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-analyze.html>`_
|
|
135
145
|
|
|
136
146
|
:param index: Index used to derive the analyzer. If specified, the `analyzer`
|
|
137
147
|
or field parameter overrides this value. If no index is specified or the
|
|
@@ -154,9 +164,12 @@ class IndicesClient(NamespacedClient):
|
|
|
154
164
|
as a multi-value field.
|
|
155
165
|
:param tokenizer: Tokenizer to use to convert text into tokens.
|
|
156
166
|
"""
|
|
167
|
+
__path_parts: t.Dict[str, str]
|
|
157
168
|
if index not in SKIP_IN_PATH:
|
|
158
|
-
|
|
169
|
+
__path_parts = {"index": _quote(index)}
|
|
170
|
+
__path = f'/{__path_parts["index"]}/_analyze'
|
|
159
171
|
else:
|
|
172
|
+
__path_parts = {}
|
|
160
173
|
__path = "/_analyze"
|
|
161
174
|
__query: t.Dict[str, t.Any] = {}
|
|
162
175
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -193,7 +206,13 @@ class IndicesClient(NamespacedClient):
|
|
|
193
206
|
if __body is not None:
|
|
194
207
|
__headers["content-type"] = "application/json"
|
|
195
208
|
return await self.perform_request( # type: ignore[return-value]
|
|
196
|
-
"POST",
|
|
209
|
+
"POST",
|
|
210
|
+
__path,
|
|
211
|
+
params=__query,
|
|
212
|
+
headers=__headers,
|
|
213
|
+
body=__body,
|
|
214
|
+
endpoint_id="indices.analyze",
|
|
215
|
+
path_parts=__path_parts,
|
|
197
216
|
)
|
|
198
217
|
|
|
199
218
|
@_rewrite_parameters()
|
|
@@ -223,7 +242,7 @@ class IndicesClient(NamespacedClient):
|
|
|
223
242
|
"""
|
|
224
243
|
Clears all or specific caches for one or more indices.
|
|
225
244
|
|
|
226
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
245
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-clearcache.html>`_
|
|
227
246
|
|
|
228
247
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
229
248
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -244,9 +263,12 @@ class IndicesClient(NamespacedClient):
|
|
|
244
263
|
:param query: If `true`, clears the query cache.
|
|
245
264
|
:param request: If `true`, clears the request cache.
|
|
246
265
|
"""
|
|
266
|
+
__path_parts: t.Dict[str, str]
|
|
247
267
|
if index not in SKIP_IN_PATH:
|
|
248
|
-
|
|
268
|
+
__path_parts = {"index": _quote(index)}
|
|
269
|
+
__path = f'/{__path_parts["index"]}/_cache/clear'
|
|
249
270
|
else:
|
|
271
|
+
__path_parts = {}
|
|
250
272
|
__path = "/_cache/clear"
|
|
251
273
|
__query: t.Dict[str, t.Any] = {}
|
|
252
274
|
if allow_no_indices is not None:
|
|
@@ -273,7 +295,12 @@ class IndicesClient(NamespacedClient):
|
|
|
273
295
|
__query["request"] = request
|
|
274
296
|
__headers = {"accept": "application/json"}
|
|
275
297
|
return await self.perform_request( # type: ignore[return-value]
|
|
276
|
-
"POST",
|
|
298
|
+
"POST",
|
|
299
|
+
__path,
|
|
300
|
+
params=__query,
|
|
301
|
+
headers=__headers,
|
|
302
|
+
endpoint_id="indices.clear_cache",
|
|
303
|
+
path_parts=__path_parts,
|
|
277
304
|
)
|
|
278
305
|
|
|
279
306
|
@_rewrite_parameters(
|
|
@@ -302,7 +329,7 @@ class IndicesClient(NamespacedClient):
|
|
|
302
329
|
"""
|
|
303
330
|
Clones an index
|
|
304
331
|
|
|
305
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
332
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-clone-index.html>`_
|
|
306
333
|
|
|
307
334
|
:param index: Name of the source index to clone.
|
|
308
335
|
:param target: Name of the target index to create.
|
|
@@ -321,7 +348,11 @@ class IndicesClient(NamespacedClient):
|
|
|
321
348
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
322
349
|
if target in SKIP_IN_PATH:
|
|
323
350
|
raise ValueError("Empty value passed for parameter 'target'")
|
|
324
|
-
|
|
351
|
+
__path_parts: t.Dict[str, str] = {
|
|
352
|
+
"index": _quote(index),
|
|
353
|
+
"target": _quote(target),
|
|
354
|
+
}
|
|
355
|
+
__path = f'/{__path_parts["index"]}/_clone/{__path_parts["target"]}'
|
|
325
356
|
__query: t.Dict[str, t.Any] = {}
|
|
326
357
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
327
358
|
if error_trace is not None:
|
|
@@ -349,7 +380,13 @@ class IndicesClient(NamespacedClient):
|
|
|
349
380
|
if __body is not None:
|
|
350
381
|
__headers["content-type"] = "application/json"
|
|
351
382
|
return await self.perform_request( # type: ignore[return-value]
|
|
352
|
-
"PUT",
|
|
383
|
+
"PUT",
|
|
384
|
+
__path,
|
|
385
|
+
params=__query,
|
|
386
|
+
headers=__headers,
|
|
387
|
+
body=__body,
|
|
388
|
+
endpoint_id="indices.clone",
|
|
389
|
+
path_parts=__path_parts,
|
|
353
390
|
)
|
|
354
391
|
|
|
355
392
|
@_rewrite_parameters()
|
|
@@ -382,7 +419,7 @@ class IndicesClient(NamespacedClient):
|
|
|
382
419
|
"""
|
|
383
420
|
Closes an index.
|
|
384
421
|
|
|
385
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
422
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-close.html>`_
|
|
386
423
|
|
|
387
424
|
:param index: Comma-separated list or wildcard expression of index names used
|
|
388
425
|
to limit the request.
|
|
@@ -406,7 +443,8 @@ class IndicesClient(NamespacedClient):
|
|
|
406
443
|
"""
|
|
407
444
|
if index in SKIP_IN_PATH:
|
|
408
445
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
409
|
-
|
|
446
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
447
|
+
__path = f'/{__path_parts["index"]}/_close'
|
|
410
448
|
__query: t.Dict[str, t.Any] = {}
|
|
411
449
|
if allow_no_indices is not None:
|
|
412
450
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -430,7 +468,12 @@ class IndicesClient(NamespacedClient):
|
|
|
430
468
|
__query["wait_for_active_shards"] = wait_for_active_shards
|
|
431
469
|
__headers = {"accept": "application/json"}
|
|
432
470
|
return await self.perform_request( # type: ignore[return-value]
|
|
433
|
-
"POST",
|
|
471
|
+
"POST",
|
|
472
|
+
__path,
|
|
473
|
+
params=__query,
|
|
474
|
+
headers=__headers,
|
|
475
|
+
endpoint_id="indices.close",
|
|
476
|
+
path_parts=__path_parts,
|
|
434
477
|
)
|
|
435
478
|
|
|
436
479
|
@_rewrite_parameters(
|
|
@@ -459,7 +502,7 @@ class IndicesClient(NamespacedClient):
|
|
|
459
502
|
"""
|
|
460
503
|
Creates an index with optional settings and mappings.
|
|
461
504
|
|
|
462
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
505
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-create-index.html>`_
|
|
463
506
|
|
|
464
507
|
:param index: Name of the index you wish to create.
|
|
465
508
|
:param aliases: Aliases for the index.
|
|
@@ -477,7 +520,8 @@ class IndicesClient(NamespacedClient):
|
|
|
477
520
|
"""
|
|
478
521
|
if index in SKIP_IN_PATH:
|
|
479
522
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
480
|
-
|
|
523
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
524
|
+
__path = f'/{__path_parts["index"]}'
|
|
481
525
|
__query: t.Dict[str, t.Any] = {}
|
|
482
526
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
483
527
|
if error_trace is not None:
|
|
@@ -507,7 +551,13 @@ class IndicesClient(NamespacedClient):
|
|
|
507
551
|
if __body is not None:
|
|
508
552
|
__headers["content-type"] = "application/json"
|
|
509
553
|
return await self.perform_request( # type: ignore[return-value]
|
|
510
|
-
"PUT",
|
|
554
|
+
"PUT",
|
|
555
|
+
__path,
|
|
556
|
+
params=__query,
|
|
557
|
+
headers=__headers,
|
|
558
|
+
body=__body,
|
|
559
|
+
endpoint_id="indices.create",
|
|
560
|
+
path_parts=__path_parts,
|
|
511
561
|
)
|
|
512
562
|
|
|
513
563
|
@_rewrite_parameters()
|
|
@@ -523,7 +573,7 @@ class IndicesClient(NamespacedClient):
|
|
|
523
573
|
"""
|
|
524
574
|
Creates a data stream
|
|
525
575
|
|
|
526
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
576
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams.html>`_
|
|
527
577
|
|
|
528
578
|
:param name: Name of the data stream, which must meet the following criteria:
|
|
529
579
|
Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`,
|
|
@@ -533,7 +583,8 @@ class IndicesClient(NamespacedClient):
|
|
|
533
583
|
"""
|
|
534
584
|
if name in SKIP_IN_PATH:
|
|
535
585
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
536
|
-
|
|
586
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
587
|
+
__path = f'/_data_stream/{__path_parts["name"]}'
|
|
537
588
|
__query: t.Dict[str, t.Any] = {}
|
|
538
589
|
if error_trace is not None:
|
|
539
590
|
__query["error_trace"] = error_trace
|
|
@@ -545,7 +596,12 @@ class IndicesClient(NamespacedClient):
|
|
|
545
596
|
__query["pretty"] = pretty
|
|
546
597
|
__headers = {"accept": "application/json"}
|
|
547
598
|
return await self.perform_request( # type: ignore[return-value]
|
|
548
|
-
"PUT",
|
|
599
|
+
"PUT",
|
|
600
|
+
__path,
|
|
601
|
+
params=__query,
|
|
602
|
+
headers=__headers,
|
|
603
|
+
endpoint_id="indices.create_data_stream",
|
|
604
|
+
path_parts=__path_parts,
|
|
549
605
|
)
|
|
550
606
|
|
|
551
607
|
@_rewrite_parameters()
|
|
@@ -569,7 +625,7 @@ class IndicesClient(NamespacedClient):
|
|
|
569
625
|
"""
|
|
570
626
|
Provides statistics on operations happening in a data stream.
|
|
571
627
|
|
|
572
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
628
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams.html>`_
|
|
573
629
|
|
|
574
630
|
:param name: Comma-separated list of data streams used to limit the request.
|
|
575
631
|
Wildcard expressions (`*`) are supported. To target all data streams in a
|
|
@@ -577,9 +633,12 @@ class IndicesClient(NamespacedClient):
|
|
|
577
633
|
:param expand_wildcards: Type of data stream that wildcard patterns can match.
|
|
578
634
|
Supports comma-separated values, such as `open,hidden`.
|
|
579
635
|
"""
|
|
636
|
+
__path_parts: t.Dict[str, str]
|
|
580
637
|
if name not in SKIP_IN_PATH:
|
|
581
|
-
|
|
638
|
+
__path_parts = {"name": _quote(name)}
|
|
639
|
+
__path = f'/_data_stream/{__path_parts["name"]}/_stats'
|
|
582
640
|
else:
|
|
641
|
+
__path_parts = {}
|
|
583
642
|
__path = "/_data_stream/_stats"
|
|
584
643
|
__query: t.Dict[str, t.Any] = {}
|
|
585
644
|
if error_trace is not None:
|
|
@@ -594,7 +653,12 @@ class IndicesClient(NamespacedClient):
|
|
|
594
653
|
__query["pretty"] = pretty
|
|
595
654
|
__headers = {"accept": "application/json"}
|
|
596
655
|
return await self.perform_request( # type: ignore[return-value]
|
|
597
|
-
"GET",
|
|
656
|
+
"GET",
|
|
657
|
+
__path,
|
|
658
|
+
params=__query,
|
|
659
|
+
headers=__headers,
|
|
660
|
+
endpoint_id="indices.data_streams_stats",
|
|
661
|
+
path_parts=__path_parts,
|
|
598
662
|
)
|
|
599
663
|
|
|
600
664
|
@_rewrite_parameters()
|
|
@@ -624,7 +688,7 @@ class IndicesClient(NamespacedClient):
|
|
|
624
688
|
"""
|
|
625
689
|
Deletes an index.
|
|
626
690
|
|
|
627
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
691
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-delete-index.html>`_
|
|
628
692
|
|
|
629
693
|
:param index: Comma-separated list of indices to delete. You cannot specify index
|
|
630
694
|
aliases. By default, this parameter does not support wildcards (`*`) or `_all`.
|
|
@@ -647,7 +711,8 @@ class IndicesClient(NamespacedClient):
|
|
|
647
711
|
"""
|
|
648
712
|
if index in SKIP_IN_PATH:
|
|
649
713
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
650
|
-
|
|
714
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
715
|
+
__path = f'/{__path_parts["index"]}'
|
|
651
716
|
__query: t.Dict[str, t.Any] = {}
|
|
652
717
|
if allow_no_indices is not None:
|
|
653
718
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -669,7 +734,12 @@ class IndicesClient(NamespacedClient):
|
|
|
669
734
|
__query["timeout"] = timeout
|
|
670
735
|
__headers = {"accept": "application/json"}
|
|
671
736
|
return await self.perform_request( # type: ignore[return-value]
|
|
672
|
-
"DELETE",
|
|
737
|
+
"DELETE",
|
|
738
|
+
__path,
|
|
739
|
+
params=__query,
|
|
740
|
+
headers=__headers,
|
|
741
|
+
endpoint_id="indices.delete",
|
|
742
|
+
path_parts=__path_parts,
|
|
673
743
|
)
|
|
674
744
|
|
|
675
745
|
@_rewrite_parameters()
|
|
@@ -690,7 +760,7 @@ class IndicesClient(NamespacedClient):
|
|
|
690
760
|
"""
|
|
691
761
|
Deletes an alias.
|
|
692
762
|
|
|
693
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
763
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-aliases.html>`_
|
|
694
764
|
|
|
695
765
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
696
766
|
request. Supports wildcards (`*`).
|
|
@@ -706,7 +776,8 @@ class IndicesClient(NamespacedClient):
|
|
|
706
776
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
707
777
|
if name in SKIP_IN_PATH:
|
|
708
778
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
709
|
-
|
|
779
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "name": _quote(name)}
|
|
780
|
+
__path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}'
|
|
710
781
|
__query: t.Dict[str, t.Any] = {}
|
|
711
782
|
if error_trace is not None:
|
|
712
783
|
__query["error_trace"] = error_trace
|
|
@@ -722,7 +793,12 @@ class IndicesClient(NamespacedClient):
|
|
|
722
793
|
__query["timeout"] = timeout
|
|
723
794
|
__headers = {"accept": "application/json"}
|
|
724
795
|
return await self.perform_request( # type: ignore[return-value]
|
|
725
|
-
"DELETE",
|
|
796
|
+
"DELETE",
|
|
797
|
+
__path,
|
|
798
|
+
params=__query,
|
|
799
|
+
headers=__headers,
|
|
800
|
+
endpoint_id="indices.delete_alias",
|
|
801
|
+
path_parts=__path_parts,
|
|
726
802
|
)
|
|
727
803
|
|
|
728
804
|
@_rewrite_parameters()
|
|
@@ -750,7 +826,7 @@ class IndicesClient(NamespacedClient):
|
|
|
750
826
|
"""
|
|
751
827
|
Deletes the data stream lifecycle of the selected data streams.
|
|
752
828
|
|
|
753
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
829
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams-delete-lifecycle.html>`_
|
|
754
830
|
|
|
755
831
|
:param name: A comma-separated list of data streams of which the data stream
|
|
756
832
|
lifecycle will be deleted; use `*` to get all data streams
|
|
@@ -761,7 +837,8 @@ class IndicesClient(NamespacedClient):
|
|
|
761
837
|
"""
|
|
762
838
|
if name in SKIP_IN_PATH:
|
|
763
839
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
764
|
-
|
|
840
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
841
|
+
__path = f'/_data_stream/{__path_parts["name"]}/_lifecycle'
|
|
765
842
|
__query: t.Dict[str, t.Any] = {}
|
|
766
843
|
if error_trace is not None:
|
|
767
844
|
__query["error_trace"] = error_trace
|
|
@@ -779,7 +856,12 @@ class IndicesClient(NamespacedClient):
|
|
|
779
856
|
__query["timeout"] = timeout
|
|
780
857
|
__headers = {"accept": "application/json"}
|
|
781
858
|
return await self.perform_request( # type: ignore[return-value]
|
|
782
|
-
"DELETE",
|
|
859
|
+
"DELETE",
|
|
860
|
+
__path,
|
|
861
|
+
params=__query,
|
|
862
|
+
headers=__headers,
|
|
863
|
+
endpoint_id="indices.delete_data_lifecycle",
|
|
864
|
+
path_parts=__path_parts,
|
|
783
865
|
)
|
|
784
866
|
|
|
785
867
|
@_rewrite_parameters()
|
|
@@ -803,7 +885,7 @@ class IndicesClient(NamespacedClient):
|
|
|
803
885
|
"""
|
|
804
886
|
Deletes a data stream.
|
|
805
887
|
|
|
806
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
888
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams.html>`_
|
|
807
889
|
|
|
808
890
|
:param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions
|
|
809
891
|
are supported.
|
|
@@ -812,7 +894,8 @@ class IndicesClient(NamespacedClient):
|
|
|
812
894
|
"""
|
|
813
895
|
if name in SKIP_IN_PATH:
|
|
814
896
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
815
|
-
|
|
897
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
898
|
+
__path = f'/_data_stream/{__path_parts["name"]}'
|
|
816
899
|
__query: t.Dict[str, t.Any] = {}
|
|
817
900
|
if error_trace is not None:
|
|
818
901
|
__query["error_trace"] = error_trace
|
|
@@ -826,7 +909,12 @@ class IndicesClient(NamespacedClient):
|
|
|
826
909
|
__query["pretty"] = pretty
|
|
827
910
|
__headers = {"accept": "application/json"}
|
|
828
911
|
return await self.perform_request( # type: ignore[return-value]
|
|
829
|
-
"DELETE",
|
|
912
|
+
"DELETE",
|
|
913
|
+
__path,
|
|
914
|
+
params=__query,
|
|
915
|
+
headers=__headers,
|
|
916
|
+
endpoint_id="indices.delete_data_stream",
|
|
917
|
+
path_parts=__path_parts,
|
|
830
918
|
)
|
|
831
919
|
|
|
832
920
|
@_rewrite_parameters()
|
|
@@ -846,7 +934,7 @@ class IndicesClient(NamespacedClient):
|
|
|
846
934
|
"""
|
|
847
935
|
Deletes an index template.
|
|
848
936
|
|
|
849
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
937
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-delete-template.html>`_
|
|
850
938
|
|
|
851
939
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
852
940
|
Wildcard (*) expressions are supported.
|
|
@@ -858,7 +946,8 @@ class IndicesClient(NamespacedClient):
|
|
|
858
946
|
"""
|
|
859
947
|
if name in SKIP_IN_PATH:
|
|
860
948
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
861
|
-
|
|
949
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
950
|
+
__path = f'/_index_template/{__path_parts["name"]}'
|
|
862
951
|
__query: t.Dict[str, t.Any] = {}
|
|
863
952
|
if error_trace is not None:
|
|
864
953
|
__query["error_trace"] = error_trace
|
|
@@ -874,7 +963,12 @@ class IndicesClient(NamespacedClient):
|
|
|
874
963
|
__query["timeout"] = timeout
|
|
875
964
|
__headers = {"accept": "application/json"}
|
|
876
965
|
return await self.perform_request( # type: ignore[return-value]
|
|
877
|
-
"DELETE",
|
|
966
|
+
"DELETE",
|
|
967
|
+
__path,
|
|
968
|
+
params=__query,
|
|
969
|
+
headers=__headers,
|
|
970
|
+
endpoint_id="indices.delete_index_template",
|
|
971
|
+
path_parts=__path_parts,
|
|
878
972
|
)
|
|
879
973
|
|
|
880
974
|
@_rewrite_parameters()
|
|
@@ -894,7 +988,7 @@ class IndicesClient(NamespacedClient):
|
|
|
894
988
|
"""
|
|
895
989
|
Deletes an index template.
|
|
896
990
|
|
|
897
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
991
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-delete-template-v1.html>`_
|
|
898
992
|
|
|
899
993
|
:param name: The name of the legacy index template to delete. Wildcard (`*`)
|
|
900
994
|
expressions are supported.
|
|
@@ -906,7 +1000,8 @@ class IndicesClient(NamespacedClient):
|
|
|
906
1000
|
"""
|
|
907
1001
|
if name in SKIP_IN_PATH:
|
|
908
1002
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
909
|
-
|
|
1003
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
1004
|
+
__path = f'/_template/{__path_parts["name"]}'
|
|
910
1005
|
__query: t.Dict[str, t.Any] = {}
|
|
911
1006
|
if error_trace is not None:
|
|
912
1007
|
__query["error_trace"] = error_trace
|
|
@@ -922,7 +1017,12 @@ class IndicesClient(NamespacedClient):
|
|
|
922
1017
|
__query["timeout"] = timeout
|
|
923
1018
|
__headers = {"accept": "application/json"}
|
|
924
1019
|
return await self.perform_request( # type: ignore[return-value]
|
|
925
|
-
"DELETE",
|
|
1020
|
+
"DELETE",
|
|
1021
|
+
__path,
|
|
1022
|
+
params=__query,
|
|
1023
|
+
headers=__headers,
|
|
1024
|
+
endpoint_id="indices.delete_template",
|
|
1025
|
+
path_parts=__path_parts,
|
|
926
1026
|
)
|
|
927
1027
|
|
|
928
1028
|
@_rewrite_parameters()
|
|
@@ -950,7 +1050,7 @@ class IndicesClient(NamespacedClient):
|
|
|
950
1050
|
"""
|
|
951
1051
|
Analyzes the disk usage of each field of an index or data stream
|
|
952
1052
|
|
|
953
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1053
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-disk-usage.html>`_
|
|
954
1054
|
|
|
955
1055
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
956
1056
|
to limit the request. It’s recommended to execute this API with a single
|
|
@@ -974,7 +1074,8 @@ class IndicesClient(NamespacedClient):
|
|
|
974
1074
|
"""
|
|
975
1075
|
if index in SKIP_IN_PATH:
|
|
976
1076
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
977
|
-
|
|
1077
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
1078
|
+
__path = f'/{__path_parts["index"]}/_disk_usage'
|
|
978
1079
|
__query: t.Dict[str, t.Any] = {}
|
|
979
1080
|
if allow_no_indices is not None:
|
|
980
1081
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -996,7 +1097,12 @@ class IndicesClient(NamespacedClient):
|
|
|
996
1097
|
__query["run_expensive_tasks"] = run_expensive_tasks
|
|
997
1098
|
__headers = {"accept": "application/json"}
|
|
998
1099
|
return await self.perform_request( # type: ignore[return-value]
|
|
999
|
-
"POST",
|
|
1100
|
+
"POST",
|
|
1101
|
+
__path,
|
|
1102
|
+
params=__query,
|
|
1103
|
+
headers=__headers,
|
|
1104
|
+
endpoint_id="indices.disk_usage",
|
|
1105
|
+
path_parts=__path_parts,
|
|
1000
1106
|
)
|
|
1001
1107
|
|
|
1002
1108
|
@_rewrite_parameters(
|
|
@@ -1017,7 +1123,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1017
1123
|
"""
|
|
1018
1124
|
Downsample an index
|
|
1019
1125
|
|
|
1020
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1126
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-downsample-data-stream.html>`_
|
|
1021
1127
|
|
|
1022
1128
|
:param index: Name of the time series index to downsample.
|
|
1023
1129
|
:param target_index: Name of the index to create.
|
|
@@ -1033,7 +1139,11 @@ class IndicesClient(NamespacedClient):
|
|
|
1033
1139
|
)
|
|
1034
1140
|
elif config is not None and body is not None:
|
|
1035
1141
|
raise ValueError("Cannot set both 'config' and 'body'")
|
|
1036
|
-
|
|
1142
|
+
__path_parts: t.Dict[str, str] = {
|
|
1143
|
+
"index": _quote(index),
|
|
1144
|
+
"target_index": _quote(target_index),
|
|
1145
|
+
}
|
|
1146
|
+
__path = f'/{__path_parts["index"]}/_downsample/{__path_parts["target_index"]}'
|
|
1037
1147
|
__query: t.Dict[str, t.Any] = {}
|
|
1038
1148
|
if error_trace is not None:
|
|
1039
1149
|
__query["error_trace"] = error_trace
|
|
@@ -1046,7 +1156,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1046
1156
|
__body = config if config is not None else body
|
|
1047
1157
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
1048
1158
|
return await self.perform_request( # type: ignore[return-value]
|
|
1049
|
-
"POST",
|
|
1159
|
+
"POST",
|
|
1160
|
+
__path,
|
|
1161
|
+
params=__query,
|
|
1162
|
+
headers=__headers,
|
|
1163
|
+
body=__body,
|
|
1164
|
+
endpoint_id="indices.downsample",
|
|
1165
|
+
path_parts=__path_parts,
|
|
1050
1166
|
)
|
|
1051
1167
|
|
|
1052
1168
|
@_rewrite_parameters()
|
|
@@ -1075,7 +1191,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1075
1191
|
"""
|
|
1076
1192
|
Returns information about whether a particular index exists.
|
|
1077
1193
|
|
|
1078
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1194
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-exists.html>`_
|
|
1079
1195
|
|
|
1080
1196
|
:param index: Comma-separated list of data streams, indices, and aliases. Supports
|
|
1081
1197
|
wildcards (`*`).
|
|
@@ -1095,7 +1211,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1095
1211
|
"""
|
|
1096
1212
|
if index in SKIP_IN_PATH:
|
|
1097
1213
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
1098
|
-
|
|
1214
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
1215
|
+
__path = f'/{__path_parts["index"]}'
|
|
1099
1216
|
__query: t.Dict[str, t.Any] = {}
|
|
1100
1217
|
if allow_no_indices is not None:
|
|
1101
1218
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -1119,7 +1236,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1119
1236
|
__query["pretty"] = pretty
|
|
1120
1237
|
__headers = {"accept": "application/json"}
|
|
1121
1238
|
return await self.perform_request( # type: ignore[return-value]
|
|
1122
|
-
"HEAD",
|
|
1239
|
+
"HEAD",
|
|
1240
|
+
__path,
|
|
1241
|
+
params=__query,
|
|
1242
|
+
headers=__headers,
|
|
1243
|
+
endpoint_id="indices.exists",
|
|
1244
|
+
path_parts=__path_parts,
|
|
1123
1245
|
)
|
|
1124
1246
|
|
|
1125
1247
|
@_rewrite_parameters()
|
|
@@ -1147,7 +1269,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1147
1269
|
"""
|
|
1148
1270
|
Returns information about whether a particular alias exists.
|
|
1149
1271
|
|
|
1150
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1272
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-aliases.html>`_
|
|
1151
1273
|
|
|
1152
1274
|
:param name: Comma-separated list of aliases to check. Supports wildcards (`*`).
|
|
1153
1275
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
@@ -1167,10 +1289,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1167
1289
|
"""
|
|
1168
1290
|
if name in SKIP_IN_PATH:
|
|
1169
1291
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
1292
|
+
__path_parts: t.Dict[str, str]
|
|
1170
1293
|
if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH:
|
|
1171
|
-
|
|
1294
|
+
__path_parts = {"index": _quote(index), "name": _quote(name)}
|
|
1295
|
+
__path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}'
|
|
1172
1296
|
elif name not in SKIP_IN_PATH:
|
|
1173
|
-
|
|
1297
|
+
__path_parts = {"name": _quote(name)}
|
|
1298
|
+
__path = f'/_alias/{__path_parts["name"]}'
|
|
1174
1299
|
else:
|
|
1175
1300
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
1176
1301
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -1192,7 +1317,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1192
1317
|
__query["pretty"] = pretty
|
|
1193
1318
|
__headers = {"accept": "application/json"}
|
|
1194
1319
|
return await self.perform_request( # type: ignore[return-value]
|
|
1195
|
-
"HEAD",
|
|
1320
|
+
"HEAD",
|
|
1321
|
+
__path,
|
|
1322
|
+
params=__query,
|
|
1323
|
+
headers=__headers,
|
|
1324
|
+
endpoint_id="indices.exists_alias",
|
|
1325
|
+
path_parts=__path_parts,
|
|
1196
1326
|
)
|
|
1197
1327
|
|
|
1198
1328
|
@_rewrite_parameters()
|
|
@@ -1211,7 +1341,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1211
1341
|
"""
|
|
1212
1342
|
Returns information about whether a particular index template exists.
|
|
1213
1343
|
|
|
1214
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1344
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/index-templates.html>`_
|
|
1215
1345
|
|
|
1216
1346
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
1217
1347
|
Wildcard (*) expressions are supported.
|
|
@@ -1221,7 +1351,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1221
1351
|
"""
|
|
1222
1352
|
if name in SKIP_IN_PATH:
|
|
1223
1353
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
1224
|
-
|
|
1354
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
1355
|
+
__path = f'/_index_template/{__path_parts["name"]}'
|
|
1225
1356
|
__query: t.Dict[str, t.Any] = {}
|
|
1226
1357
|
if error_trace is not None:
|
|
1227
1358
|
__query["error_trace"] = error_trace
|
|
@@ -1235,7 +1366,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1235
1366
|
__query["pretty"] = pretty
|
|
1236
1367
|
__headers = {"accept": "application/json"}
|
|
1237
1368
|
return await self.perform_request( # type: ignore[return-value]
|
|
1238
|
-
"HEAD",
|
|
1369
|
+
"HEAD",
|
|
1370
|
+
__path,
|
|
1371
|
+
params=__query,
|
|
1372
|
+
headers=__headers,
|
|
1373
|
+
endpoint_id="indices.exists_index_template",
|
|
1374
|
+
path_parts=__path_parts,
|
|
1239
1375
|
)
|
|
1240
1376
|
|
|
1241
1377
|
@_rewrite_parameters()
|
|
@@ -1256,7 +1392,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1256
1392
|
"""
|
|
1257
1393
|
Returns information about whether a particular index template exists.
|
|
1258
1394
|
|
|
1259
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1395
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-template-exists-v1.html>`_
|
|
1260
1396
|
|
|
1261
1397
|
:param name: The comma separated names of the index templates
|
|
1262
1398
|
:param flat_settings: Return settings in flat format (default: false)
|
|
@@ -1266,7 +1402,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1266
1402
|
"""
|
|
1267
1403
|
if name in SKIP_IN_PATH:
|
|
1268
1404
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
1269
|
-
|
|
1405
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
1406
|
+
__path = f'/_template/{__path_parts["name"]}'
|
|
1270
1407
|
__query: t.Dict[str, t.Any] = {}
|
|
1271
1408
|
if error_trace is not None:
|
|
1272
1409
|
__query["error_trace"] = error_trace
|
|
@@ -1284,7 +1421,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1284
1421
|
__query["pretty"] = pretty
|
|
1285
1422
|
__headers = {"accept": "application/json"}
|
|
1286
1423
|
return await self.perform_request( # type: ignore[return-value]
|
|
1287
|
-
"HEAD",
|
|
1424
|
+
"HEAD",
|
|
1425
|
+
__path,
|
|
1426
|
+
params=__query,
|
|
1427
|
+
headers=__headers,
|
|
1428
|
+
endpoint_id="indices.exists_template",
|
|
1429
|
+
path_parts=__path_parts,
|
|
1288
1430
|
)
|
|
1289
1431
|
|
|
1290
1432
|
@_rewrite_parameters()
|
|
@@ -1305,7 +1447,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1305
1447
|
Retrieves information about the index's current data stream lifecycle, such as
|
|
1306
1448
|
any potential encountered error, time since creation etc.
|
|
1307
1449
|
|
|
1308
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1450
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams-explain-lifecycle.html>`_
|
|
1309
1451
|
|
|
1310
1452
|
:param index: The name of the index to explain
|
|
1311
1453
|
:param include_defaults: indicates if the API should return the default values
|
|
@@ -1314,7 +1456,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1314
1456
|
"""
|
|
1315
1457
|
if index in SKIP_IN_PATH:
|
|
1316
1458
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
1317
|
-
|
|
1459
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
1460
|
+
__path = f'/{__path_parts["index"]}/_lifecycle/explain'
|
|
1318
1461
|
__query: t.Dict[str, t.Any] = {}
|
|
1319
1462
|
if error_trace is not None:
|
|
1320
1463
|
__query["error_trace"] = error_trace
|
|
@@ -1330,7 +1473,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1330
1473
|
__query["pretty"] = pretty
|
|
1331
1474
|
__headers = {"accept": "application/json"}
|
|
1332
1475
|
return await self.perform_request( # type: ignore[return-value]
|
|
1333
|
-
"GET",
|
|
1476
|
+
"GET",
|
|
1477
|
+
__path,
|
|
1478
|
+
params=__query,
|
|
1479
|
+
headers=__headers,
|
|
1480
|
+
endpoint_id="indices.explain_data_lifecycle",
|
|
1481
|
+
path_parts=__path_parts,
|
|
1334
1482
|
)
|
|
1335
1483
|
|
|
1336
1484
|
@_rewrite_parameters()
|
|
@@ -1364,7 +1512,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1364
1512
|
"""
|
|
1365
1513
|
Returns the field usage stats for each field of an index
|
|
1366
1514
|
|
|
1367
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1515
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/field-usage-stats.html>`_
|
|
1368
1516
|
|
|
1369
1517
|
:param index: Comma-separated list or wildcard expression of index names used
|
|
1370
1518
|
to limit the request.
|
|
@@ -1392,7 +1540,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1392
1540
|
"""
|
|
1393
1541
|
if index in SKIP_IN_PATH:
|
|
1394
1542
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
1395
|
-
|
|
1543
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
1544
|
+
__path = f'/{__path_parts["index"]}/_field_usage_stats'
|
|
1396
1545
|
__query: t.Dict[str, t.Any] = {}
|
|
1397
1546
|
if allow_no_indices is not None:
|
|
1398
1547
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -1418,7 +1567,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1418
1567
|
__query["wait_for_active_shards"] = wait_for_active_shards
|
|
1419
1568
|
__headers = {"accept": "application/json"}
|
|
1420
1569
|
return await self.perform_request( # type: ignore[return-value]
|
|
1421
|
-
"GET",
|
|
1570
|
+
"GET",
|
|
1571
|
+
__path,
|
|
1572
|
+
params=__query,
|
|
1573
|
+
headers=__headers,
|
|
1574
|
+
endpoint_id="indices.field_usage_stats",
|
|
1575
|
+
path_parts=__path_parts,
|
|
1422
1576
|
)
|
|
1423
1577
|
|
|
1424
1578
|
@_rewrite_parameters()
|
|
@@ -1446,7 +1600,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1446
1600
|
"""
|
|
1447
1601
|
Performs the flush operation on one or more indices.
|
|
1448
1602
|
|
|
1449
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1603
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-flush.html>`_
|
|
1450
1604
|
|
|
1451
1605
|
:param index: Comma-separated list of data streams, indices, and aliases to flush.
|
|
1452
1606
|
Supports wildcards (`*`). To flush all data streams and indices, omit this
|
|
@@ -1466,9 +1620,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1466
1620
|
when another flush operation is running. If `false`, Elasticsearch returns
|
|
1467
1621
|
an error if you request a flush when another flush operation is running.
|
|
1468
1622
|
"""
|
|
1623
|
+
__path_parts: t.Dict[str, str]
|
|
1469
1624
|
if index not in SKIP_IN_PATH:
|
|
1470
|
-
|
|
1625
|
+
__path_parts = {"index": _quote(index)}
|
|
1626
|
+
__path = f'/{__path_parts["index"]}/_flush'
|
|
1471
1627
|
else:
|
|
1628
|
+
__path_parts = {}
|
|
1472
1629
|
__path = "/_flush"
|
|
1473
1630
|
__query: t.Dict[str, t.Any] = {}
|
|
1474
1631
|
if allow_no_indices is not None:
|
|
@@ -1491,7 +1648,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1491
1648
|
__query["wait_if_ongoing"] = wait_if_ongoing
|
|
1492
1649
|
__headers = {"accept": "application/json"}
|
|
1493
1650
|
return await self.perform_request( # type: ignore[return-value]
|
|
1494
|
-
"POST",
|
|
1651
|
+
"POST",
|
|
1652
|
+
__path,
|
|
1653
|
+
params=__query,
|
|
1654
|
+
headers=__headers,
|
|
1655
|
+
endpoint_id="indices.flush",
|
|
1656
|
+
path_parts=__path_parts,
|
|
1495
1657
|
)
|
|
1496
1658
|
|
|
1497
1659
|
@_rewrite_parameters()
|
|
@@ -1521,7 +1683,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1521
1683
|
"""
|
|
1522
1684
|
Performs the force merge operation on one or more indices.
|
|
1523
1685
|
|
|
1524
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1686
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-forcemerge.html>`_
|
|
1525
1687
|
|
|
1526
1688
|
:param index: A comma-separated list of index names; use `_all` or empty string
|
|
1527
1689
|
to perform the operation on all indices
|
|
@@ -1541,9 +1703,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1541
1703
|
:param wait_for_completion: Should the request wait until the force merge is
|
|
1542
1704
|
completed.
|
|
1543
1705
|
"""
|
|
1706
|
+
__path_parts: t.Dict[str, str]
|
|
1544
1707
|
if index not in SKIP_IN_PATH:
|
|
1545
|
-
|
|
1708
|
+
__path_parts = {"index": _quote(index)}
|
|
1709
|
+
__path = f'/{__path_parts["index"]}/_forcemerge'
|
|
1546
1710
|
else:
|
|
1711
|
+
__path_parts = {}
|
|
1547
1712
|
__path = "/_forcemerge"
|
|
1548
1713
|
__query: t.Dict[str, t.Any] = {}
|
|
1549
1714
|
if allow_no_indices is not None:
|
|
@@ -1570,7 +1735,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1570
1735
|
__query["wait_for_completion"] = wait_for_completion
|
|
1571
1736
|
__headers = {"accept": "application/json"}
|
|
1572
1737
|
return await self.perform_request( # type: ignore[return-value]
|
|
1573
|
-
"POST",
|
|
1738
|
+
"POST",
|
|
1739
|
+
__path,
|
|
1740
|
+
params=__query,
|
|
1741
|
+
headers=__headers,
|
|
1742
|
+
endpoint_id="indices.forcemerge",
|
|
1743
|
+
path_parts=__path_parts,
|
|
1574
1744
|
)
|
|
1575
1745
|
|
|
1576
1746
|
@_rewrite_parameters()
|
|
@@ -1610,7 +1780,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1610
1780
|
"""
|
|
1611
1781
|
Returns information about one or more indices.
|
|
1612
1782
|
|
|
1613
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1783
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-get-index.html>`_
|
|
1614
1784
|
|
|
1615
1785
|
:param index: Comma-separated list of data streams, indices, and index aliases
|
|
1616
1786
|
used to limit the request. Wildcard expressions (*) are supported.
|
|
@@ -1637,7 +1807,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1637
1807
|
"""
|
|
1638
1808
|
if index in SKIP_IN_PATH:
|
|
1639
1809
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
1640
|
-
|
|
1810
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
1811
|
+
__path = f'/{__path_parts["index"]}'
|
|
1641
1812
|
__query: t.Dict[str, t.Any] = {}
|
|
1642
1813
|
if allow_no_indices is not None:
|
|
1643
1814
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -1665,7 +1836,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1665
1836
|
__query["pretty"] = pretty
|
|
1666
1837
|
__headers = {"accept": "application/json"}
|
|
1667
1838
|
return await self.perform_request( # type: ignore[return-value]
|
|
1668
|
-
"GET",
|
|
1839
|
+
"GET",
|
|
1840
|
+
__path,
|
|
1841
|
+
params=__query,
|
|
1842
|
+
headers=__headers,
|
|
1843
|
+
endpoint_id="indices.get",
|
|
1844
|
+
path_parts=__path_parts,
|
|
1669
1845
|
)
|
|
1670
1846
|
|
|
1671
1847
|
@_rewrite_parameters()
|
|
@@ -1693,7 +1869,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1693
1869
|
"""
|
|
1694
1870
|
Returns an alias.
|
|
1695
1871
|
|
|
1696
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1872
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-aliases.html>`_
|
|
1697
1873
|
|
|
1698
1874
|
:param index: Comma-separated list of data streams or indices used to limit the
|
|
1699
1875
|
request. Supports wildcards (`*`). To target all data streams and indices,
|
|
@@ -1712,13 +1888,18 @@ class IndicesClient(NamespacedClient):
|
|
|
1712
1888
|
:param local: If `true`, the request retrieves information from the local node
|
|
1713
1889
|
only.
|
|
1714
1890
|
"""
|
|
1891
|
+
__path_parts: t.Dict[str, str]
|
|
1715
1892
|
if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH:
|
|
1716
|
-
|
|
1893
|
+
__path_parts = {"index": _quote(index), "name": _quote(name)}
|
|
1894
|
+
__path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}'
|
|
1717
1895
|
elif index not in SKIP_IN_PATH:
|
|
1718
|
-
|
|
1896
|
+
__path_parts = {"index": _quote(index)}
|
|
1897
|
+
__path = f'/{__path_parts["index"]}/_alias'
|
|
1719
1898
|
elif name not in SKIP_IN_PATH:
|
|
1720
|
-
|
|
1899
|
+
__path_parts = {"name": _quote(name)}
|
|
1900
|
+
__path = f'/_alias/{__path_parts["name"]}'
|
|
1721
1901
|
else:
|
|
1902
|
+
__path_parts = {}
|
|
1722
1903
|
__path = "/_alias"
|
|
1723
1904
|
__query: t.Dict[str, t.Any] = {}
|
|
1724
1905
|
if allow_no_indices is not None:
|
|
@@ -1739,7 +1920,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1739
1920
|
__query["pretty"] = pretty
|
|
1740
1921
|
__headers = {"accept": "application/json"}
|
|
1741
1922
|
return await self.perform_request( # type: ignore[return-value]
|
|
1742
|
-
"GET",
|
|
1923
|
+
"GET",
|
|
1924
|
+
__path,
|
|
1925
|
+
params=__query,
|
|
1926
|
+
headers=__headers,
|
|
1927
|
+
endpoint_id="indices.get_alias",
|
|
1928
|
+
path_parts=__path_parts,
|
|
1743
1929
|
)
|
|
1744
1930
|
|
|
1745
1931
|
@_rewrite_parameters()
|
|
@@ -1764,7 +1950,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1764
1950
|
"""
|
|
1765
1951
|
Returns the data stream lifecycle of the selected data streams.
|
|
1766
1952
|
|
|
1767
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1953
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams-get-lifecycle.html>`_
|
|
1768
1954
|
|
|
1769
1955
|
:param name: Comma-separated list of data streams to limit the request. Supports
|
|
1770
1956
|
wildcards (`*`). To target all data streams, omit this parameter or use `*`
|
|
@@ -1776,7 +1962,8 @@ class IndicesClient(NamespacedClient):
|
|
|
1776
1962
|
"""
|
|
1777
1963
|
if name in SKIP_IN_PATH:
|
|
1778
1964
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
1779
|
-
|
|
1965
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
1966
|
+
__path = f'/_data_stream/{__path_parts["name"]}/_lifecycle'
|
|
1780
1967
|
__query: t.Dict[str, t.Any] = {}
|
|
1781
1968
|
if error_trace is not None:
|
|
1782
1969
|
__query["error_trace"] = error_trace
|
|
@@ -1792,7 +1979,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1792
1979
|
__query["pretty"] = pretty
|
|
1793
1980
|
__headers = {"accept": "application/json"}
|
|
1794
1981
|
return await self.perform_request( # type: ignore[return-value]
|
|
1795
|
-
"GET",
|
|
1982
|
+
"GET",
|
|
1983
|
+
__path,
|
|
1984
|
+
params=__query,
|
|
1985
|
+
headers=__headers,
|
|
1986
|
+
endpoint_id="indices.get_data_lifecycle",
|
|
1987
|
+
path_parts=__path_parts,
|
|
1796
1988
|
)
|
|
1797
1989
|
|
|
1798
1990
|
@_rewrite_parameters()
|
|
@@ -1817,7 +2009,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1817
2009
|
"""
|
|
1818
2010
|
Returns data streams.
|
|
1819
2011
|
|
|
1820
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2012
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams.html>`_
|
|
1821
2013
|
|
|
1822
2014
|
:param name: Comma-separated list of data stream names used to limit the request.
|
|
1823
2015
|
Wildcard (`*`) expressions are supported. If omitted, all data streams are
|
|
@@ -1827,9 +2019,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1827
2019
|
:param include_defaults: If true, returns all relevant default configurations
|
|
1828
2020
|
for the index template.
|
|
1829
2021
|
"""
|
|
2022
|
+
__path_parts: t.Dict[str, str]
|
|
1830
2023
|
if name not in SKIP_IN_PATH:
|
|
1831
|
-
|
|
2024
|
+
__path_parts = {"name": _quote(name)}
|
|
2025
|
+
__path = f'/_data_stream/{__path_parts["name"]}'
|
|
1832
2026
|
else:
|
|
2027
|
+
__path_parts = {}
|
|
1833
2028
|
__path = "/_data_stream"
|
|
1834
2029
|
__query: t.Dict[str, t.Any] = {}
|
|
1835
2030
|
if error_trace is not None:
|
|
@@ -1846,7 +2041,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1846
2041
|
__query["pretty"] = pretty
|
|
1847
2042
|
__headers = {"accept": "application/json"}
|
|
1848
2043
|
return await self.perform_request( # type: ignore[return-value]
|
|
1849
|
-
"GET",
|
|
2044
|
+
"GET",
|
|
2045
|
+
__path,
|
|
2046
|
+
params=__query,
|
|
2047
|
+
headers=__headers,
|
|
2048
|
+
endpoint_id="indices.get_data_stream",
|
|
2049
|
+
path_parts=__path_parts,
|
|
1850
2050
|
)
|
|
1851
2051
|
|
|
1852
2052
|
@_rewrite_parameters()
|
|
@@ -1875,7 +2075,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1875
2075
|
"""
|
|
1876
2076
|
Returns mapping for one or more fields.
|
|
1877
2077
|
|
|
1878
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2078
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-get-field-mapping.html>`_
|
|
1879
2079
|
|
|
1880
2080
|
:param fields: Comma-separated list or wildcard expression of fields used to
|
|
1881
2081
|
limit returned information.
|
|
@@ -1897,10 +2097,13 @@ class IndicesClient(NamespacedClient):
|
|
|
1897
2097
|
"""
|
|
1898
2098
|
if fields in SKIP_IN_PATH:
|
|
1899
2099
|
raise ValueError("Empty value passed for parameter 'fields'")
|
|
2100
|
+
__path_parts: t.Dict[str, str]
|
|
1900
2101
|
if index not in SKIP_IN_PATH and fields not in SKIP_IN_PATH:
|
|
1901
|
-
|
|
2102
|
+
__path_parts = {"index": _quote(index), "fields": _quote(fields)}
|
|
2103
|
+
__path = f'/{__path_parts["index"]}/_mapping/field/{__path_parts["fields"]}'
|
|
1902
2104
|
elif fields not in SKIP_IN_PATH:
|
|
1903
|
-
|
|
2105
|
+
__path_parts = {"fields": _quote(fields)}
|
|
2106
|
+
__path = f'/_mapping/field/{__path_parts["fields"]}'
|
|
1904
2107
|
else:
|
|
1905
2108
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
1906
2109
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -1924,7 +2127,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1924
2127
|
__query["pretty"] = pretty
|
|
1925
2128
|
__headers = {"accept": "application/json"}
|
|
1926
2129
|
return await self.perform_request( # type: ignore[return-value]
|
|
1927
|
-
"GET",
|
|
2130
|
+
"GET",
|
|
2131
|
+
__path,
|
|
2132
|
+
params=__query,
|
|
2133
|
+
headers=__headers,
|
|
2134
|
+
endpoint_id="indices.get_field_mapping",
|
|
2135
|
+
path_parts=__path_parts,
|
|
1928
2136
|
)
|
|
1929
2137
|
|
|
1930
2138
|
@_rewrite_parameters()
|
|
@@ -1946,7 +2154,7 @@ class IndicesClient(NamespacedClient):
|
|
|
1946
2154
|
"""
|
|
1947
2155
|
Returns an index template.
|
|
1948
2156
|
|
|
1949
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2157
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-get-template.html>`_
|
|
1950
2158
|
|
|
1951
2159
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
1952
2160
|
Wildcard (*) expressions are supported.
|
|
@@ -1960,9 +2168,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1960
2168
|
no response is received before the timeout expires, the request fails and
|
|
1961
2169
|
returns an error.
|
|
1962
2170
|
"""
|
|
2171
|
+
__path_parts: t.Dict[str, str]
|
|
1963
2172
|
if name not in SKIP_IN_PATH:
|
|
1964
|
-
|
|
2173
|
+
__path_parts = {"name": _quote(name)}
|
|
2174
|
+
__path = f'/_index_template/{__path_parts["name"]}'
|
|
1965
2175
|
else:
|
|
2176
|
+
__path_parts = {}
|
|
1966
2177
|
__path = "/_index_template"
|
|
1967
2178
|
__query: t.Dict[str, t.Any] = {}
|
|
1968
2179
|
if error_trace is not None:
|
|
@@ -1983,7 +2194,12 @@ class IndicesClient(NamespacedClient):
|
|
|
1983
2194
|
__query["pretty"] = pretty
|
|
1984
2195
|
__headers = {"accept": "application/json"}
|
|
1985
2196
|
return await self.perform_request( # type: ignore[return-value]
|
|
1986
|
-
"GET",
|
|
2197
|
+
"GET",
|
|
2198
|
+
__path,
|
|
2199
|
+
params=__query,
|
|
2200
|
+
headers=__headers,
|
|
2201
|
+
endpoint_id="indices.get_index_template",
|
|
2202
|
+
path_parts=__path_parts,
|
|
1987
2203
|
)
|
|
1988
2204
|
|
|
1989
2205
|
@_rewrite_parameters()
|
|
@@ -2013,7 +2229,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2013
2229
|
"""
|
|
2014
2230
|
Returns mappings for one or more indices.
|
|
2015
2231
|
|
|
2016
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2232
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-get-mapping.html>`_
|
|
2017
2233
|
|
|
2018
2234
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2019
2235
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -2033,9 +2249,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2033
2249
|
no response is received before the timeout expires, the request fails and
|
|
2034
2250
|
returns an error.
|
|
2035
2251
|
"""
|
|
2252
|
+
__path_parts: t.Dict[str, str]
|
|
2036
2253
|
if index not in SKIP_IN_PATH:
|
|
2037
|
-
|
|
2254
|
+
__path_parts = {"index": _quote(index)}
|
|
2255
|
+
__path = f'/{__path_parts["index"]}/_mapping'
|
|
2038
2256
|
else:
|
|
2257
|
+
__path_parts = {}
|
|
2039
2258
|
__path = "/_mapping"
|
|
2040
2259
|
__query: t.Dict[str, t.Any] = {}
|
|
2041
2260
|
if allow_no_indices is not None:
|
|
@@ -2058,7 +2277,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2058
2277
|
__query["pretty"] = pretty
|
|
2059
2278
|
__headers = {"accept": "application/json"}
|
|
2060
2279
|
return await self.perform_request( # type: ignore[return-value]
|
|
2061
|
-
"GET",
|
|
2280
|
+
"GET",
|
|
2281
|
+
__path,
|
|
2282
|
+
params=__query,
|
|
2283
|
+
headers=__headers,
|
|
2284
|
+
endpoint_id="indices.get_mapping",
|
|
2285
|
+
path_parts=__path_parts,
|
|
2062
2286
|
)
|
|
2063
2287
|
|
|
2064
2288
|
@_rewrite_parameters()
|
|
@@ -2091,7 +2315,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2091
2315
|
"""
|
|
2092
2316
|
Returns settings for one or more indices.
|
|
2093
2317
|
|
|
2094
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2318
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-get-settings.html>`_
|
|
2095
2319
|
|
|
2096
2320
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2097
2321
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -2116,13 +2340,18 @@ class IndicesClient(NamespacedClient):
|
|
|
2116
2340
|
no response is received before the timeout expires, the request fails and
|
|
2117
2341
|
returns an error.
|
|
2118
2342
|
"""
|
|
2343
|
+
__path_parts: t.Dict[str, str]
|
|
2119
2344
|
if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH:
|
|
2120
|
-
|
|
2345
|
+
__path_parts = {"index": _quote(index), "name": _quote(name)}
|
|
2346
|
+
__path = f'/{__path_parts["index"]}/_settings/{__path_parts["name"]}'
|
|
2121
2347
|
elif index not in SKIP_IN_PATH:
|
|
2122
|
-
|
|
2348
|
+
__path_parts = {"index": _quote(index)}
|
|
2349
|
+
__path = f'/{__path_parts["index"]}/_settings'
|
|
2123
2350
|
elif name not in SKIP_IN_PATH:
|
|
2124
|
-
|
|
2351
|
+
__path_parts = {"name": _quote(name)}
|
|
2352
|
+
__path = f'/_settings/{__path_parts["name"]}'
|
|
2125
2353
|
else:
|
|
2354
|
+
__path_parts = {}
|
|
2126
2355
|
__path = "/_settings"
|
|
2127
2356
|
__query: t.Dict[str, t.Any] = {}
|
|
2128
2357
|
if allow_no_indices is not None:
|
|
@@ -2149,7 +2378,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2149
2378
|
__query["pretty"] = pretty
|
|
2150
2379
|
__headers = {"accept": "application/json"}
|
|
2151
2380
|
return await self.perform_request( # type: ignore[return-value]
|
|
2152
|
-
"GET",
|
|
2381
|
+
"GET",
|
|
2382
|
+
__path,
|
|
2383
|
+
params=__query,
|
|
2384
|
+
headers=__headers,
|
|
2385
|
+
endpoint_id="indices.get_settings",
|
|
2386
|
+
path_parts=__path_parts,
|
|
2153
2387
|
)
|
|
2154
2388
|
|
|
2155
2389
|
@_rewrite_parameters()
|
|
@@ -2170,7 +2404,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2170
2404
|
"""
|
|
2171
2405
|
Returns an index template.
|
|
2172
2406
|
|
|
2173
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2407
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-get-template-v1.html>`_
|
|
2174
2408
|
|
|
2175
2409
|
:param name: Comma-separated list of index template names used to limit the request.
|
|
2176
2410
|
Wildcard (`*`) expressions are supported. To return all index templates,
|
|
@@ -2182,9 +2416,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2182
2416
|
no response is received before the timeout expires, the request fails and
|
|
2183
2417
|
returns an error.
|
|
2184
2418
|
"""
|
|
2419
|
+
__path_parts: t.Dict[str, str]
|
|
2185
2420
|
if name not in SKIP_IN_PATH:
|
|
2186
|
-
|
|
2421
|
+
__path_parts = {"name": _quote(name)}
|
|
2422
|
+
__path = f'/_template/{__path_parts["name"]}'
|
|
2187
2423
|
else:
|
|
2424
|
+
__path_parts = {}
|
|
2188
2425
|
__path = "/_template"
|
|
2189
2426
|
__query: t.Dict[str, t.Any] = {}
|
|
2190
2427
|
if error_trace is not None:
|
|
@@ -2203,7 +2440,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2203
2440
|
__query["pretty"] = pretty
|
|
2204
2441
|
__headers = {"accept": "application/json"}
|
|
2205
2442
|
return await self.perform_request( # type: ignore[return-value]
|
|
2206
|
-
"GET",
|
|
2443
|
+
"GET",
|
|
2444
|
+
__path,
|
|
2445
|
+
params=__query,
|
|
2446
|
+
headers=__headers,
|
|
2447
|
+
endpoint_id="indices.get_template",
|
|
2448
|
+
path_parts=__path_parts,
|
|
2207
2449
|
)
|
|
2208
2450
|
|
|
2209
2451
|
@_rewrite_parameters()
|
|
@@ -2219,13 +2461,14 @@ class IndicesClient(NamespacedClient):
|
|
|
2219
2461
|
"""
|
|
2220
2462
|
Migrates an alias to a data stream
|
|
2221
2463
|
|
|
2222
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2464
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams.html>`_
|
|
2223
2465
|
|
|
2224
2466
|
:param name: Name of the index alias to convert to a data stream.
|
|
2225
2467
|
"""
|
|
2226
2468
|
if name in SKIP_IN_PATH:
|
|
2227
2469
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
2228
|
-
|
|
2470
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
2471
|
+
__path = f'/_data_stream/_migrate/{__path_parts["name"]}'
|
|
2229
2472
|
__query: t.Dict[str, t.Any] = {}
|
|
2230
2473
|
if error_trace is not None:
|
|
2231
2474
|
__query["error_trace"] = error_trace
|
|
@@ -2237,7 +2480,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2237
2480
|
__query["pretty"] = pretty
|
|
2238
2481
|
__headers = {"accept": "application/json"}
|
|
2239
2482
|
return await self.perform_request( # type: ignore[return-value]
|
|
2240
|
-
"POST",
|
|
2483
|
+
"POST",
|
|
2484
|
+
__path,
|
|
2485
|
+
params=__query,
|
|
2486
|
+
headers=__headers,
|
|
2487
|
+
endpoint_id="indices.migrate_to_data_stream",
|
|
2488
|
+
path_parts=__path_parts,
|
|
2241
2489
|
)
|
|
2242
2490
|
|
|
2243
2491
|
@_rewrite_parameters(
|
|
@@ -2256,12 +2504,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2256
2504
|
"""
|
|
2257
2505
|
Modifies a data stream
|
|
2258
2506
|
|
|
2259
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2507
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams.html>`_
|
|
2260
2508
|
|
|
2261
2509
|
:param actions: Actions to perform.
|
|
2262
2510
|
"""
|
|
2263
2511
|
if actions is None and body is None:
|
|
2264
2512
|
raise ValueError("Empty value passed for parameter 'actions'")
|
|
2513
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2265
2514
|
__path = "/_data_stream/_modify"
|
|
2266
2515
|
__query: t.Dict[str, t.Any] = {}
|
|
2267
2516
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2278,7 +2527,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2278
2527
|
__body["actions"] = actions
|
|
2279
2528
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2280
2529
|
return await self.perform_request( # type: ignore[return-value]
|
|
2281
|
-
"POST",
|
|
2530
|
+
"POST",
|
|
2531
|
+
__path,
|
|
2532
|
+
params=__query,
|
|
2533
|
+
headers=__headers,
|
|
2534
|
+
body=__body,
|
|
2535
|
+
endpoint_id="indices.modify_data_stream",
|
|
2536
|
+
path_parts=__path_parts,
|
|
2282
2537
|
)
|
|
2283
2538
|
|
|
2284
2539
|
@_rewrite_parameters()
|
|
@@ -2311,7 +2566,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2311
2566
|
"""
|
|
2312
2567
|
Opens an index.
|
|
2313
2568
|
|
|
2314
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2569
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-open-close.html>`_
|
|
2315
2570
|
|
|
2316
2571
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
2317
2572
|
to limit the request. Supports wildcards (`*`). By default, you must explicitly
|
|
@@ -2339,7 +2594,8 @@ class IndicesClient(NamespacedClient):
|
|
|
2339
2594
|
"""
|
|
2340
2595
|
if index in SKIP_IN_PATH:
|
|
2341
2596
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
2342
|
-
|
|
2597
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
2598
|
+
__path = f'/{__path_parts["index"]}/_open'
|
|
2343
2599
|
__query: t.Dict[str, t.Any] = {}
|
|
2344
2600
|
if allow_no_indices is not None:
|
|
2345
2601
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -2363,7 +2619,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2363
2619
|
__query["wait_for_active_shards"] = wait_for_active_shards
|
|
2364
2620
|
__headers = {"accept": "application/json"}
|
|
2365
2621
|
return await self.perform_request( # type: ignore[return-value]
|
|
2366
|
-
"POST",
|
|
2622
|
+
"POST",
|
|
2623
|
+
__path,
|
|
2624
|
+
params=__query,
|
|
2625
|
+
headers=__headers,
|
|
2626
|
+
endpoint_id="indices.open",
|
|
2627
|
+
path_parts=__path_parts,
|
|
2367
2628
|
)
|
|
2368
2629
|
|
|
2369
2630
|
@_rewrite_parameters()
|
|
@@ -2380,13 +2641,14 @@ class IndicesClient(NamespacedClient):
|
|
|
2380
2641
|
Promotes a data stream from a replicated data stream managed by CCR to a regular
|
|
2381
2642
|
data stream
|
|
2382
2643
|
|
|
2383
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2644
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams.html>`_
|
|
2384
2645
|
|
|
2385
2646
|
:param name: The name of the data stream
|
|
2386
2647
|
"""
|
|
2387
2648
|
if name in SKIP_IN_PATH:
|
|
2388
2649
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
2389
|
-
|
|
2650
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
2651
|
+
__path = f'/_data_stream/_promote/{__path_parts["name"]}'
|
|
2390
2652
|
__query: t.Dict[str, t.Any] = {}
|
|
2391
2653
|
if error_trace is not None:
|
|
2392
2654
|
__query["error_trace"] = error_trace
|
|
@@ -2398,7 +2660,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2398
2660
|
__query["pretty"] = pretty
|
|
2399
2661
|
__headers = {"accept": "application/json"}
|
|
2400
2662
|
return await self.perform_request( # type: ignore[return-value]
|
|
2401
|
-
"POST",
|
|
2663
|
+
"POST",
|
|
2664
|
+
__path,
|
|
2665
|
+
params=__query,
|
|
2666
|
+
headers=__headers,
|
|
2667
|
+
endpoint_id="indices.promote_data_stream",
|
|
2668
|
+
path_parts=__path_parts,
|
|
2402
2669
|
)
|
|
2403
2670
|
|
|
2404
2671
|
@_rewrite_parameters(
|
|
@@ -2433,7 +2700,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2433
2700
|
"""
|
|
2434
2701
|
Creates or updates an alias.
|
|
2435
2702
|
|
|
2436
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2703
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-aliases.html>`_
|
|
2437
2704
|
|
|
2438
2705
|
:param index: Comma-separated list of data streams or indices to add. Supports
|
|
2439
2706
|
wildcards (`*`). Wildcard patterns that match both data streams and indices
|
|
@@ -2465,7 +2732,8 @@ class IndicesClient(NamespacedClient):
|
|
|
2465
2732
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
2466
2733
|
if name in SKIP_IN_PATH:
|
|
2467
2734
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
2468
|
-
|
|
2735
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index), "name": _quote(name)}
|
|
2736
|
+
__path = f'/{__path_parts["index"]}/_alias/{__path_parts["name"]}'
|
|
2469
2737
|
__query: t.Dict[str, t.Any] = {}
|
|
2470
2738
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2471
2739
|
if error_trace is not None:
|
|
@@ -2497,7 +2765,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2497
2765
|
if __body is not None:
|
|
2498
2766
|
__headers["content-type"] = "application/json"
|
|
2499
2767
|
return await self.perform_request( # type: ignore[return-value]
|
|
2500
|
-
"PUT",
|
|
2768
|
+
"PUT",
|
|
2769
|
+
__path,
|
|
2770
|
+
params=__query,
|
|
2771
|
+
headers=__headers,
|
|
2772
|
+
body=__body,
|
|
2773
|
+
endpoint_id="indices.put_alias",
|
|
2774
|
+
path_parts=__path_parts,
|
|
2501
2775
|
)
|
|
2502
2776
|
|
|
2503
2777
|
@_rewrite_parameters(
|
|
@@ -2532,7 +2806,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2532
2806
|
"""
|
|
2533
2807
|
Updates the data stream lifecycle of the selected data streams.
|
|
2534
2808
|
|
|
2535
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2809
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/data-streams-put-lifecycle.html>`_
|
|
2536
2810
|
|
|
2537
2811
|
:param name: Comma-separated list of data streams used to limit the request.
|
|
2538
2812
|
Supports wildcards (`*`). To target all data streams use `*` or `_all`.
|
|
@@ -2554,7 +2828,8 @@ class IndicesClient(NamespacedClient):
|
|
|
2554
2828
|
"""
|
|
2555
2829
|
if name in SKIP_IN_PATH:
|
|
2556
2830
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
2557
|
-
|
|
2831
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
2832
|
+
__path = f'/_data_stream/{__path_parts["name"]}/_lifecycle'
|
|
2558
2833
|
__query: t.Dict[str, t.Any] = {}
|
|
2559
2834
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2560
2835
|
if error_trace is not None:
|
|
@@ -2582,7 +2857,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2582
2857
|
if __body is not None:
|
|
2583
2858
|
__headers["content-type"] = "application/json"
|
|
2584
2859
|
return await self.perform_request( # type: ignore[return-value]
|
|
2585
|
-
"PUT",
|
|
2860
|
+
"PUT",
|
|
2861
|
+
__path,
|
|
2862
|
+
params=__query,
|
|
2863
|
+
headers=__headers,
|
|
2864
|
+
body=__body,
|
|
2865
|
+
endpoint_id="indices.put_data_lifecycle",
|
|
2866
|
+
path_parts=__path_parts,
|
|
2586
2867
|
)
|
|
2587
2868
|
|
|
2588
2869
|
@_rewrite_parameters(
|
|
@@ -2618,7 +2899,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2618
2899
|
"""
|
|
2619
2900
|
Creates or updates an index template.
|
|
2620
2901
|
|
|
2621
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2902
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-put-template.html>`_
|
|
2622
2903
|
|
|
2623
2904
|
:param name: Index or template name
|
|
2624
2905
|
:param composed_of: An ordered list of component template names. Component templates
|
|
@@ -2644,7 +2925,8 @@ class IndicesClient(NamespacedClient):
|
|
|
2644
2925
|
"""
|
|
2645
2926
|
if name in SKIP_IN_PATH:
|
|
2646
2927
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
2647
|
-
|
|
2928
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
2929
|
+
__path = f'/_index_template/{__path_parts["name"]}'
|
|
2648
2930
|
__query: t.Dict[str, t.Any] = {}
|
|
2649
2931
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2650
2932
|
if create is not None:
|
|
@@ -2674,7 +2956,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2674
2956
|
__body["version"] = version
|
|
2675
2957
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2676
2958
|
return await self.perform_request( # type: ignore[return-value]
|
|
2677
|
-
"PUT",
|
|
2959
|
+
"PUT",
|
|
2960
|
+
__path,
|
|
2961
|
+
params=__query,
|
|
2962
|
+
headers=__headers,
|
|
2963
|
+
body=__body,
|
|
2964
|
+
endpoint_id="indices.put_index_template",
|
|
2965
|
+
path_parts=__path_parts,
|
|
2678
2966
|
)
|
|
2679
2967
|
|
|
2680
2968
|
@_rewrite_parameters(
|
|
@@ -2744,7 +3032,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2744
3032
|
"""
|
|
2745
3033
|
Updates the index mappings.
|
|
2746
3034
|
|
|
2747
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3035
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-put-mapping.html>`_
|
|
2748
3036
|
|
|
2749
3037
|
:param index: A comma-separated list of index names the mapping should be added
|
|
2750
3038
|
to (supports wildcards); use `_all` or omit to add the mapping on all indices.
|
|
@@ -2784,7 +3072,8 @@ class IndicesClient(NamespacedClient):
|
|
|
2784
3072
|
"""
|
|
2785
3073
|
if index in SKIP_IN_PATH:
|
|
2786
3074
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
2787
|
-
|
|
3075
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
3076
|
+
__path = f'/{__path_parts["index"]}/_mapping'
|
|
2788
3077
|
__query: t.Dict[str, t.Any] = {}
|
|
2789
3078
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2790
3079
|
if allow_no_indices is not None:
|
|
@@ -2832,7 +3121,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2832
3121
|
__body["_source"] = source
|
|
2833
3122
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2834
3123
|
return await self.perform_request( # type: ignore[return-value]
|
|
2835
|
-
"PUT",
|
|
3124
|
+
"PUT",
|
|
3125
|
+
__path,
|
|
3126
|
+
params=__query,
|
|
3127
|
+
headers=__headers,
|
|
3128
|
+
body=__body,
|
|
3129
|
+
endpoint_id="indices.put_mapping",
|
|
3130
|
+
path_parts=__path_parts,
|
|
2836
3131
|
)
|
|
2837
3132
|
|
|
2838
3133
|
@_rewrite_parameters(
|
|
@@ -2868,7 +3163,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2868
3163
|
"""
|
|
2869
3164
|
Updates the index settings.
|
|
2870
3165
|
|
|
2871
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3166
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-update-settings.html>`_
|
|
2872
3167
|
|
|
2873
3168
|
:param settings:
|
|
2874
3169
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
@@ -2898,9 +3193,12 @@ class IndicesClient(NamespacedClient):
|
|
|
2898
3193
|
)
|
|
2899
3194
|
elif settings is not None and body is not None:
|
|
2900
3195
|
raise ValueError("Cannot set both 'settings' and 'body'")
|
|
3196
|
+
__path_parts: t.Dict[str, str]
|
|
2901
3197
|
if index not in SKIP_IN_PATH:
|
|
2902
|
-
|
|
3198
|
+
__path_parts = {"index": _quote(index)}
|
|
3199
|
+
__path = f'/{__path_parts["index"]}/_settings'
|
|
2903
3200
|
else:
|
|
3201
|
+
__path_parts = {}
|
|
2904
3202
|
__path = "/_settings"
|
|
2905
3203
|
__query: t.Dict[str, t.Any] = {}
|
|
2906
3204
|
if allow_no_indices is not None:
|
|
@@ -2928,7 +3226,13 @@ class IndicesClient(NamespacedClient):
|
|
|
2928
3226
|
__body = settings if settings is not None else body
|
|
2929
3227
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2930
3228
|
return await self.perform_request( # type: ignore[return-value]
|
|
2931
|
-
"PUT",
|
|
3229
|
+
"PUT",
|
|
3230
|
+
__path,
|
|
3231
|
+
params=__query,
|
|
3232
|
+
headers=__headers,
|
|
3233
|
+
body=__body,
|
|
3234
|
+
endpoint_id="indices.put_settings",
|
|
3235
|
+
path_parts=__path_parts,
|
|
2932
3236
|
)
|
|
2933
3237
|
|
|
2934
3238
|
@_rewrite_parameters(
|
|
@@ -2966,7 +3270,7 @@ class IndicesClient(NamespacedClient):
|
|
|
2966
3270
|
"""
|
|
2967
3271
|
Creates or updates an index template.
|
|
2968
3272
|
|
|
2969
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3273
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-templates-v1.html>`_
|
|
2970
3274
|
|
|
2971
3275
|
:param name: The name of the template
|
|
2972
3276
|
:param aliases: Aliases for the index.
|
|
@@ -2991,7 +3295,8 @@ class IndicesClient(NamespacedClient):
|
|
|
2991
3295
|
"""
|
|
2992
3296
|
if name in SKIP_IN_PATH:
|
|
2993
3297
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
2994
|
-
|
|
3298
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
3299
|
+
__path = f'/_template/{__path_parts["name"]}'
|
|
2995
3300
|
__query: t.Dict[str, t.Any] = {}
|
|
2996
3301
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2997
3302
|
if create is not None:
|
|
@@ -3025,7 +3330,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3025
3330
|
__body["version"] = version
|
|
3026
3331
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3027
3332
|
return await self.perform_request( # type: ignore[return-value]
|
|
3028
|
-
"PUT",
|
|
3333
|
+
"PUT",
|
|
3334
|
+
__path,
|
|
3335
|
+
params=__query,
|
|
3336
|
+
headers=__headers,
|
|
3337
|
+
body=__body,
|
|
3338
|
+
endpoint_id="indices.put_template",
|
|
3339
|
+
path_parts=__path_parts,
|
|
3029
3340
|
)
|
|
3030
3341
|
|
|
3031
3342
|
@_rewrite_parameters()
|
|
@@ -3043,7 +3354,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3043
3354
|
"""
|
|
3044
3355
|
Returns information about ongoing index shard recoveries.
|
|
3045
3356
|
|
|
3046
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3357
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-recovery.html>`_
|
|
3047
3358
|
|
|
3048
3359
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
3049
3360
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -3052,9 +3363,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3052
3363
|
:param detailed: If `true`, the response includes detailed information about
|
|
3053
3364
|
shard recoveries.
|
|
3054
3365
|
"""
|
|
3366
|
+
__path_parts: t.Dict[str, str]
|
|
3055
3367
|
if index not in SKIP_IN_PATH:
|
|
3056
|
-
|
|
3368
|
+
__path_parts = {"index": _quote(index)}
|
|
3369
|
+
__path = f'/{__path_parts["index"]}/_recovery'
|
|
3057
3370
|
else:
|
|
3371
|
+
__path_parts = {}
|
|
3058
3372
|
__path = "/_recovery"
|
|
3059
3373
|
__query: t.Dict[str, t.Any] = {}
|
|
3060
3374
|
if active_only is not None:
|
|
@@ -3071,7 +3385,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3071
3385
|
__query["pretty"] = pretty
|
|
3072
3386
|
__headers = {"accept": "application/json"}
|
|
3073
3387
|
return await self.perform_request( # type: ignore[return-value]
|
|
3074
|
-
"GET",
|
|
3388
|
+
"GET",
|
|
3389
|
+
__path,
|
|
3390
|
+
params=__query,
|
|
3391
|
+
headers=__headers,
|
|
3392
|
+
endpoint_id="indices.recovery",
|
|
3393
|
+
path_parts=__path_parts,
|
|
3075
3394
|
)
|
|
3076
3395
|
|
|
3077
3396
|
@_rewrite_parameters()
|
|
@@ -3097,7 +3416,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3097
3416
|
"""
|
|
3098
3417
|
Performs the refresh operation in one or more indices.
|
|
3099
3418
|
|
|
3100
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3419
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-refresh.html>`_
|
|
3101
3420
|
|
|
3102
3421
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
3103
3422
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -3112,9 +3431,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3112
3431
|
:param ignore_unavailable: If `false`, the request returns an error if it targets
|
|
3113
3432
|
a missing or closed index.
|
|
3114
3433
|
"""
|
|
3434
|
+
__path_parts: t.Dict[str, str]
|
|
3115
3435
|
if index not in SKIP_IN_PATH:
|
|
3116
|
-
|
|
3436
|
+
__path_parts = {"index": _quote(index)}
|
|
3437
|
+
__path = f'/{__path_parts["index"]}/_refresh'
|
|
3117
3438
|
else:
|
|
3439
|
+
__path_parts = {}
|
|
3118
3440
|
__path = "/_refresh"
|
|
3119
3441
|
__query: t.Dict[str, t.Any] = {}
|
|
3120
3442
|
if allow_no_indices is not None:
|
|
@@ -3133,7 +3455,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3133
3455
|
__query["pretty"] = pretty
|
|
3134
3456
|
__headers = {"accept": "application/json"}
|
|
3135
3457
|
return await self.perform_request( # type: ignore[return-value]
|
|
3136
|
-
"POST",
|
|
3458
|
+
"POST",
|
|
3459
|
+
__path,
|
|
3460
|
+
params=__query,
|
|
3461
|
+
headers=__headers,
|
|
3462
|
+
endpoint_id="indices.refresh",
|
|
3463
|
+
path_parts=__path_parts,
|
|
3137
3464
|
)
|
|
3138
3465
|
|
|
3139
3466
|
@_rewrite_parameters()
|
|
@@ -3159,7 +3486,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3159
3486
|
"""
|
|
3160
3487
|
Reloads an index's search analyzers and their resources.
|
|
3161
3488
|
|
|
3162
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3489
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-reload-analyzers.html>`_
|
|
3163
3490
|
|
|
3164
3491
|
:param index: A comma-separated list of index names to reload analyzers for
|
|
3165
3492
|
:param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
|
|
@@ -3172,7 +3499,81 @@ class IndicesClient(NamespacedClient):
|
|
|
3172
3499
|
"""
|
|
3173
3500
|
if index in SKIP_IN_PATH:
|
|
3174
3501
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
3175
|
-
|
|
3502
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
3503
|
+
__path = f'/{__path_parts["index"]}/_reload_search_analyzers'
|
|
3504
|
+
__query: t.Dict[str, t.Any] = {}
|
|
3505
|
+
if allow_no_indices is not None:
|
|
3506
|
+
__query["allow_no_indices"] = allow_no_indices
|
|
3507
|
+
if error_trace is not None:
|
|
3508
|
+
__query["error_trace"] = error_trace
|
|
3509
|
+
if expand_wildcards is not None:
|
|
3510
|
+
__query["expand_wildcards"] = expand_wildcards
|
|
3511
|
+
if filter_path is not None:
|
|
3512
|
+
__query["filter_path"] = filter_path
|
|
3513
|
+
if human is not None:
|
|
3514
|
+
__query["human"] = human
|
|
3515
|
+
if ignore_unavailable is not None:
|
|
3516
|
+
__query["ignore_unavailable"] = ignore_unavailable
|
|
3517
|
+
if pretty is not None:
|
|
3518
|
+
__query["pretty"] = pretty
|
|
3519
|
+
__headers = {"accept": "application/json"}
|
|
3520
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
3521
|
+
"POST",
|
|
3522
|
+
__path,
|
|
3523
|
+
params=__query,
|
|
3524
|
+
headers=__headers,
|
|
3525
|
+
endpoint_id="indices.reload_search_analyzers",
|
|
3526
|
+
path_parts=__path_parts,
|
|
3527
|
+
)
|
|
3528
|
+
|
|
3529
|
+
@_rewrite_parameters()
|
|
3530
|
+
async def resolve_cluster(
|
|
3531
|
+
self,
|
|
3532
|
+
*,
|
|
3533
|
+
name: t.Union[str, t.Sequence[str]],
|
|
3534
|
+
allow_no_indices: t.Optional[bool] = None,
|
|
3535
|
+
error_trace: t.Optional[bool] = None,
|
|
3536
|
+
expand_wildcards: t.Optional[
|
|
3537
|
+
t.Union[
|
|
3538
|
+
t.Sequence[
|
|
3539
|
+
t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str]
|
|
3540
|
+
],
|
|
3541
|
+
t.Union["t.Literal['all', 'closed', 'hidden', 'none', 'open']", str],
|
|
3542
|
+
]
|
|
3543
|
+
] = None,
|
|
3544
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3545
|
+
human: t.Optional[bool] = None,
|
|
3546
|
+
ignore_throttled: t.Optional[bool] = None,
|
|
3547
|
+
ignore_unavailable: t.Optional[bool] = None,
|
|
3548
|
+
pretty: t.Optional[bool] = None,
|
|
3549
|
+
) -> ObjectApiResponse[t.Any]:
|
|
3550
|
+
"""
|
|
3551
|
+
Resolves the specified index expressions to return information about each cluster,
|
|
3552
|
+
including the local cluster, if included.
|
|
3553
|
+
|
|
3554
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-resolve-cluster-api.html>`_
|
|
3555
|
+
|
|
3556
|
+
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
|
|
3557
|
+
and data streams to resolve. Resources on remote clusters can be specified
|
|
3558
|
+
using the `<cluster>`:`<name>` syntax.
|
|
3559
|
+
:param allow_no_indices: If false, the request returns an error if any wildcard
|
|
3560
|
+
expression, index alias, or _all value targets only missing or closed indices.
|
|
3561
|
+
This behavior applies even if the request targets other open indices. For
|
|
3562
|
+
example, a request targeting foo*,bar* returns an error if an index starts
|
|
3563
|
+
with foo but no index starts with bar.
|
|
3564
|
+
:param expand_wildcards: Type of index that wildcard patterns can match. If the
|
|
3565
|
+
request can target data streams, this argument determines whether wildcard
|
|
3566
|
+
expressions match hidden data streams. Supports comma-separated values, such
|
|
3567
|
+
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
|
|
3568
|
+
:param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
|
|
3569
|
+
when frozen. Defaults to false.
|
|
3570
|
+
:param ignore_unavailable: If false, the request returns an error if it targets
|
|
3571
|
+
a missing or closed index. Defaults to false.
|
|
3572
|
+
"""
|
|
3573
|
+
if name in SKIP_IN_PATH:
|
|
3574
|
+
raise ValueError("Empty value passed for parameter 'name'")
|
|
3575
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
3576
|
+
__path = f'/_resolve/cluster/{__path_parts["name"]}'
|
|
3176
3577
|
__query: t.Dict[str, t.Any] = {}
|
|
3177
3578
|
if allow_no_indices is not None:
|
|
3178
3579
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -3184,13 +3585,20 @@ class IndicesClient(NamespacedClient):
|
|
|
3184
3585
|
__query["filter_path"] = filter_path
|
|
3185
3586
|
if human is not None:
|
|
3186
3587
|
__query["human"] = human
|
|
3588
|
+
if ignore_throttled is not None:
|
|
3589
|
+
__query["ignore_throttled"] = ignore_throttled
|
|
3187
3590
|
if ignore_unavailable is not None:
|
|
3188
3591
|
__query["ignore_unavailable"] = ignore_unavailable
|
|
3189
3592
|
if pretty is not None:
|
|
3190
3593
|
__query["pretty"] = pretty
|
|
3191
3594
|
__headers = {"accept": "application/json"}
|
|
3192
3595
|
return await self.perform_request( # type: ignore[return-value]
|
|
3193
|
-
"
|
|
3596
|
+
"GET",
|
|
3597
|
+
__path,
|
|
3598
|
+
params=__query,
|
|
3599
|
+
headers=__headers,
|
|
3600
|
+
endpoint_id="indices.resolve_cluster",
|
|
3601
|
+
path_parts=__path_parts,
|
|
3194
3602
|
)
|
|
3195
3603
|
|
|
3196
3604
|
@_rewrite_parameters()
|
|
@@ -3214,7 +3622,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3214
3622
|
"""
|
|
3215
3623
|
Returns information about any matching indices, aliases, and data streams
|
|
3216
3624
|
|
|
3217
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3625
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-resolve-index-api.html>`_
|
|
3218
3626
|
|
|
3219
3627
|
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
|
|
3220
3628
|
and data streams to resolve. Resources on remote clusters can be specified
|
|
@@ -3226,7 +3634,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3226
3634
|
"""
|
|
3227
3635
|
if name in SKIP_IN_PATH:
|
|
3228
3636
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
3229
|
-
|
|
3637
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
3638
|
+
__path = f'/_resolve/index/{__path_parts["name"]}'
|
|
3230
3639
|
__query: t.Dict[str, t.Any] = {}
|
|
3231
3640
|
if error_trace is not None:
|
|
3232
3641
|
__query["error_trace"] = error_trace
|
|
@@ -3240,7 +3649,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3240
3649
|
__query["pretty"] = pretty
|
|
3241
3650
|
__headers = {"accept": "application/json"}
|
|
3242
3651
|
return await self.perform_request( # type: ignore[return-value]
|
|
3243
|
-
"GET",
|
|
3652
|
+
"GET",
|
|
3653
|
+
__path,
|
|
3654
|
+
params=__query,
|
|
3655
|
+
headers=__headers,
|
|
3656
|
+
endpoint_id="indices.resolve_index",
|
|
3657
|
+
path_parts=__path_parts,
|
|
3244
3658
|
)
|
|
3245
3659
|
|
|
3246
3660
|
@_rewrite_parameters(
|
|
@@ -3273,7 +3687,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3273
3687
|
Updates an alias to point to a new index when the existing index is considered
|
|
3274
3688
|
to be too large or too old.
|
|
3275
3689
|
|
|
3276
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3690
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-rollover-index.html>`_
|
|
3277
3691
|
|
|
3278
3692
|
:param alias: Name of the data stream or index alias to roll over.
|
|
3279
3693
|
:param new_index: Name of the index to create. Supports date math. Data streams
|
|
@@ -3303,10 +3717,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3303
3717
|
"""
|
|
3304
3718
|
if alias in SKIP_IN_PATH:
|
|
3305
3719
|
raise ValueError("Empty value passed for parameter 'alias'")
|
|
3720
|
+
__path_parts: t.Dict[str, str]
|
|
3306
3721
|
if alias not in SKIP_IN_PATH and new_index not in SKIP_IN_PATH:
|
|
3307
|
-
|
|
3722
|
+
__path_parts = {"alias": _quote(alias), "new_index": _quote(new_index)}
|
|
3723
|
+
__path = f'/{__path_parts["alias"]}/_rollover/{__path_parts["new_index"]}'
|
|
3308
3724
|
elif alias not in SKIP_IN_PATH:
|
|
3309
|
-
|
|
3725
|
+
__path_parts = {"alias": _quote(alias)}
|
|
3726
|
+
__path = f'/{__path_parts["alias"]}/_rollover'
|
|
3310
3727
|
else:
|
|
3311
3728
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
3312
3729
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -3342,7 +3759,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3342
3759
|
if __body is not None:
|
|
3343
3760
|
__headers["content-type"] = "application/json"
|
|
3344
3761
|
return await self.perform_request( # type: ignore[return-value]
|
|
3345
|
-
"POST",
|
|
3762
|
+
"POST",
|
|
3763
|
+
__path,
|
|
3764
|
+
params=__query,
|
|
3765
|
+
headers=__headers,
|
|
3766
|
+
body=__body,
|
|
3767
|
+
endpoint_id="indices.rollover",
|
|
3768
|
+
path_parts=__path_parts,
|
|
3346
3769
|
)
|
|
3347
3770
|
|
|
3348
3771
|
@_rewrite_parameters()
|
|
@@ -3369,7 +3792,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3369
3792
|
"""
|
|
3370
3793
|
Provides low-level information about segments in a Lucene index.
|
|
3371
3794
|
|
|
3372
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3795
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-segments.html>`_
|
|
3373
3796
|
|
|
3374
3797
|
:param index: Comma-separated list of data streams, indices, and aliases used
|
|
3375
3798
|
to limit the request. Supports wildcards (`*`). To target all data streams
|
|
@@ -3385,9 +3808,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3385
3808
|
a missing or closed index.
|
|
3386
3809
|
:param verbose: If `true`, the request returns a verbose response.
|
|
3387
3810
|
"""
|
|
3811
|
+
__path_parts: t.Dict[str, str]
|
|
3388
3812
|
if index not in SKIP_IN_PATH:
|
|
3389
|
-
|
|
3813
|
+
__path_parts = {"index": _quote(index)}
|
|
3814
|
+
__path = f'/{__path_parts["index"]}/_segments'
|
|
3390
3815
|
else:
|
|
3816
|
+
__path_parts = {}
|
|
3391
3817
|
__path = "/_segments"
|
|
3392
3818
|
__query: t.Dict[str, t.Any] = {}
|
|
3393
3819
|
if allow_no_indices is not None:
|
|
@@ -3408,7 +3834,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3408
3834
|
__query["verbose"] = verbose
|
|
3409
3835
|
__headers = {"accept": "application/json"}
|
|
3410
3836
|
return await self.perform_request( # type: ignore[return-value]
|
|
3411
|
-
"GET",
|
|
3837
|
+
"GET",
|
|
3838
|
+
__path,
|
|
3839
|
+
params=__query,
|
|
3840
|
+
headers=__headers,
|
|
3841
|
+
endpoint_id="indices.segments",
|
|
3842
|
+
path_parts=__path_parts,
|
|
3412
3843
|
)
|
|
3413
3844
|
|
|
3414
3845
|
@_rewrite_parameters()
|
|
@@ -3440,7 +3871,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3440
3871
|
"""
|
|
3441
3872
|
Provides store information for shard copies of indices.
|
|
3442
3873
|
|
|
3443
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3874
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-shards-stores.html>`_
|
|
3444
3875
|
|
|
3445
3876
|
:param index: List of data streams, indices, and aliases used to limit the request.
|
|
3446
3877
|
:param allow_no_indices: If false, the request returns an error if any wildcard
|
|
@@ -3453,9 +3884,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3453
3884
|
in the response.
|
|
3454
3885
|
:param status: List of shard health statuses used to limit the request.
|
|
3455
3886
|
"""
|
|
3887
|
+
__path_parts: t.Dict[str, str]
|
|
3456
3888
|
if index not in SKIP_IN_PATH:
|
|
3457
|
-
|
|
3889
|
+
__path_parts = {"index": _quote(index)}
|
|
3890
|
+
__path = f'/{__path_parts["index"]}/_shard_stores'
|
|
3458
3891
|
else:
|
|
3892
|
+
__path_parts = {}
|
|
3459
3893
|
__path = "/_shard_stores"
|
|
3460
3894
|
__query: t.Dict[str, t.Any] = {}
|
|
3461
3895
|
if allow_no_indices is not None:
|
|
@@ -3476,7 +3910,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3476
3910
|
__query["status"] = status
|
|
3477
3911
|
__headers = {"accept": "application/json"}
|
|
3478
3912
|
return await self.perform_request( # type: ignore[return-value]
|
|
3479
|
-
"GET",
|
|
3913
|
+
"GET",
|
|
3914
|
+
__path,
|
|
3915
|
+
params=__query,
|
|
3916
|
+
headers=__headers,
|
|
3917
|
+
endpoint_id="indices.shard_stores",
|
|
3918
|
+
path_parts=__path_parts,
|
|
3480
3919
|
)
|
|
3481
3920
|
|
|
3482
3921
|
@_rewrite_parameters(
|
|
@@ -3505,7 +3944,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3505
3944
|
"""
|
|
3506
3945
|
Allow to shrink an existing index into a new index with fewer primary shards.
|
|
3507
3946
|
|
|
3508
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3947
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-shrink-index.html>`_
|
|
3509
3948
|
|
|
3510
3949
|
:param index: Name of the source index to shrink.
|
|
3511
3950
|
:param target: Name of the target index to create.
|
|
@@ -3524,7 +3963,11 @@ class IndicesClient(NamespacedClient):
|
|
|
3524
3963
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
3525
3964
|
if target in SKIP_IN_PATH:
|
|
3526
3965
|
raise ValueError("Empty value passed for parameter 'target'")
|
|
3527
|
-
|
|
3966
|
+
__path_parts: t.Dict[str, str] = {
|
|
3967
|
+
"index": _quote(index),
|
|
3968
|
+
"target": _quote(target),
|
|
3969
|
+
}
|
|
3970
|
+
__path = f'/{__path_parts["index"]}/_shrink/{__path_parts["target"]}'
|
|
3528
3971
|
__query: t.Dict[str, t.Any] = {}
|
|
3529
3972
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3530
3973
|
if error_trace is not None:
|
|
@@ -3552,7 +3995,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3552
3995
|
if __body is not None:
|
|
3553
3996
|
__headers["content-type"] = "application/json"
|
|
3554
3997
|
return await self.perform_request( # type: ignore[return-value]
|
|
3555
|
-
"PUT",
|
|
3998
|
+
"PUT",
|
|
3999
|
+
__path,
|
|
4000
|
+
params=__query,
|
|
4001
|
+
headers=__headers,
|
|
4002
|
+
body=__body,
|
|
4003
|
+
endpoint_id="indices.shrink",
|
|
4004
|
+
path_parts=__path_parts,
|
|
3556
4005
|
)
|
|
3557
4006
|
|
|
3558
4007
|
@_rewrite_parameters(
|
|
@@ -3594,7 +4043,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3594
4043
|
"""
|
|
3595
4044
|
Simulate matching the given index name against the index templates in the system
|
|
3596
4045
|
|
|
3597
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4046
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-simulate-index.html>`_
|
|
3598
4047
|
|
|
3599
4048
|
:param name: Index or template name to simulate
|
|
3600
4049
|
:param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
|
|
@@ -3634,7 +4083,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3634
4083
|
"""
|
|
3635
4084
|
if name in SKIP_IN_PATH:
|
|
3636
4085
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
3637
|
-
|
|
4086
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
4087
|
+
__path = f'/_index_template/_simulate_index/{__path_parts["name"]}'
|
|
3638
4088
|
__query: t.Dict[str, t.Any] = {}
|
|
3639
4089
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3640
4090
|
if create is not None:
|
|
@@ -3674,7 +4124,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3674
4124
|
if __body is not None:
|
|
3675
4125
|
__headers["content-type"] = "application/json"
|
|
3676
4126
|
return await self.perform_request( # type: ignore[return-value]
|
|
3677
|
-
"POST",
|
|
4127
|
+
"POST",
|
|
4128
|
+
__path,
|
|
4129
|
+
params=__query,
|
|
4130
|
+
headers=__headers,
|
|
4131
|
+
body=__body,
|
|
4132
|
+
endpoint_id="indices.simulate_index_template",
|
|
4133
|
+
path_parts=__path_parts,
|
|
3678
4134
|
)
|
|
3679
4135
|
|
|
3680
4136
|
@_rewrite_parameters(
|
|
@@ -3699,7 +4155,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3699
4155
|
"""
|
|
3700
4156
|
Simulate resolving the given template name or body
|
|
3701
4157
|
|
|
3702
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4158
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-simulate-template.html>`_
|
|
3703
4159
|
|
|
3704
4160
|
:param name: Name of the index template to simulate. To test a template configuration
|
|
3705
4161
|
before you add it to the cluster, omit this parameter and specify the template
|
|
@@ -3721,9 +4177,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3721
4177
|
)
|
|
3722
4178
|
elif template is not None and body is not None:
|
|
3723
4179
|
raise ValueError("Cannot set both 'template' and 'body'")
|
|
4180
|
+
__path_parts: t.Dict[str, str]
|
|
3724
4181
|
if name not in SKIP_IN_PATH:
|
|
3725
|
-
|
|
4182
|
+
__path_parts = {"name": _quote(name)}
|
|
4183
|
+
__path = f'/_index_template/_simulate/{__path_parts["name"]}'
|
|
3726
4184
|
else:
|
|
4185
|
+
__path_parts = {}
|
|
3727
4186
|
__path = "/_index_template/_simulate"
|
|
3728
4187
|
__query: t.Dict[str, t.Any] = {}
|
|
3729
4188
|
if create is not None:
|
|
@@ -3747,7 +4206,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3747
4206
|
if __body is not None:
|
|
3748
4207
|
__headers["content-type"] = "application/json"
|
|
3749
4208
|
return await self.perform_request( # type: ignore[return-value]
|
|
3750
|
-
"POST",
|
|
4209
|
+
"POST",
|
|
4210
|
+
__path,
|
|
4211
|
+
params=__query,
|
|
4212
|
+
headers=__headers,
|
|
4213
|
+
body=__body,
|
|
4214
|
+
endpoint_id="indices.simulate_template",
|
|
4215
|
+
path_parts=__path_parts,
|
|
3751
4216
|
)
|
|
3752
4217
|
|
|
3753
4218
|
@_rewrite_parameters(
|
|
@@ -3776,7 +4241,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3776
4241
|
"""
|
|
3777
4242
|
Allows you to split an existing index into a new index with more primary shards.
|
|
3778
4243
|
|
|
3779
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4244
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-split-index.html>`_
|
|
3780
4245
|
|
|
3781
4246
|
:param index: Name of the source index to split.
|
|
3782
4247
|
:param target: Name of the target index to create.
|
|
@@ -3795,7 +4260,11 @@ class IndicesClient(NamespacedClient):
|
|
|
3795
4260
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
3796
4261
|
if target in SKIP_IN_PATH:
|
|
3797
4262
|
raise ValueError("Empty value passed for parameter 'target'")
|
|
3798
|
-
|
|
4263
|
+
__path_parts: t.Dict[str, str] = {
|
|
4264
|
+
"index": _quote(index),
|
|
4265
|
+
"target": _quote(target),
|
|
4266
|
+
}
|
|
4267
|
+
__path = f'/{__path_parts["index"]}/_split/{__path_parts["target"]}'
|
|
3799
4268
|
__query: t.Dict[str, t.Any] = {}
|
|
3800
4269
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3801
4270
|
if error_trace is not None:
|
|
@@ -3823,7 +4292,13 @@ class IndicesClient(NamespacedClient):
|
|
|
3823
4292
|
if __body is not None:
|
|
3824
4293
|
__headers["content-type"] = "application/json"
|
|
3825
4294
|
return await self.perform_request( # type: ignore[return-value]
|
|
3826
|
-
"PUT",
|
|
4295
|
+
"PUT",
|
|
4296
|
+
__path,
|
|
4297
|
+
params=__query,
|
|
4298
|
+
headers=__headers,
|
|
4299
|
+
body=__body,
|
|
4300
|
+
endpoint_id="indices.split",
|
|
4301
|
+
path_parts=__path_parts,
|
|
3827
4302
|
)
|
|
3828
4303
|
|
|
3829
4304
|
@_rewrite_parameters()
|
|
@@ -3858,7 +4333,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3858
4333
|
"""
|
|
3859
4334
|
Provides statistics on operations happening in an index.
|
|
3860
4335
|
|
|
3861
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4336
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-stats.html>`_
|
|
3862
4337
|
|
|
3863
4338
|
:param index: A comma-separated list of index names; use `_all` or empty string
|
|
3864
4339
|
to perform the operation on all indices
|
|
@@ -3885,13 +4360,18 @@ class IndicesClient(NamespacedClient):
|
|
|
3885
4360
|
:param level: Indicates whether statistics are aggregated at the cluster, index,
|
|
3886
4361
|
or shard level.
|
|
3887
4362
|
"""
|
|
4363
|
+
__path_parts: t.Dict[str, str]
|
|
3888
4364
|
if index not in SKIP_IN_PATH and metric not in SKIP_IN_PATH:
|
|
3889
|
-
|
|
4365
|
+
__path_parts = {"index": _quote(index), "metric": _quote(metric)}
|
|
4366
|
+
__path = f'/{__path_parts["index"]}/_stats/{__path_parts["metric"]}'
|
|
3890
4367
|
elif index not in SKIP_IN_PATH:
|
|
3891
|
-
|
|
4368
|
+
__path_parts = {"index": _quote(index)}
|
|
4369
|
+
__path = f'/{__path_parts["index"]}/_stats'
|
|
3892
4370
|
elif metric not in SKIP_IN_PATH:
|
|
3893
|
-
|
|
4371
|
+
__path_parts = {"metric": _quote(metric)}
|
|
4372
|
+
__path = f'/_stats/{__path_parts["metric"]}'
|
|
3894
4373
|
else:
|
|
4374
|
+
__path_parts = {}
|
|
3895
4375
|
__path = "/_stats"
|
|
3896
4376
|
__query: t.Dict[str, t.Any] = {}
|
|
3897
4377
|
if completion_fields is not None:
|
|
@@ -3922,7 +4402,12 @@ class IndicesClient(NamespacedClient):
|
|
|
3922
4402
|
__query["pretty"] = pretty
|
|
3923
4403
|
__headers = {"accept": "application/json"}
|
|
3924
4404
|
return await self.perform_request( # type: ignore[return-value]
|
|
3925
|
-
"GET",
|
|
4405
|
+
"GET",
|
|
4406
|
+
__path,
|
|
4407
|
+
params=__query,
|
|
4408
|
+
headers=__headers,
|
|
4409
|
+
endpoint_id="indices.stats",
|
|
4410
|
+
path_parts=__path_parts,
|
|
3926
4411
|
)
|
|
3927
4412
|
|
|
3928
4413
|
@_rewrite_parameters()
|
|
@@ -3954,7 +4439,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3954
4439
|
Unfreezes an index. When a frozen index is unfrozen, the index goes through the
|
|
3955
4440
|
normal recovery process and becomes writeable again.
|
|
3956
4441
|
|
|
3957
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4442
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/unfreeze-index-api.html>`_
|
|
3958
4443
|
|
|
3959
4444
|
:param index: Identifier for the index.
|
|
3960
4445
|
:param allow_no_indices: If `false`, the request returns an error if any wildcard
|
|
@@ -3977,7 +4462,8 @@ class IndicesClient(NamespacedClient):
|
|
|
3977
4462
|
"""
|
|
3978
4463
|
if index in SKIP_IN_PATH:
|
|
3979
4464
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
3980
|
-
|
|
4465
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
4466
|
+
__path = f'/{__path_parts["index"]}/_unfreeze'
|
|
3981
4467
|
__query: t.Dict[str, t.Any] = {}
|
|
3982
4468
|
if allow_no_indices is not None:
|
|
3983
4469
|
__query["allow_no_indices"] = allow_no_indices
|
|
@@ -4001,7 +4487,12 @@ class IndicesClient(NamespacedClient):
|
|
|
4001
4487
|
__query["wait_for_active_shards"] = wait_for_active_shards
|
|
4002
4488
|
__headers = {"accept": "application/json"}
|
|
4003
4489
|
return await self.perform_request( # type: ignore[return-value]
|
|
4004
|
-
"POST",
|
|
4490
|
+
"POST",
|
|
4491
|
+
__path,
|
|
4492
|
+
params=__query,
|
|
4493
|
+
headers=__headers,
|
|
4494
|
+
endpoint_id="indices.unfreeze",
|
|
4495
|
+
path_parts=__path_parts,
|
|
4005
4496
|
)
|
|
4006
4497
|
|
|
4007
4498
|
@_rewrite_parameters(
|
|
@@ -4024,7 +4515,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4024
4515
|
"""
|
|
4025
4516
|
Updates index aliases.
|
|
4026
4517
|
|
|
4027
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4518
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/indices-aliases.html>`_
|
|
4028
4519
|
|
|
4029
4520
|
:param actions: Actions to perform.
|
|
4030
4521
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -4033,6 +4524,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4033
4524
|
:param timeout: Period to wait for a response. If no response is received before
|
|
4034
4525
|
the timeout expires, the request fails and returns an error.
|
|
4035
4526
|
"""
|
|
4527
|
+
__path_parts: t.Dict[str, str] = {}
|
|
4036
4528
|
__path = "/_aliases"
|
|
4037
4529
|
__query: t.Dict[str, t.Any] = {}
|
|
4038
4530
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -4053,7 +4545,13 @@ class IndicesClient(NamespacedClient):
|
|
|
4053
4545
|
__body["actions"] = actions
|
|
4054
4546
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4055
4547
|
return await self.perform_request( # type: ignore[return-value]
|
|
4056
|
-
"POST",
|
|
4548
|
+
"POST",
|
|
4549
|
+
__path,
|
|
4550
|
+
params=__query,
|
|
4551
|
+
headers=__headers,
|
|
4552
|
+
body=__body,
|
|
4553
|
+
endpoint_id="indices.update_aliases",
|
|
4554
|
+
path_parts=__path_parts,
|
|
4057
4555
|
)
|
|
4058
4556
|
|
|
4059
4557
|
@_rewrite_parameters(
|
|
@@ -4092,7 +4590,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4092
4590
|
"""
|
|
4093
4591
|
Allows a user to validate a potentially expensive query without executing it.
|
|
4094
4592
|
|
|
4095
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4593
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-validate.html>`_
|
|
4096
4594
|
|
|
4097
4595
|
:param index: Comma-separated list of data streams, indices, and aliases to search.
|
|
4098
4596
|
Supports wildcards (`*`). To search all data streams or indices, omit this
|
|
@@ -4125,9 +4623,12 @@ class IndicesClient(NamespacedClient):
|
|
|
4125
4623
|
:param rewrite: If `true`, returns a more detailed explanation showing the actual
|
|
4126
4624
|
Lucene query that will be executed.
|
|
4127
4625
|
"""
|
|
4626
|
+
__path_parts: t.Dict[str, str]
|
|
4128
4627
|
if index not in SKIP_IN_PATH:
|
|
4129
|
-
|
|
4628
|
+
__path_parts = {"index": _quote(index)}
|
|
4629
|
+
__path = f'/{__path_parts["index"]}/_validate/query'
|
|
4130
4630
|
else:
|
|
4631
|
+
__path_parts = {}
|
|
4131
4632
|
__path = "/_validate/query"
|
|
4132
4633
|
__query: t.Dict[str, t.Any] = {}
|
|
4133
4634
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -4172,5 +4673,11 @@ class IndicesClient(NamespacedClient):
|
|
|
4172
4673
|
if __body is not None:
|
|
4173
4674
|
__headers["content-type"] = "application/json"
|
|
4174
4675
|
return await self.perform_request( # type: ignore[return-value]
|
|
4175
|
-
"POST",
|
|
4676
|
+
"POST",
|
|
4677
|
+
__path,
|
|
4678
|
+
params=__query,
|
|
4679
|
+
headers=__headers,
|
|
4680
|
+
body=__body,
|
|
4681
|
+
endpoint_id="indices.validate_query",
|
|
4682
|
+
path_parts=__path_parts,
|
|
4176
4683
|
)
|