Skip to content

Commit 4e71728

Browse files
Auto-generated API code
1 parent 4834052 commit 4e71728

File tree

15 files changed

+1698
-99
lines changed

15 files changed

+1698
-99
lines changed

elasticsearch/_async/client/cat.py

Lines changed: 480 additions & 24 deletions
Large diffs are not rendered by default.

elasticsearch/_async/client/indices.py

Lines changed: 153 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,11 @@ async def create_from(
825825
if pretty is not None:
826826
__query["pretty"] = pretty
827827
__body = create_from if create_from is not None else body
828-
__headers = {"accept": "application/json", "content-type": "application/json"}
828+
if not __body:
829+
__body = None
830+
__headers = {"accept": "application/json"}
831+
if __body is not None:
832+
__headers["content-type"] = "application/json"
829833
return await self.perform_request( # type: ignore[return-value]
830834
"PUT",
831835
__path,
@@ -2467,6 +2471,57 @@ async def get_data_stream(
24672471
path_parts=__path_parts,
24682472
)
24692473

2474+
@_rewrite_parameters()
2475+
async def get_data_stream_settings(
2476+
self,
2477+
*,
2478+
name: t.Union[str, t.Sequence[str]],
2479+
error_trace: t.Optional[bool] = None,
2480+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2481+
human: t.Optional[bool] = None,
2482+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2483+
pretty: t.Optional[bool] = None,
2484+
) -> ObjectApiResponse[t.Any]:
2485+
"""
2486+
.. raw:: html
2487+
2488+
<p>Get data stream settings.</p>
2489+
<p>Get setting information for one or more data streams.</p>
2490+
2491+
2492+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-get-data-stream-settings.html>`_
2493+
2494+
:param name: A comma-separated list of data streams or data stream patterns.
2495+
Supports wildcards (`*`).
2496+
:param master_timeout: The period to wait for a connection to the master node.
2497+
If no response is received before the timeout expires, the request fails
2498+
and returns an error.
2499+
"""
2500+
if name in SKIP_IN_PATH:
2501+
raise ValueError("Empty value passed for parameter 'name'")
2502+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
2503+
__path = f'/_data_stream/{__path_parts["name"]}/_settings'
2504+
__query: t.Dict[str, t.Any] = {}
2505+
if error_trace is not None:
2506+
__query["error_trace"] = error_trace
2507+
if filter_path is not None:
2508+
__query["filter_path"] = filter_path
2509+
if human is not None:
2510+
__query["human"] = human
2511+
if master_timeout is not None:
2512+
__query["master_timeout"] = master_timeout
2513+
if pretty is not None:
2514+
__query["pretty"] = pretty
2515+
__headers = {"accept": "application/json"}
2516+
return await self.perform_request( # type: ignore[return-value]
2517+
"GET",
2518+
__path,
2519+
params=__query,
2520+
headers=__headers,
2521+
endpoint_id="indices.get_data_stream_settings",
2522+
path_parts=__path_parts,
2523+
)
2524+
24702525
@_rewrite_parameters()
24712526
async def get_field_mapping(
24722527
self,
@@ -3468,6 +3523,84 @@ async def put_data_lifecycle(
34683523
path_parts=__path_parts,
34693524
)
34703525

3526+
@_rewrite_parameters(
3527+
body_name="settings",
3528+
)
3529+
async def put_data_stream_settings(
3530+
self,
3531+
*,
3532+
name: t.Union[str, t.Sequence[str]],
3533+
settings: t.Optional[t.Mapping[str, t.Any]] = None,
3534+
body: t.Optional[t.Mapping[str, t.Any]] = None,
3535+
dry_run: t.Optional[bool] = None,
3536+
error_trace: t.Optional[bool] = None,
3537+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3538+
human: t.Optional[bool] = None,
3539+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3540+
pretty: t.Optional[bool] = None,
3541+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3542+
) -> ObjectApiResponse[t.Any]:
3543+
"""
3544+
.. raw:: html
3545+
3546+
<p>Update data stream settings.</p>
3547+
<p>This API can be used to override settings on specific data streams. These overrides will take precedence over what
3548+
is specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,
3549+
only certain settings are allowed. If possible, the setting change is applied to all
3550+
backing indices. Otherwise, it will be applied when the data stream is next rolled over.</p>
3551+
3552+
3553+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/indices-put-data-stream-settings.html>`_
3554+
3555+
:param name: A comma-separated list of data streams or data stream patterns.
3556+
:param settings:
3557+
:param dry_run: If `true`, the request does not actually change the settings
3558+
on any data streams or indices. Instead, it simulates changing the settings
3559+
and reports back to the user what would have happened had these settings
3560+
actually been applied.
3561+
:param master_timeout: The period to wait for a connection to the master node.
3562+
If no response is received before the timeout expires, the request fails
3563+
and returns an error.
3564+
:param timeout: The period to wait for a response. If no response is received
3565+
before the timeout expires, the request fails and returns an error.
3566+
"""
3567+
if name in SKIP_IN_PATH:
3568+
raise ValueError("Empty value passed for parameter 'name'")
3569+
if settings is None and body is None:
3570+
raise ValueError(
3571+
"Empty value passed for parameters 'settings' and 'body', one of them should be set."
3572+
)
3573+
elif settings is not None and body is not None:
3574+
raise ValueError("Cannot set both 'settings' and 'body'")
3575+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
3576+
__path = f'/_data_stream/{__path_parts["name"]}/_settings'
3577+
__query: t.Dict[str, t.Any] = {}
3578+
if dry_run is not None:
3579+
__query["dry_run"] = dry_run
3580+
if error_trace is not None:
3581+
__query["error_trace"] = error_trace
3582+
if filter_path is not None:
3583+
__query["filter_path"] = filter_path
3584+
if human is not None:
3585+
__query["human"] = human
3586+
if master_timeout is not None:
3587+
__query["master_timeout"] = master_timeout
3588+
if pretty is not None:
3589+
__query["pretty"] = pretty
3590+
if timeout is not None:
3591+
__query["timeout"] = timeout
3592+
__body = settings if settings is not None else body
3593+
__headers = {"accept": "application/json", "content-type": "application/json"}
3594+
return await self.perform_request( # type: ignore[return-value]
3595+
"PUT",
3596+
__path,
3597+
params=__query,
3598+
headers=__headers,
3599+
body=__body,
3600+
endpoint_id="indices.put_data_stream_settings",
3601+
path_parts=__path_parts,
3602+
)
3603+
34713604
@_rewrite_parameters(
34723605
body_fields=(
34733606
"allow_auto_create",
@@ -4207,6 +4340,7 @@ async def refresh(
42074340
For data streams, the API runs the refresh operation on the stream’s backing indices.</p>
42084341
<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.
42094342
You can change this default interval with the <code>index.refresh_interval</code> setting.</p>
4343+
<p>In Elastic Cloud Serverless, the default refresh interval is 5 seconds across all indices.</p>
42104344
<p>Refresh requests are synchronous and do not return a response until the refresh operation completes.</p>
42114345
<p>Refreshes are resource-intensive.
42124346
To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible.</p>
@@ -4977,7 +5111,9 @@ async def shrink(
49775111
path_parts=__path_parts,
49785112
)
49795113

4980-
@_rewrite_parameters()
5114+
@_rewrite_parameters(
5115+
body_name="index_template",
5116+
)
49815117
async def simulate_index_template(
49825118
self,
49835119
*,
@@ -4988,6 +5124,8 @@ async def simulate_index_template(
49885124
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
49895125
human: t.Optional[bool] = None,
49905126
include_defaults: t.Optional[bool] = None,
5127+
index_template: t.Optional[t.Mapping[str, t.Any]] = None,
5128+
body: t.Optional[t.Mapping[str, t.Any]] = None,
49915129
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
49925130
pretty: t.Optional[bool] = None,
49935131
) -> ObjectApiResponse[t.Any]:
@@ -5007,12 +5145,19 @@ async def simulate_index_template(
50075145
only be dry-run added if new or can also replace an existing one
50085146
:param include_defaults: If true, returns all relevant default configurations
50095147
for the index template.
5148+
:param index_template:
50105149
:param master_timeout: Period to wait for a connection to the master node. If
50115150
no response is received before the timeout expires, the request fails and
50125151
returns an error.
50135152
"""
50145153
if name in SKIP_IN_PATH:
50155154
raise ValueError("Empty value passed for parameter 'name'")
5155+
if index_template is None and body is None:
5156+
raise ValueError(
5157+
"Empty value passed for parameters 'index_template' and 'body', one of them should be set."
5158+
)
5159+
elif index_template is not None and body is not None:
5160+
raise ValueError("Cannot set both 'index_template' and 'body'")
50165161
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
50175162
__path = f'/_index_template/_simulate_index/{__path_parts["name"]}'
50185163
__query: t.Dict[str, t.Any] = {}
@@ -5032,12 +5177,18 @@ async def simulate_index_template(
50325177
__query["master_timeout"] = master_timeout
50335178
if pretty is not None:
50345179
__query["pretty"] = pretty
5180+
__body = index_template if index_template is not None else body
5181+
if not __body:
5182+
__body = None
50355183
__headers = {"accept": "application/json"}
5184+
if __body is not None:
5185+
__headers["content-type"] = "application/json"
50365186
return await self.perform_request( # type: ignore[return-value]
50375187
"POST",
50385188
__path,
50395189
params=__query,
50405190
headers=__headers,
5191+
body=__body,
50415192
endpoint_id="indices.simulate_index_template",
50425193
path_parts=__path_parts,
50435194
)

elasticsearch/_async/client/inference.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,7 @@ async def sparse_embedding(
25032503
)
25042504

25052505
@_rewrite_parameters(
2506-
body_fields=("input", "task_settings"),
2506+
body_fields=("input", "input_type", "task_settings"),
25072507
)
25082508
async def text_embedding(
25092509
self,
@@ -2513,6 +2513,7 @@ async def text_embedding(
25132513
error_trace: t.Optional[bool] = None,
25142514
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
25152515
human: t.Optional[bool] = None,
2516+
input_type: t.Optional[str] = None,
25162517
pretty: t.Optional[bool] = None,
25172518
task_settings: t.Optional[t.Any] = None,
25182519
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -2528,6 +2529,13 @@ async def text_embedding(
25282529
25292530
:param inference_id: The inference Id
25302531
:param input: Inference input. Either a string or an array of strings.
2532+
:param input_type: The input data type for the text embedding model. Possible
2533+
values include: * `SEARCH` * `INGEST` * `CLASSIFICATION` * `CLUSTERING` Not
2534+
all services support all values. Unsupported values will trigger a validation
2535+
exception. Accepted values depend on the configured inference service, refer
2536+
to the relevant service-specific documentation for more info. > info > The
2537+
`input_type` parameter specified on the root level of the request body will
2538+
take precedence over the `input_type` parameter specified in `task_settings`.
25312539
:param task_settings: Optional task settings
25322540
:param timeout: Specifies the amount of time to wait for the inference request
25332541
to complete.
@@ -2553,6 +2561,8 @@ async def text_embedding(
25532561
if not __body:
25542562
if input is not None:
25552563
__body["input"] = input
2564+
if input_type is not None:
2565+
__body["input_type"] = input_type
25562566
if task_settings is not None:
25572567
__body["task_settings"] = task_settings
25582568
if not __body:

elasticsearch/_async/client/shutdown.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ async def delete_node(
3333
error_trace: t.Optional[bool] = None,
3434
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3535
human: t.Optional[bool] = None,
36-
master_timeout: t.Optional[
37-
t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
38-
] = None,
36+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3937
pretty: t.Optional[bool] = None,
40-
timeout: t.Optional[
41-
t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
42-
] = None,
38+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4339
) -> ObjectApiResponse[t.Any]:
4440
"""
4541
.. raw:: html
@@ -97,9 +93,7 @@ async def get_node(
9793
error_trace: t.Optional[bool] = None,
9894
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
9995
human: t.Optional[bool] = None,
100-
master_timeout: t.Optional[
101-
t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
102-
] = None,
96+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
10397
pretty: t.Optional[bool] = None,
10498
) -> ObjectApiResponse[t.Any]:
10599
"""
@@ -162,14 +156,10 @@ async def put_node(
162156
error_trace: t.Optional[bool] = None,
163157
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
164158
human: t.Optional[bool] = None,
165-
master_timeout: t.Optional[
166-
t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
167-
] = None,
159+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
168160
pretty: t.Optional[bool] = None,
169161
target_node_name: t.Optional[str] = None,
170-
timeout: t.Optional[
171-
t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
172-
] = None,
162+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
173163
body: t.Optional[t.Dict[str, t.Any]] = None,
174164
) -> ObjectApiResponse[t.Any]:
175165
"""

0 commit comments

Comments
 (0)