elasticsearch 8.19.0__py3-none-any.whl → 8.19.2__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/_async/client/__init__.py +39 -55
- elasticsearch/_async/client/cat.py +605 -35
- elasticsearch/_async/client/cluster.py +7 -2
- elasticsearch/_async/client/connector.py +3 -3
- elasticsearch/_async/client/esql.py +16 -6
- elasticsearch/_async/client/fleet.py +1 -5
- elasticsearch/_async/client/graph.py +1 -5
- elasticsearch/_async/client/ilm.py +2 -10
- elasticsearch/_async/client/indices.py +159 -32
- elasticsearch/_async/client/inference.py +142 -120
- elasticsearch/_async/client/nodes.py +2 -2
- elasticsearch/_async/client/shutdown.py +5 -15
- elasticsearch/_async/client/slm.py +1 -5
- elasticsearch/_async/client/snapshot.py +262 -112
- elasticsearch/_async/client/sql.py +1 -1
- elasticsearch/_async/client/streams.py +185 -0
- elasticsearch/_async/client/transform.py +60 -0
- elasticsearch/_async/client/watcher.py +1 -5
- elasticsearch/_async/helpers.py +58 -9
- elasticsearch/_sync/client/__init__.py +39 -55
- elasticsearch/_sync/client/cat.py +605 -35
- elasticsearch/_sync/client/cluster.py +7 -2
- elasticsearch/_sync/client/connector.py +3 -3
- elasticsearch/_sync/client/esql.py +16 -6
- elasticsearch/_sync/client/fleet.py +1 -5
- elasticsearch/_sync/client/graph.py +1 -5
- elasticsearch/_sync/client/ilm.py +2 -10
- elasticsearch/_sync/client/indices.py +159 -32
- elasticsearch/_sync/client/inference.py +142 -120
- elasticsearch/_sync/client/nodes.py +2 -2
- elasticsearch/_sync/client/shutdown.py +5 -15
- elasticsearch/_sync/client/slm.py +1 -5
- elasticsearch/_sync/client/snapshot.py +262 -112
- elasticsearch/_sync/client/sql.py +1 -1
- elasticsearch/_sync/client/streams.py +185 -0
- elasticsearch/_sync/client/transform.py +60 -0
- elasticsearch/_sync/client/watcher.py +1 -5
- elasticsearch/_version.py +2 -1
- elasticsearch/client.py +2 -0
- elasticsearch/compat.py +45 -1
- elasticsearch/dsl/__init__.py +28 -0
- elasticsearch/dsl/_async/document.py +84 -0
- elasticsearch/dsl/_sync/document.py +84 -0
- elasticsearch/dsl/aggs.py +117 -0
- elasticsearch/dsl/document_base.py +59 -1
- elasticsearch/dsl/field.py +60 -10
- elasticsearch/dsl/query.py +1 -1
- elasticsearch/dsl/response/__init__.py +3 -0
- elasticsearch/dsl/response/aggs.py +1 -1
- elasticsearch/dsl/types.py +325 -20
- elasticsearch/dsl/utils.py +1 -1
- elasticsearch/esql/__init__.py +2 -1
- elasticsearch/esql/esql.py +85 -34
- elasticsearch/esql/functions.py +37 -25
- elasticsearch/helpers/__init__.py +10 -1
- elasticsearch/helpers/actions.py +106 -33
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.2.dist-info}/METADATA +2 -4
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.2.dist-info}/RECORD +61 -59
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.2.dist-info}/WHEEL +0 -0
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.2.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.19.0.dist-info → elasticsearch-8.19.2.dist-info}/licenses/NOTICE +0 -0
|
@@ -373,8 +373,13 @@ class ClusterClient(NamespacedClient):
|
|
|
373
373
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/cluster-get-settings.html>`_
|
|
374
374
|
|
|
375
375
|
:param flat_settings: If `true`, returns settings in flat format.
|
|
376
|
-
:param include_defaults: If `true`, returns default
|
|
377
|
-
|
|
376
|
+
:param include_defaults: If `true`, also returns default values for all other
|
|
377
|
+
cluster settings, reflecting the values in the `elasticsearch.yml` file of
|
|
378
|
+
one of the nodes in the cluster. If the nodes in your cluster do not all
|
|
379
|
+
have the same values in their `elasticsearch.yml` config files then the values
|
|
380
|
+
returned by this API may vary from invocation to invocation and may not reflect
|
|
381
|
+
the values that Elasticsearch uses in all situations. Use the `GET _nodes/settings`
|
|
382
|
+
API to fetch the settings for each individual node in your cluster.
|
|
378
383
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
379
384
|
no response is received before the timeout expires, the request fails and
|
|
380
385
|
returns an error.
|
|
@@ -102,7 +102,7 @@ class ConnectorClient(NamespacedClient):
|
|
|
102
102
|
|
|
103
103
|
:param connector_id: The unique identifier of the connector to be deleted
|
|
104
104
|
:param delete_sync_jobs: A flag indicating if associated sync jobs should be
|
|
105
|
-
also removed.
|
|
105
|
+
also removed.
|
|
106
106
|
"""
|
|
107
107
|
if connector_id in SKIP_IN_PATH:
|
|
108
108
|
raise ValueError("Empty value passed for parameter 'connector_id'")
|
|
@@ -350,7 +350,7 @@ class ConnectorClient(NamespacedClient):
|
|
|
350
350
|
|
|
351
351
|
:param connector_name: A comma-separated list of connector names to fetch connector
|
|
352
352
|
documents for
|
|
353
|
-
:param from_: Starting offset
|
|
353
|
+
:param from_: Starting offset
|
|
354
354
|
:param index_name: A comma-separated list of connector index names to fetch connector
|
|
355
355
|
documents for
|
|
356
356
|
:param query: A wildcard query string that filters connectors with matching name,
|
|
@@ -941,7 +941,7 @@ class ConnectorClient(NamespacedClient):
|
|
|
941
941
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/list-connector-sync-jobs-api.html>`_
|
|
942
942
|
|
|
943
943
|
:param connector_id: A connector id to fetch connector sync jobs for
|
|
944
|
-
:param from_: Starting offset
|
|
944
|
+
:param from_: Starting offset
|
|
945
945
|
:param job_type: A comma-separated list of job types to fetch the sync jobs for
|
|
946
946
|
:param size: Specifies a max number of results to get
|
|
947
947
|
:param status: A sync job status to fetch connector sync jobs for
|
|
@@ -22,6 +22,9 @@ from elastic_transport import ObjectApiResponse
|
|
|
22
22
|
from ._base import NamespacedClient
|
|
23
23
|
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
24
24
|
|
|
25
|
+
if t.TYPE_CHECKING:
|
|
26
|
+
from elasticsearch.esql import ESQLBase
|
|
27
|
+
|
|
25
28
|
|
|
26
29
|
class EsqlClient(NamespacedClient):
|
|
27
30
|
|
|
@@ -44,7 +47,7 @@ class EsqlClient(NamespacedClient):
|
|
|
44
47
|
async def async_query(
|
|
45
48
|
self,
|
|
46
49
|
*,
|
|
47
|
-
query: t.Optional[str] = None,
|
|
50
|
+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
|
|
48
51
|
allow_partial_results: t.Optional[bool] = None,
|
|
49
52
|
columnar: t.Optional[bool] = None,
|
|
50
53
|
delimiter: t.Optional[str] = None,
|
|
@@ -107,7 +110,12 @@ class EsqlClient(NamespacedClient):
|
|
|
107
110
|
which has the name of all the columns.
|
|
108
111
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
109
112
|
set of documents that an ES|QL query runs on.
|
|
110
|
-
:param format: A short version of the Accept header,
|
|
113
|
+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
|
|
114
|
+
`tsv`, and `txt` formats will return results in a tabular format, excluding
|
|
115
|
+
other metadata fields from the response. For async requests, nothing will
|
|
116
|
+
be returned if the async query doesn't finish within the timeout. The query
|
|
117
|
+
ID and running status are available in the `X-Elasticsearch-Async-Id` and
|
|
118
|
+
`X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
|
|
111
119
|
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
112
120
|
query, the response will include an extra `_clusters` object with information
|
|
113
121
|
about the clusters that participated in the search along with info such as
|
|
@@ -161,7 +169,7 @@ class EsqlClient(NamespacedClient):
|
|
|
161
169
|
__query["pretty"] = pretty
|
|
162
170
|
if not __body:
|
|
163
171
|
if query is not None:
|
|
164
|
-
__body["query"] = query
|
|
172
|
+
__body["query"] = str(query)
|
|
165
173
|
if columnar is not None:
|
|
166
174
|
__body["columnar"] = columnar
|
|
167
175
|
if filter is not None:
|
|
@@ -399,7 +407,7 @@ class EsqlClient(NamespacedClient):
|
|
|
399
407
|
async def query(
|
|
400
408
|
self,
|
|
401
409
|
*,
|
|
402
|
-
query: t.Optional[str] = None,
|
|
410
|
+
query: t.Optional[t.Union[str, "ESQLBase"]] = None,
|
|
403
411
|
allow_partial_results: t.Optional[bool] = None,
|
|
404
412
|
columnar: t.Optional[bool] = None,
|
|
405
413
|
delimiter: t.Optional[str] = None,
|
|
@@ -456,7 +464,9 @@ class EsqlClient(NamespacedClient):
|
|
|
456
464
|
`all_columns` which has the name of all columns.
|
|
457
465
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
458
466
|
set of documents that an ES|QL query runs on.
|
|
459
|
-
:param format: A short version of the Accept header, e.g. json, yaml.
|
|
467
|
+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
|
|
468
|
+
`tsv`, and `txt` formats will return results in a tabular format, excluding
|
|
469
|
+
other metadata fields from the response.
|
|
460
470
|
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
461
471
|
query, the response will include an extra `_clusters` object with information
|
|
462
472
|
about the clusters that participated in the search along with info such as
|
|
@@ -496,7 +506,7 @@ class EsqlClient(NamespacedClient):
|
|
|
496
506
|
__query["pretty"] = pretty
|
|
497
507
|
if not __body:
|
|
498
508
|
if query is not None:
|
|
499
|
-
__body["query"] = query
|
|
509
|
+
__body["query"] = str(query)
|
|
500
510
|
if columnar is not None:
|
|
501
511
|
__body["columnar"] = columnar
|
|
502
512
|
if filter is not None:
|
|
@@ -644,11 +644,7 @@ class FleetClient(NamespacedClient):
|
|
|
644
644
|
__body["track_total_hits"] = track_total_hits
|
|
645
645
|
if version is not None:
|
|
646
646
|
__body["version"] = version
|
|
647
|
-
|
|
648
|
-
__body = None # type: ignore[assignment]
|
|
649
|
-
__headers = {"accept": "application/json"}
|
|
650
|
-
if __body is not None:
|
|
651
|
-
__headers["content-type"] = "application/json"
|
|
647
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
652
648
|
return await self.perform_request( # type: ignore[return-value]
|
|
653
649
|
"POST",
|
|
654
650
|
__path,
|
|
@@ -97,11 +97,7 @@ class GraphClient(NamespacedClient):
|
|
|
97
97
|
__body["query"] = query
|
|
98
98
|
if vertices is not None:
|
|
99
99
|
__body["vertices"] = vertices
|
|
100
|
-
|
|
101
|
-
__body = None # type: ignore[assignment]
|
|
102
|
-
__headers = {"accept": "application/json"}
|
|
103
|
-
if __body is not None:
|
|
104
|
-
__headers["content-type"] = "application/json"
|
|
100
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
105
101
|
return await self.perform_request( # type: ignore[return-value]
|
|
106
102
|
"POST",
|
|
107
103
|
__path,
|
|
@@ -376,11 +376,7 @@ class IlmClient(NamespacedClient):
|
|
|
376
376
|
__body["current_step"] = current_step
|
|
377
377
|
if next_step is not None:
|
|
378
378
|
__body["next_step"] = next_step
|
|
379
|
-
|
|
380
|
-
__body = None # type: ignore[assignment]
|
|
381
|
-
__headers = {"accept": "application/json"}
|
|
382
|
-
if __body is not None:
|
|
383
|
-
__headers["content-type"] = "application/json"
|
|
379
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
384
380
|
return await self.perform_request( # type: ignore[return-value]
|
|
385
381
|
"POST",
|
|
386
382
|
__path,
|
|
@@ -446,11 +442,7 @@ class IlmClient(NamespacedClient):
|
|
|
446
442
|
if not __body:
|
|
447
443
|
if policy is not None:
|
|
448
444
|
__body["policy"] = policy
|
|
449
|
-
|
|
450
|
-
__body = None # type: ignore[assignment]
|
|
451
|
-
__headers = {"accept": "application/json"}
|
|
452
|
-
if __body is not None:
|
|
453
|
-
__headers["content-type"] = "application/json"
|
|
445
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
454
446
|
return await self.perform_request( # type: ignore[return-value]
|
|
455
447
|
"PUT",
|
|
456
448
|
__path,
|
|
@@ -232,11 +232,7 @@ class IndicesClient(NamespacedClient):
|
|
|
232
232
|
__body["text"] = text
|
|
233
233
|
if tokenizer is not None:
|
|
234
234
|
__body["tokenizer"] = tokenizer
|
|
235
|
-
|
|
236
|
-
__body = None # type: ignore[assignment]
|
|
237
|
-
__headers = {"accept": "application/json"}
|
|
238
|
-
if __body is not None:
|
|
239
|
-
__headers["content-type"] = "application/json"
|
|
235
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
240
236
|
return await self.perform_request( # type: ignore[return-value]
|
|
241
237
|
"POST",
|
|
242
238
|
__path,
|
|
@@ -804,11 +800,7 @@ class IndicesClient(NamespacedClient):
|
|
|
804
800
|
raise ValueError("Empty value passed for parameter 'source'")
|
|
805
801
|
if dest in SKIP_IN_PATH:
|
|
806
802
|
raise ValueError("Empty value passed for parameter 'dest'")
|
|
807
|
-
if create_from is None and body is None:
|
|
808
|
-
raise ValueError(
|
|
809
|
-
"Empty value passed for parameters 'create_from' and 'body', one of them should be set."
|
|
810
|
-
)
|
|
811
|
-
elif create_from is not None and body is not None:
|
|
803
|
+
if create_from is not None and body is not None:
|
|
812
804
|
raise ValueError("Cannot set both 'create_from' and 'body'")
|
|
813
805
|
__path_parts: t.Dict[str, str] = {
|
|
814
806
|
"source": _quote(source),
|
|
@@ -825,7 +817,11 @@ class IndicesClient(NamespacedClient):
|
|
|
825
817
|
if pretty is not None:
|
|
826
818
|
__query["pretty"] = pretty
|
|
827
819
|
__body = create_from if create_from is not None else body
|
|
828
|
-
|
|
820
|
+
if not __body:
|
|
821
|
+
__body = None
|
|
822
|
+
__headers = {"accept": "application/json"}
|
|
823
|
+
if __body is not None:
|
|
824
|
+
__headers["content-type"] = "application/json"
|
|
829
825
|
return await self.perform_request( # type: ignore[return-value]
|
|
830
826
|
"PUT",
|
|
831
827
|
__path,
|
|
@@ -2467,6 +2463,57 @@ class IndicesClient(NamespacedClient):
|
|
|
2467
2463
|
path_parts=__path_parts,
|
|
2468
2464
|
)
|
|
2469
2465
|
|
|
2466
|
+
@_rewrite_parameters()
|
|
2467
|
+
async def get_data_stream_settings(
|
|
2468
|
+
self,
|
|
2469
|
+
*,
|
|
2470
|
+
name: t.Union[str, t.Sequence[str]],
|
|
2471
|
+
error_trace: t.Optional[bool] = None,
|
|
2472
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2473
|
+
human: t.Optional[bool] = None,
|
|
2474
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
2475
|
+
pretty: t.Optional[bool] = None,
|
|
2476
|
+
) -> ObjectApiResponse[t.Any]:
|
|
2477
|
+
"""
|
|
2478
|
+
.. raw:: html
|
|
2479
|
+
|
|
2480
|
+
<p>Get data stream settings.</p>
|
|
2481
|
+
<p>Get setting information for one or more data streams.</p>
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-get-data-stream-settings.html>`_
|
|
2485
|
+
|
|
2486
|
+
:param name: A comma-separated list of data streams or data stream patterns.
|
|
2487
|
+
Supports wildcards (`*`).
|
|
2488
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
2489
|
+
If no response is received before the timeout expires, the request fails
|
|
2490
|
+
and returns an error.
|
|
2491
|
+
"""
|
|
2492
|
+
if name in SKIP_IN_PATH:
|
|
2493
|
+
raise ValueError("Empty value passed for parameter 'name'")
|
|
2494
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
2495
|
+
__path = f'/_data_stream/{__path_parts["name"]}/_settings'
|
|
2496
|
+
__query: t.Dict[str, t.Any] = {}
|
|
2497
|
+
if error_trace is not None:
|
|
2498
|
+
__query["error_trace"] = error_trace
|
|
2499
|
+
if filter_path is not None:
|
|
2500
|
+
__query["filter_path"] = filter_path
|
|
2501
|
+
if human is not None:
|
|
2502
|
+
__query["human"] = human
|
|
2503
|
+
if master_timeout is not None:
|
|
2504
|
+
__query["master_timeout"] = master_timeout
|
|
2505
|
+
if pretty is not None:
|
|
2506
|
+
__query["pretty"] = pretty
|
|
2507
|
+
__headers = {"accept": "application/json"}
|
|
2508
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
2509
|
+
"GET",
|
|
2510
|
+
__path,
|
|
2511
|
+
params=__query,
|
|
2512
|
+
headers=__headers,
|
|
2513
|
+
endpoint_id="indices.get_data_stream_settings",
|
|
2514
|
+
path_parts=__path_parts,
|
|
2515
|
+
)
|
|
2516
|
+
|
|
2470
2517
|
@_rewrite_parameters()
|
|
2471
2518
|
async def get_field_mapping(
|
|
2472
2519
|
self,
|
|
@@ -3453,11 +3500,7 @@ class IndicesClient(NamespacedClient):
|
|
|
3453
3500
|
__body["downsampling"] = downsampling
|
|
3454
3501
|
if enabled is not None:
|
|
3455
3502
|
__body["enabled"] = enabled
|
|
3456
|
-
|
|
3457
|
-
__body = None # type: ignore[assignment]
|
|
3458
|
-
__headers = {"accept": "application/json"}
|
|
3459
|
-
if __body is not None:
|
|
3460
|
-
__headers["content-type"] = "application/json"
|
|
3503
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3461
3504
|
return await self.perform_request( # type: ignore[return-value]
|
|
3462
3505
|
"PUT",
|
|
3463
3506
|
__path,
|
|
@@ -3468,6 +3511,84 @@ class IndicesClient(NamespacedClient):
|
|
|
3468
3511
|
path_parts=__path_parts,
|
|
3469
3512
|
)
|
|
3470
3513
|
|
|
3514
|
+
@_rewrite_parameters(
|
|
3515
|
+
body_name="settings",
|
|
3516
|
+
)
|
|
3517
|
+
async def put_data_stream_settings(
|
|
3518
|
+
self,
|
|
3519
|
+
*,
|
|
3520
|
+
name: t.Union[str, t.Sequence[str]],
|
|
3521
|
+
settings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3522
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3523
|
+
dry_run: t.Optional[bool] = None,
|
|
3524
|
+
error_trace: t.Optional[bool] = None,
|
|
3525
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
3526
|
+
human: t.Optional[bool] = None,
|
|
3527
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3528
|
+
pretty: t.Optional[bool] = None,
|
|
3529
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
3530
|
+
) -> ObjectApiResponse[t.Any]:
|
|
3531
|
+
"""
|
|
3532
|
+
.. raw:: html
|
|
3533
|
+
|
|
3534
|
+
<p>Update data stream settings.</p>
|
|
3535
|
+
<p>This API can be used to override settings on specific data streams. These overrides will take precedence over what
|
|
3536
|
+
is specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,
|
|
3537
|
+
only certain settings are allowed. If possible, the setting change is applied to all
|
|
3538
|
+
backing indices. Otherwise, it will be applied when the data stream is next rolled over.</p>
|
|
3539
|
+
|
|
3540
|
+
|
|
3541
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-put-data-stream-settings.html>`_
|
|
3542
|
+
|
|
3543
|
+
:param name: A comma-separated list of data streams or data stream patterns.
|
|
3544
|
+
:param settings:
|
|
3545
|
+
:param dry_run: If `true`, the request does not actually change the settings
|
|
3546
|
+
on any data streams or indices. Instead, it simulates changing the settings
|
|
3547
|
+
and reports back to the user what would have happened had these settings
|
|
3548
|
+
actually been applied.
|
|
3549
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
3550
|
+
If no response is received before the timeout expires, the request fails
|
|
3551
|
+
and returns an error.
|
|
3552
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
3553
|
+
before the timeout expires, the request fails and returns an error.
|
|
3554
|
+
"""
|
|
3555
|
+
if name in SKIP_IN_PATH:
|
|
3556
|
+
raise ValueError("Empty value passed for parameter 'name'")
|
|
3557
|
+
if settings is None and body is None:
|
|
3558
|
+
raise ValueError(
|
|
3559
|
+
"Empty value passed for parameters 'settings' and 'body', one of them should be set."
|
|
3560
|
+
)
|
|
3561
|
+
elif settings is not None and body is not None:
|
|
3562
|
+
raise ValueError("Cannot set both 'settings' and 'body'")
|
|
3563
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
3564
|
+
__path = f'/_data_stream/{__path_parts["name"]}/_settings'
|
|
3565
|
+
__query: t.Dict[str, t.Any] = {}
|
|
3566
|
+
if dry_run is not None:
|
|
3567
|
+
__query["dry_run"] = dry_run
|
|
3568
|
+
if error_trace is not None:
|
|
3569
|
+
__query["error_trace"] = error_trace
|
|
3570
|
+
if filter_path is not None:
|
|
3571
|
+
__query["filter_path"] = filter_path
|
|
3572
|
+
if human is not None:
|
|
3573
|
+
__query["human"] = human
|
|
3574
|
+
if master_timeout is not None:
|
|
3575
|
+
__query["master_timeout"] = master_timeout
|
|
3576
|
+
if pretty is not None:
|
|
3577
|
+
__query["pretty"] = pretty
|
|
3578
|
+
if timeout is not None:
|
|
3579
|
+
__query["timeout"] = timeout
|
|
3580
|
+
__body = settings if settings is not None else body
|
|
3581
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3582
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
3583
|
+
"PUT",
|
|
3584
|
+
__path,
|
|
3585
|
+
params=__query,
|
|
3586
|
+
headers=__headers,
|
|
3587
|
+
body=__body,
|
|
3588
|
+
endpoint_id="indices.put_data_stream_settings",
|
|
3589
|
+
path_parts=__path_parts,
|
|
3590
|
+
)
|
|
3591
|
+
|
|
3471
3592
|
@_rewrite_parameters(
|
|
3472
3593
|
body_fields=(
|
|
3473
3594
|
"allow_auto_create",
|
|
@@ -4207,6 +4328,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4207
4328
|
For data streams, the API runs the refresh operation on the stream’s backing indices.</p>
|
|
4208
4329
|
<p>By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.
|
|
4209
4330
|
You can change this default interval with the <code>index.refresh_interval</code> setting.</p>
|
|
4331
|
+
<p>In Elastic Cloud Serverless, the default refresh interval is 5 seconds across all indices.</p>
|
|
4210
4332
|
<p>Refresh requests are synchronous and do not return a response until the refresh operation completes.</p>
|
|
4211
4333
|
<p>Refreshes are resource-intensive.
|
|
4212
4334
|
To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.</p>
|
|
@@ -4581,7 +4703,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4581
4703
|
.. raw:: html
|
|
4582
4704
|
|
|
4583
4705
|
<p>Roll over to a new index.
|
|
4584
|
-
TIP:
|
|
4706
|
+
TIP: We recommend using the index lifecycle rollover action to automate rollovers. However, Serverless does not support Index Lifecycle Management (ILM), so don't use this approach in the Serverless context.</p>
|
|
4585
4707
|
<p>The rollover API creates a new index for a data stream or index alias.
|
|
4586
4708
|
The API behavior depends on the rollover target.</p>
|
|
4587
4709
|
<p><strong>Roll over a data stream</strong></p>
|
|
@@ -4962,11 +5084,7 @@ class IndicesClient(NamespacedClient):
|
|
|
4962
5084
|
__body["aliases"] = aliases
|
|
4963
5085
|
if settings is not None:
|
|
4964
5086
|
__body["settings"] = settings
|
|
4965
|
-
|
|
4966
|
-
__body = None # type: ignore[assignment]
|
|
4967
|
-
__headers = {"accept": "application/json"}
|
|
4968
|
-
if __body is not None:
|
|
4969
|
-
__headers["content-type"] = "application/json"
|
|
5087
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4970
5088
|
return await self.perform_request( # type: ignore[return-value]
|
|
4971
5089
|
"PUT",
|
|
4972
5090
|
__path,
|
|
@@ -4977,7 +5095,9 @@ class IndicesClient(NamespacedClient):
|
|
|
4977
5095
|
path_parts=__path_parts,
|
|
4978
5096
|
)
|
|
4979
5097
|
|
|
4980
|
-
@_rewrite_parameters(
|
|
5098
|
+
@_rewrite_parameters(
|
|
5099
|
+
body_name="index_template",
|
|
5100
|
+
)
|
|
4981
5101
|
async def simulate_index_template(
|
|
4982
5102
|
self,
|
|
4983
5103
|
*,
|
|
@@ -4988,6 +5108,8 @@ class IndicesClient(NamespacedClient):
|
|
|
4988
5108
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
4989
5109
|
human: t.Optional[bool] = None,
|
|
4990
5110
|
include_defaults: t.Optional[bool] = None,
|
|
5111
|
+
index_template: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
5112
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4991
5113
|
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4992
5114
|
pretty: t.Optional[bool] = None,
|
|
4993
5115
|
) -> ObjectApiResponse[t.Any]:
|
|
@@ -5007,12 +5129,15 @@ class IndicesClient(NamespacedClient):
|
|
|
5007
5129
|
only be dry-run added if new or can also replace an existing one
|
|
5008
5130
|
:param include_defaults: If true, returns all relevant default configurations
|
|
5009
5131
|
for the index template.
|
|
5132
|
+
:param index_template:
|
|
5010
5133
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
5011
5134
|
no response is received before the timeout expires, the request fails and
|
|
5012
5135
|
returns an error.
|
|
5013
5136
|
"""
|
|
5014
5137
|
if name in SKIP_IN_PATH:
|
|
5015
5138
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
5139
|
+
if index_template is not None and body is not None:
|
|
5140
|
+
raise ValueError("Cannot set both 'index_template' and 'body'")
|
|
5016
5141
|
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
5017
5142
|
__path = f'/_index_template/_simulate_index/{__path_parts["name"]}'
|
|
5018
5143
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -5032,12 +5157,18 @@ class IndicesClient(NamespacedClient):
|
|
|
5032
5157
|
__query["master_timeout"] = master_timeout
|
|
5033
5158
|
if pretty is not None:
|
|
5034
5159
|
__query["pretty"] = pretty
|
|
5160
|
+
__body = index_template if index_template is not None else body
|
|
5161
|
+
if not __body:
|
|
5162
|
+
__body = None
|
|
5035
5163
|
__headers = {"accept": "application/json"}
|
|
5164
|
+
if __body is not None:
|
|
5165
|
+
__headers["content-type"] = "application/json"
|
|
5036
5166
|
return await self.perform_request( # type: ignore[return-value]
|
|
5037
5167
|
"POST",
|
|
5038
5168
|
__path,
|
|
5039
5169
|
params=__query,
|
|
5040
5170
|
headers=__headers,
|
|
5171
|
+
body=__body,
|
|
5041
5172
|
endpoint_id="indices.simulate_index_template",
|
|
5042
5173
|
path_parts=__path_parts,
|
|
5043
5174
|
)
|
|
@@ -5305,11 +5436,7 @@ class IndicesClient(NamespacedClient):
|
|
|
5305
5436
|
__body["aliases"] = aliases
|
|
5306
5437
|
if settings is not None:
|
|
5307
5438
|
__body["settings"] = settings
|
|
5308
|
-
|
|
5309
|
-
__body = None # type: ignore[assignment]
|
|
5310
|
-
__headers = {"accept": "application/json"}
|
|
5311
|
-
if __body is not None:
|
|
5312
|
-
__headers["content-type"] = "application/json"
|
|
5439
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
5313
5440
|
return await self.perform_request( # type: ignore[return-value]
|
|
5314
5441
|
"PUT",
|
|
5315
5442
|
__path,
|
|
@@ -5386,8 +5513,8 @@ class IndicesClient(NamespacedClient):
|
|
|
5386
5513
|
are requested).
|
|
5387
5514
|
:param include_unloaded_segments: If true, the response includes information
|
|
5388
5515
|
from segments that are not loaded into memory.
|
|
5389
|
-
:param level: Indicates whether statistics are aggregated at the cluster,
|
|
5390
|
-
or
|
|
5516
|
+
:param level: Indicates whether statistics are aggregated at the cluster, indices,
|
|
5517
|
+
or shards level.
|
|
5391
5518
|
"""
|
|
5392
5519
|
__path_parts: t.Dict[str, str]
|
|
5393
5520
|
if index not in SKIP_IN_PATH and metric not in SKIP_IN_PATH:
|
|
@@ -5639,8 +5766,8 @@ class IndicesClient(NamespacedClient):
|
|
|
5639
5766
|
:param analyze_wildcard: If `true`, wildcard and prefix queries are analyzed.
|
|
5640
5767
|
:param analyzer: Analyzer to use for the query string. This parameter can only
|
|
5641
5768
|
be used when the `q` query string parameter is specified.
|
|
5642
|
-
:param default_operator: The default operator for query string query: `
|
|
5643
|
-
`
|
|
5769
|
+
:param default_operator: The default operator for query string query: `and` or
|
|
5770
|
+
`or`.
|
|
5644
5771
|
:param df: Field to use as default where no field prefix is given in the query
|
|
5645
5772
|
string. This parameter can only be used when the `q` query string parameter
|
|
5646
5773
|
is specified.
|