Skip to content

Commit afc777c

Browse files
Auto-generated code for 8.15 (#2642)
Co-authored-by: Quentin Pradet <[email protected]>
1 parent c78b236 commit afc777c

File tree

8 files changed

+390
-2
lines changed

8 files changed

+390
-2
lines changed

elasticsearch/_async/client/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -4980,6 +4980,7 @@ async def update_by_query(
49804980
pipeline: t.Optional[str] = None,
49814981
preference: t.Optional[str] = None,
49824982
pretty: t.Optional[bool] = None,
4983+
q: t.Optional[str] = None,
49834984
query: t.Optional[t.Mapping[str, t.Any]] = None,
49844985
refresh: t.Optional[bool] = None,
49854986
request_cache: t.Optional[bool] = None,
@@ -5046,6 +5047,7 @@ async def update_by_query(
50465047
parameter.
50475048
:param preference: Specifies the node or shard the operation should be performed
50485049
on. Random by default.
5050+
:param q: Query in the Lucene query string syntax.
50495051
:param query: Specifies the documents to update using the Query DSL.
50505052
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
50515053
operation visible to search.
@@ -5130,6 +5132,8 @@ async def update_by_query(
51305132
__query["preference"] = preference
51315133
if pretty is not None:
51325134
__query["pretty"] = pretty
5135+
if q is not None:
5136+
__query["q"] = q
51335137
if refresh is not None:
51345138
__query["refresh"] = refresh
51355139
if request_cache is not None:

elasticsearch/_async/client/indices.py

+13
Original file line numberDiff line numberDiff line change
@@ -3614,6 +3614,7 @@ async def resolve_index(
36143614
self,
36153615
*,
36163616
name: t.Union[str, t.Sequence[str]],
3617+
allow_no_indices: t.Optional[bool] = None,
36173618
error_trace: t.Optional[bool] = None,
36183619
expand_wildcards: t.Optional[
36193620
t.Union[
@@ -3625,6 +3626,7 @@ async def resolve_index(
36253626
] = None,
36263627
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
36273628
human: t.Optional[bool] = None,
3629+
ignore_unavailable: t.Optional[bool] = None,
36283630
pretty: t.Optional[bool] = None,
36293631
) -> ObjectApiResponse[t.Any]:
36303632
"""
@@ -3636,16 +3638,25 @@ async def resolve_index(
36363638
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
36373639
and data streams to resolve. Resources on remote clusters can be specified
36383640
using the `<cluster>`:`<name>` syntax.
3641+
:param allow_no_indices: If `false`, the request returns an error if any wildcard
3642+
expression, index alias, or `_all` value targets only missing or closed indices.
3643+
This behavior applies even if the request targets other open indices. For
3644+
example, a request targeting `foo*,bar*` returns an error if an index starts
3645+
with `foo` but no index starts with `bar`.
36393646
:param expand_wildcards: Type of index that wildcard patterns can match. If the
36403647
request can target data streams, this argument determines whether wildcard
36413648
expressions match hidden data streams. Supports comma-separated values, such
36423649
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
3650+
:param ignore_unavailable: If `false`, the request returns an error if it targets
3651+
a missing or closed index.
36433652
"""
36443653
if name in SKIP_IN_PATH:
36453654
raise ValueError("Empty value passed for parameter 'name'")
36463655
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
36473656
__path = f'/_resolve/index/{__path_parts["name"]}'
36483657
__query: t.Dict[str, t.Any] = {}
3658+
if allow_no_indices is not None:
3659+
__query["allow_no_indices"] = allow_no_indices
36493660
if error_trace is not None:
36503661
__query["error_trace"] = error_trace
36513662
if expand_wildcards is not None:
@@ -3654,6 +3665,8 @@ async def resolve_index(
36543665
__query["filter_path"] = filter_path
36553666
if human is not None:
36563667
__query["human"] = human
3668+
if ignore_unavailable is not None:
3669+
__query["ignore_unavailable"] = ignore_unavailable
36573670
if pretty is not None:
36583671
__query["pretty"] = pretty
36593672
__headers = {"accept": "application/json"}

elasticsearch/_async/client/ingest.py

+175
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,57 @@
2525

2626
class IngestClient(NamespacedClient):
2727

28+
@_rewrite_parameters()
29+
async def delete_geoip_database(
30+
self,
31+
*,
32+
id: t.Union[str, t.Sequence[str]],
33+
error_trace: t.Optional[bool] = None,
34+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
35+
human: t.Optional[bool] = None,
36+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
37+
pretty: t.Optional[bool] = None,
38+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
39+
) -> ObjectApiResponse[t.Any]:
40+
"""
41+
Deletes a geoip database configuration.
42+
43+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/TODO.html>`_
44+
45+
:param id: A comma-separated list of geoip database configurations to delete
46+
:param master_timeout: Period to wait for a connection to the master node. If
47+
no response is received before the timeout expires, the request fails and
48+
returns an error.
49+
:param timeout: Period to wait for a response. If no response is received before
50+
the timeout expires, the request fails and returns an error.
51+
"""
52+
if id in SKIP_IN_PATH:
53+
raise ValueError("Empty value passed for parameter 'id'")
54+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
55+
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
56+
__query: t.Dict[str, t.Any] = {}
57+
if error_trace is not None:
58+
__query["error_trace"] = error_trace
59+
if filter_path is not None:
60+
__query["filter_path"] = filter_path
61+
if human is not None:
62+
__query["human"] = human
63+
if master_timeout is not None:
64+
__query["master_timeout"] = master_timeout
65+
if pretty is not None:
66+
__query["pretty"] = pretty
67+
if timeout is not None:
68+
__query["timeout"] = timeout
69+
__headers = {"accept": "application/json"}
70+
return await self.perform_request( # type: ignore[return-value]
71+
"DELETE",
72+
__path,
73+
params=__query,
74+
headers=__headers,
75+
endpoint_id="ingest.delete_geoip_database",
76+
path_parts=__path_parts,
77+
)
78+
2879
@_rewrite_parameters()
2980
async def delete_pipeline(
3081
self,
@@ -112,6 +163,57 @@ async def geo_ip_stats(
112163
path_parts=__path_parts,
113164
)
114165

166+
@_rewrite_parameters()
167+
async def get_geoip_database(
168+
self,
169+
*,
170+
id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
171+
error_trace: t.Optional[bool] = None,
172+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
173+
human: t.Optional[bool] = None,
174+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
175+
pretty: t.Optional[bool] = None,
176+
) -> ObjectApiResponse[t.Any]:
177+
"""
178+
Returns information about one or more geoip database configurations.
179+
180+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/TODO.html>`_
181+
182+
:param id: Comma-separated list of database configuration IDs to retrieve. Wildcard
183+
(`*`) expressions are supported. To get all database configurations, omit
184+
this parameter or use `*`.
185+
:param master_timeout: Period to wait for a connection to the master node. If
186+
no response is received before the timeout expires, the request fails and
187+
returns an error.
188+
"""
189+
__path_parts: t.Dict[str, str]
190+
if id not in SKIP_IN_PATH:
191+
__path_parts = {"id": _quote(id)}
192+
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
193+
else:
194+
__path_parts = {}
195+
__path = "/_ingest/geoip/database"
196+
__query: t.Dict[str, t.Any] = {}
197+
if error_trace is not None:
198+
__query["error_trace"] = error_trace
199+
if filter_path is not None:
200+
__query["filter_path"] = filter_path
201+
if human is not None:
202+
__query["human"] = human
203+
if master_timeout is not None:
204+
__query["master_timeout"] = master_timeout
205+
if pretty is not None:
206+
__query["pretty"] = pretty
207+
__headers = {"accept": "application/json"}
208+
return await self.perform_request( # type: ignore[return-value]
209+
"GET",
210+
__path,
211+
params=__query,
212+
headers=__headers,
213+
endpoint_id="ingest.get_geoip_database",
214+
path_parts=__path_parts,
215+
)
216+
115217
@_rewrite_parameters()
116218
async def get_pipeline(
117219
self,
@@ -205,6 +307,79 @@ async def processor_grok(
205307
path_parts=__path_parts,
206308
)
207309

310+
@_rewrite_parameters(
311+
body_fields=("maxmind", "name"),
312+
)
313+
async def put_geoip_database(
314+
self,
315+
*,
316+
id: str,
317+
maxmind: t.Optional[t.Mapping[str, t.Any]] = None,
318+
name: t.Optional[str] = None,
319+
error_trace: t.Optional[bool] = None,
320+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
321+
human: t.Optional[bool] = None,
322+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
323+
pretty: t.Optional[bool] = None,
324+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
325+
body: t.Optional[t.Dict[str, t.Any]] = None,
326+
) -> ObjectApiResponse[t.Any]:
327+
"""
328+
Returns information about one or more geoip database configurations.
329+
330+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/TODO.html>`_
331+
332+
:param id: ID of the database configuration to create or update.
333+
:param maxmind: The configuration necessary to identify which IP geolocation
334+
provider to use to download the database, as well as any provider-specific
335+
configuration necessary for such downloading. At present, the only supported
336+
provider is maxmind, and the maxmind provider requires that an account_id
337+
(string) is configured.
338+
:param name: The provider-assigned name of the IP geolocation database to download.
339+
:param master_timeout: Period to wait for a connection to the master node. If
340+
no response is received before the timeout expires, the request fails and
341+
returns an error.
342+
:param timeout: Period to wait for a response. If no response is received before
343+
the timeout expires, the request fails and returns an error.
344+
"""
345+
if id in SKIP_IN_PATH:
346+
raise ValueError("Empty value passed for parameter 'id'")
347+
if maxmind is None and body is None:
348+
raise ValueError("Empty value passed for parameter 'maxmind'")
349+
if name is None and body is None:
350+
raise ValueError("Empty value passed for parameter 'name'")
351+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
352+
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
353+
__query: t.Dict[str, t.Any] = {}
354+
__body: t.Dict[str, t.Any] = body if body is not None else {}
355+
if error_trace is not None:
356+
__query["error_trace"] = error_trace
357+
if filter_path is not None:
358+
__query["filter_path"] = filter_path
359+
if human is not None:
360+
__query["human"] = human
361+
if master_timeout is not None:
362+
__query["master_timeout"] = master_timeout
363+
if pretty is not None:
364+
__query["pretty"] = pretty
365+
if timeout is not None:
366+
__query["timeout"] = timeout
367+
if not __body:
368+
if maxmind is not None:
369+
__body["maxmind"] = maxmind
370+
if name is not None:
371+
__body["name"] = name
372+
__headers = {"accept": "application/json", "content-type": "application/json"}
373+
return await self.perform_request( # type: ignore[return-value]
374+
"PUT",
375+
__path,
376+
params=__query,
377+
headers=__headers,
378+
body=__body,
379+
endpoint_id="ingest.put_geoip_database",
380+
path_parts=__path_parts,
381+
)
382+
208383
@_rewrite_parameters(
209384
body_fields=("description", "meta", "on_failure", "processors", "version"),
210385
parameter_aliases={"_meta": "meta"},

elasticsearch/_async/client/synonyms.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ async def put_synonym(
262262
self,
263263
*,
264264
id: str,
265-
synonyms_set: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
265+
synonyms_set: t.Optional[
266+
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
267+
] = None,
266268
error_trace: t.Optional[bool] = None,
267269
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
268270
human: t.Optional[bool] = None,

elasticsearch/_sync/client/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -4978,6 +4978,7 @@ def update_by_query(
49784978
pipeline: t.Optional[str] = None,
49794979
preference: t.Optional[str] = None,
49804980
pretty: t.Optional[bool] = None,
4981+
q: t.Optional[str] = None,
49814982
query: t.Optional[t.Mapping[str, t.Any]] = None,
49824983
refresh: t.Optional[bool] = None,
49834984
request_cache: t.Optional[bool] = None,
@@ -5044,6 +5045,7 @@ def update_by_query(
50445045
parameter.
50455046
:param preference: Specifies the node or shard the operation should be performed
50465047
on. Random by default.
5048+
:param q: Query in the Lucene query string syntax.
50475049
:param query: Specifies the documents to update using the Query DSL.
50485050
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
50495051
operation visible to search.
@@ -5128,6 +5130,8 @@ def update_by_query(
51285130
__query["preference"] = preference
51295131
if pretty is not None:
51305132
__query["pretty"] = pretty
5133+
if q is not None:
5134+
__query["q"] = q
51315135
if refresh is not None:
51325136
__query["refresh"] = refresh
51335137
if request_cache is not None:

elasticsearch/_sync/client/indices.py

+13
Original file line numberDiff line numberDiff line change
@@ -3614,6 +3614,7 @@ def resolve_index(
36143614
self,
36153615
*,
36163616
name: t.Union[str, t.Sequence[str]],
3617+
allow_no_indices: t.Optional[bool] = None,
36173618
error_trace: t.Optional[bool] = None,
36183619
expand_wildcards: t.Optional[
36193620
t.Union[
@@ -3625,6 +3626,7 @@ def resolve_index(
36253626
] = None,
36263627
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
36273628
human: t.Optional[bool] = None,
3629+
ignore_unavailable: t.Optional[bool] = None,
36283630
pretty: t.Optional[bool] = None,
36293631
) -> ObjectApiResponse[t.Any]:
36303632
"""
@@ -3636,16 +3638,25 @@ def resolve_index(
36363638
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
36373639
and data streams to resolve. Resources on remote clusters can be specified
36383640
using the `<cluster>`:`<name>` syntax.
3641+
:param allow_no_indices: If `false`, the request returns an error if any wildcard
3642+
expression, index alias, or `_all` value targets only missing or closed indices.
3643+
This behavior applies even if the request targets other open indices. For
3644+
example, a request targeting `foo*,bar*` returns an error if an index starts
3645+
with `foo` but no index starts with `bar`.
36393646
:param expand_wildcards: Type of index that wildcard patterns can match. If the
36403647
request can target data streams, this argument determines whether wildcard
36413648
expressions match hidden data streams. Supports comma-separated values, such
36423649
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
3650+
:param ignore_unavailable: If `false`, the request returns an error if it targets
3651+
a missing or closed index.
36433652
"""
36443653
if name in SKIP_IN_PATH:
36453654
raise ValueError("Empty value passed for parameter 'name'")
36463655
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
36473656
__path = f'/_resolve/index/{__path_parts["name"]}'
36483657
__query: t.Dict[str, t.Any] = {}
3658+
if allow_no_indices is not None:
3659+
__query["allow_no_indices"] = allow_no_indices
36493660
if error_trace is not None:
36503661
__query["error_trace"] = error_trace
36513662
if expand_wildcards is not None:
@@ -3654,6 +3665,8 @@ def resolve_index(
36543665
__query["filter_path"] = filter_path
36553666
if human is not None:
36563667
__query["human"] = human
3668+
if ignore_unavailable is not None:
3669+
__query["ignore_unavailable"] = ignore_unavailable
36573670
if pretty is not None:
36583671
__query["pretty"] = pretty
36593672
__headers = {"accept": "application/json"}

0 commit comments

Comments
 (0)