Skip to content

Commit bd52716

Browse files
Auto-generated API code (#2768)
1 parent 03033cc commit bd52716

File tree

8 files changed

+1330
-436
lines changed

8 files changed

+1330
-436
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 434 additions & 218 deletions
Large diffs are not rendered by default.

elasticsearch/_async/client/async_search.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ async def submit(
270270
ignore_throttled: t.Optional[bool] = None,
271271
ignore_unavailable: t.Optional[bool] = None,
272272
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
273+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
273274
keep_on_completion: t.Optional[bool] = None,
274275
knn: t.Optional[
275276
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -383,6 +384,9 @@ async def submit(
383384
:param ignore_unavailable: Whether specified concrete indices should be ignored
384385
when unavailable (missing or closed)
385386
:param indices_boost: Boosts the _score of documents from specified indices.
387+
:param keep_alive: Specifies how long the async search needs to be available.
388+
Ongoing async searches and any saved search results are deleted after this
389+
period.
386390
:param keep_on_completion: If `true`, results are stored for later retrieval
387391
when the search completes within the `wait_for_completion_timeout`.
388392
:param knn: Defines the approximate kNN search to run.
@@ -508,6 +512,8 @@ async def submit(
508512
__query["ignore_throttled"] = ignore_throttled
509513
if ignore_unavailable is not None:
510514
__query["ignore_unavailable"] = ignore_unavailable
515+
if keep_alive is not None:
516+
__query["keep_alive"] = keep_alive
511517
if keep_on_completion is not None:
512518
__query["keep_on_completion"] = keep_on_completion
513519
if lenient is not None:

elasticsearch/_async/client/connector.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ async def delete(
8585
delete_sync_jobs: t.Optional[bool] = None,
8686
error_trace: t.Optional[bool] = None,
8787
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
88+
hard: t.Optional[bool] = None,
8889
human: t.Optional[bool] = None,
8990
pretty: t.Optional[bool] = None,
9091
) -> ObjectApiResponse[t.Any]:
@@ -103,6 +104,7 @@ async def delete(
103104
:param connector_id: The unique identifier of the connector to be deleted
104105
:param delete_sync_jobs: A flag indicating if associated sync jobs should be
105106
also removed. Defaults to false.
107+
:param hard: A flag indicating if the connector should be hard deleted.
106108
"""
107109
if connector_id in SKIP_IN_PATH:
108110
raise ValueError("Empty value passed for parameter 'connector_id'")
@@ -115,6 +117,8 @@ async def delete(
115117
__query["error_trace"] = error_trace
116118
if filter_path is not None:
117119
__query["filter_path"] = filter_path
120+
if hard is not None:
121+
__query["hard"] = hard
118122
if human is not None:
119123
__query["human"] = human
120124
if pretty is not None:
@@ -138,6 +142,7 @@ async def get(
138142
error_trace: t.Optional[bool] = None,
139143
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
140144
human: t.Optional[bool] = None,
145+
include_deleted: t.Optional[bool] = None,
141146
pretty: t.Optional[bool] = None,
142147
) -> ObjectApiResponse[t.Any]:
143148
"""
@@ -150,6 +155,8 @@ async def get(
150155
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-api.html>`_
151156
152157
:param connector_id: The unique identifier of the connector
158+
:param include_deleted: A flag to indicate if the desired connector should be
159+
fetched, even if it was soft-deleted.
153160
"""
154161
if connector_id in SKIP_IN_PATH:
155162
raise ValueError("Empty value passed for parameter 'connector_id'")
@@ -162,6 +169,8 @@ async def get(
162169
__query["filter_path"] = filter_path
163170
if human is not None:
164171
__query["human"] = human
172+
if include_deleted is not None:
173+
__query["include_deleted"] = include_deleted
165174
if pretty is not None:
166175
__query["pretty"] = pretty
167176
__headers = {"accept": "application/json"}
@@ -333,6 +342,7 @@ async def list(
333342
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
334343
from_: t.Optional[int] = None,
335344
human: t.Optional[bool] = None,
345+
include_deleted: t.Optional[bool] = None,
336346
index_name: t.Optional[t.Union[str, t.Sequence[str]]] = None,
337347
pretty: t.Optional[bool] = None,
338348
query: t.Optional[str] = None,
@@ -351,6 +361,8 @@ async def list(
351361
:param connector_name: A comma-separated list of connector names to fetch connector
352362
documents for
353363
:param from_: Starting offset (default: 0)
364+
:param include_deleted: A flag to indicate if the desired connector should be
365+
fetched, even if it was soft-deleted.
354366
:param index_name: A comma-separated list of connector index names to fetch connector
355367
documents for
356368
:param query: A wildcard query string that filters connectors with matching name,
@@ -372,6 +384,8 @@ async def list(
372384
__query["from"] = from_
373385
if human is not None:
374386
__query["human"] = human
387+
if include_deleted is not None:
388+
__query["include_deleted"] = include_deleted
375389
if index_name is not None:
376390
__query["index_name"] = index_name
377391
if pretty is not None:

elasticsearch/_async/client/indices.py

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,51 @@ async def analyze(
230230
path_parts=__path_parts,
231231
)
232232

233+
@_rewrite_parameters()
234+
@_stability_warning(Stability.EXPERIMENTAL)
235+
async def cancel_migrate_reindex(
236+
self,
237+
*,
238+
index: t.Union[str, t.Sequence[str]],
239+
error_trace: t.Optional[bool] = None,
240+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
241+
human: t.Optional[bool] = None,
242+
pretty: t.Optional[bool] = None,
243+
) -> ObjectApiResponse[t.Any]:
244+
"""
245+
.. raw:: html
246+
247+
<p>Cancel a migration reindex operation.</p>
248+
<p>Cancel a migration reindex attempt for a data stream or index.</p>
249+
250+
251+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html>`_
252+
253+
:param index: The index or data stream name
254+
"""
255+
if index in SKIP_IN_PATH:
256+
raise ValueError("Empty value passed for parameter 'index'")
257+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
258+
__path = f'/_migration/reindex/{__path_parts["index"]}/_cancel'
259+
__query: t.Dict[str, t.Any] = {}
260+
if error_trace is not None:
261+
__query["error_trace"] = error_trace
262+
if filter_path is not None:
263+
__query["filter_path"] = filter_path
264+
if human is not None:
265+
__query["human"] = human
266+
if pretty is not None:
267+
__query["pretty"] = pretty
268+
__headers = {"accept": "application/json"}
269+
return await self.perform_request( # type: ignore[return-value]
270+
"POST",
271+
__path,
272+
params=__query,
273+
headers=__headers,
274+
endpoint_id="indices.cancel_migrate_reindex",
275+
path_parts=__path_parts,
276+
)
277+
233278
@_rewrite_parameters()
234279
async def clear_cache(
235280
self,
@@ -710,6 +755,71 @@ async def create_data_stream(
710755
path_parts=__path_parts,
711756
)
712757

758+
@_rewrite_parameters(
759+
body_name="create_from",
760+
)
761+
@_stability_warning(Stability.EXPERIMENTAL)
762+
async def create_from(
763+
self,
764+
*,
765+
source: str,
766+
dest: str,
767+
create_from: t.Optional[t.Mapping[str, t.Any]] = None,
768+
body: t.Optional[t.Mapping[str, t.Any]] = None,
769+
error_trace: t.Optional[bool] = None,
770+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
771+
human: t.Optional[bool] = None,
772+
pretty: t.Optional[bool] = None,
773+
) -> ObjectApiResponse[t.Any]:
774+
"""
775+
.. raw:: html
776+
777+
<p>Create an index from a source index.</p>
778+
<p>Copy the mappings and settings from the source index to a destination index while allowing request settings and mappings to override the source values.</p>
779+
780+
781+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html>`_
782+
783+
:param source: The source index or data stream name
784+
:param dest: The destination index or data stream name
785+
:param create_from:
786+
"""
787+
if source in SKIP_IN_PATH:
788+
raise ValueError("Empty value passed for parameter 'source'")
789+
if dest in SKIP_IN_PATH:
790+
raise ValueError("Empty value passed for parameter 'dest'")
791+
if create_from is None and body is None:
792+
raise ValueError(
793+
"Empty value passed for parameters 'create_from' and 'body', one of them should be set."
794+
)
795+
elif create_from is not None and body is not None:
796+
raise ValueError("Cannot set both 'create_from' and 'body'")
797+
__path_parts: t.Dict[str, str] = {
798+
"source": _quote(source),
799+
"dest": _quote(dest),
800+
}
801+
__path = f'/_create_from/{__path_parts["source"]}/{__path_parts["dest"]}'
802+
__query: t.Dict[str, t.Any] = {}
803+
if error_trace is not None:
804+
__query["error_trace"] = error_trace
805+
if filter_path is not None:
806+
__query["filter_path"] = filter_path
807+
if human is not None:
808+
__query["human"] = human
809+
if pretty is not None:
810+
__query["pretty"] = pretty
811+
__body = create_from if create_from is not None else body
812+
__headers = {"accept": "application/json", "content-type": "application/json"}
813+
return await self.perform_request( # type: ignore[return-value]
814+
"PUT",
815+
__path,
816+
params=__query,
817+
headers=__headers,
818+
body=__body,
819+
endpoint_id="indices.create_from",
820+
path_parts=__path_parts,
821+
)
822+
713823
@_rewrite_parameters()
714824
async def data_streams_stats(
715825
self,
@@ -2587,6 +2697,51 @@ async def get_mapping(
25872697
path_parts=__path_parts,
25882698
)
25892699

2700+
@_rewrite_parameters()
2701+
@_stability_warning(Stability.EXPERIMENTAL)
2702+
async def get_migrate_reindex_status(
2703+
self,
2704+
*,
2705+
index: t.Union[str, t.Sequence[str]],
2706+
error_trace: t.Optional[bool] = None,
2707+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2708+
human: t.Optional[bool] = None,
2709+
pretty: t.Optional[bool] = None,
2710+
) -> ObjectApiResponse[t.Any]:
2711+
"""
2712+
.. raw:: html
2713+
2714+
<p>Get the migration reindexing status.</p>
2715+
<p>Get the status of a migration reindex attempt for a data stream or index.</p>
2716+
2717+
2718+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html>`_
2719+
2720+
:param index: The index or data stream name.
2721+
"""
2722+
if index in SKIP_IN_PATH:
2723+
raise ValueError("Empty value passed for parameter 'index'")
2724+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
2725+
__path = f'/_migration/reindex/{__path_parts["index"]}/_status'
2726+
__query: t.Dict[str, t.Any] = {}
2727+
if error_trace is not None:
2728+
__query["error_trace"] = error_trace
2729+
if filter_path is not None:
2730+
__query["filter_path"] = filter_path
2731+
if human is not None:
2732+
__query["human"] = human
2733+
if pretty is not None:
2734+
__query["pretty"] = pretty
2735+
__headers = {"accept": "application/json"}
2736+
return await self.perform_request( # type: ignore[return-value]
2737+
"GET",
2738+
__path,
2739+
params=__query,
2740+
headers=__headers,
2741+
endpoint_id="indices.get_migrate_reindex_status",
2742+
path_parts=__path_parts,
2743+
)
2744+
25902745
@_rewrite_parameters()
25912746
async def get_settings(
25922747
self,
@@ -2756,6 +2911,62 @@ async def get_template(
27562911
path_parts=__path_parts,
27572912
)
27582913

2914+
@_rewrite_parameters(
2915+
body_name="reindex",
2916+
)
2917+
@_stability_warning(Stability.EXPERIMENTAL)
2918+
async def migrate_reindex(
2919+
self,
2920+
*,
2921+
reindex: t.Optional[t.Mapping[str, t.Any]] = None,
2922+
body: t.Optional[t.Mapping[str, t.Any]] = None,
2923+
error_trace: t.Optional[bool] = None,
2924+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2925+
human: t.Optional[bool] = None,
2926+
pretty: t.Optional[bool] = None,
2927+
) -> ObjectApiResponse[t.Any]:
2928+
"""
2929+
.. raw:: html
2930+
2931+
<p>Reindex legacy backing indices.</p>
2932+
<p>Reindex all legacy backing indices for a data stream.
2933+
This operation occurs in a persistent task.
2934+
The persistent task ID is returned immediately and the reindexing work is completed in that task.</p>
2935+
2936+
2937+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/migrate-data-stream.html>`_
2938+
2939+
:param reindex:
2940+
"""
2941+
if reindex is None and body is None:
2942+
raise ValueError(
2943+
"Empty value passed for parameters 'reindex' and 'body', one of them should be set."
2944+
)
2945+
elif reindex is not None and body is not None:
2946+
raise ValueError("Cannot set both 'reindex' and 'body'")
2947+
__path_parts: t.Dict[str, str] = {}
2948+
__path = "/_migration/reindex"
2949+
__query: t.Dict[str, t.Any] = {}
2950+
if error_trace is not None:
2951+
__query["error_trace"] = error_trace
2952+
if filter_path is not None:
2953+
__query["filter_path"] = filter_path
2954+
if human is not None:
2955+
__query["human"] = human
2956+
if pretty is not None:
2957+
__query["pretty"] = pretty
2958+
__body = reindex if reindex is not None else body
2959+
__headers = {"accept": "application/json", "content-type": "application/json"}
2960+
return await self.perform_request( # type: ignore[return-value]
2961+
"POST",
2962+
__path,
2963+
params=__query,
2964+
headers=__headers,
2965+
body=__body,
2966+
endpoint_id="indices.migrate_reindex",
2967+
path_parts=__path_parts,
2968+
)
2969+
27592970
@_rewrite_parameters()
27602971
async def migrate_to_data_stream(
27612972
self,

0 commit comments

Comments
 (0)