elasticsearch9 9.0.0__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.
- elasticsearch9/__init__.py +98 -0
- elasticsearch9/_async/__init__.py +16 -0
- elasticsearch9/_async/client/__init__.py +6531 -0
- elasticsearch9/_async/client/_base.py +430 -0
- elasticsearch9/_async/client/async_search.py +637 -0
- elasticsearch9/_async/client/autoscaling.py +252 -0
- elasticsearch9/_async/client/cat.py +2995 -0
- elasticsearch9/_async/client/ccr.py +1043 -0
- elasticsearch9/_async/client/cluster.py +1223 -0
- elasticsearch9/_async/client/connector.py +1978 -0
- elasticsearch9/_async/client/dangling_indices.py +192 -0
- elasticsearch9/_async/client/enrich.py +291 -0
- elasticsearch9/_async/client/eql.py +359 -0
- elasticsearch9/_async/client/esql.py +490 -0
- elasticsearch9/_async/client/features.py +130 -0
- elasticsearch9/_async/client/fleet.py +658 -0
- elasticsearch9/_async/client/graph.py +113 -0
- elasticsearch9/_async/client/ilm.py +668 -0
- elasticsearch9/_async/client/indices.py +5582 -0
- elasticsearch9/_async/client/inference.py +2247 -0
- elasticsearch9/_async/client/ingest.py +766 -0
- elasticsearch9/_async/client/license.py +400 -0
- elasticsearch9/_async/client/logstash.py +176 -0
- elasticsearch9/_async/client/migration.py +160 -0
- elasticsearch9/_async/client/ml.py +5835 -0
- elasticsearch9/_async/client/monitoring.py +100 -0
- elasticsearch9/_async/client/nodes.py +543 -0
- elasticsearch9/_async/client/query_rules.py +485 -0
- elasticsearch9/_async/client/rollup.py +616 -0
- elasticsearch9/_async/client/search_application.py +574 -0
- elasticsearch9/_async/client/searchable_snapshots.py +313 -0
- elasticsearch9/_async/client/security.py +4688 -0
- elasticsearch9/_async/client/shutdown.py +268 -0
- elasticsearch9/_async/client/simulate.py +145 -0
- elasticsearch9/_async/client/slm.py +559 -0
- elasticsearch9/_async/client/snapshot.py +1338 -0
- elasticsearch9/_async/client/sql.py +469 -0
- elasticsearch9/_async/client/ssl.py +76 -0
- elasticsearch9/_async/client/synonyms.py +413 -0
- elasticsearch9/_async/client/tasks.py +295 -0
- elasticsearch9/_async/client/text_structure.py +664 -0
- elasticsearch9/_async/client/transform.py +922 -0
- elasticsearch9/_async/client/utils.py +48 -0
- elasticsearch9/_async/client/watcher.py +894 -0
- elasticsearch9/_async/client/xpack.py +134 -0
- elasticsearch9/_async/helpers.py +596 -0
- elasticsearch9/_otel.py +110 -0
- elasticsearch9/_sync/__init__.py +16 -0
- elasticsearch9/_sync/client/__init__.py +6529 -0
- elasticsearch9/_sync/client/_base.py +430 -0
- elasticsearch9/_sync/client/async_search.py +637 -0
- elasticsearch9/_sync/client/autoscaling.py +252 -0
- elasticsearch9/_sync/client/cat.py +2995 -0
- elasticsearch9/_sync/client/ccr.py +1043 -0
- elasticsearch9/_sync/client/cluster.py +1223 -0
- elasticsearch9/_sync/client/connector.py +1978 -0
- elasticsearch9/_sync/client/dangling_indices.py +192 -0
- elasticsearch9/_sync/client/enrich.py +291 -0
- elasticsearch9/_sync/client/eql.py +359 -0
- elasticsearch9/_sync/client/esql.py +490 -0
- elasticsearch9/_sync/client/features.py +130 -0
- elasticsearch9/_sync/client/fleet.py +658 -0
- elasticsearch9/_sync/client/graph.py +113 -0
- elasticsearch9/_sync/client/ilm.py +668 -0
- elasticsearch9/_sync/client/indices.py +5582 -0
- elasticsearch9/_sync/client/inference.py +2247 -0
- elasticsearch9/_sync/client/ingest.py +766 -0
- elasticsearch9/_sync/client/license.py +400 -0
- elasticsearch9/_sync/client/logstash.py +176 -0
- elasticsearch9/_sync/client/migration.py +160 -0
- elasticsearch9/_sync/client/ml.py +5835 -0
- elasticsearch9/_sync/client/monitoring.py +100 -0
- elasticsearch9/_sync/client/nodes.py +543 -0
- elasticsearch9/_sync/client/query_rules.py +485 -0
- elasticsearch9/_sync/client/rollup.py +616 -0
- elasticsearch9/_sync/client/search_application.py +574 -0
- elasticsearch9/_sync/client/searchable_snapshots.py +313 -0
- elasticsearch9/_sync/client/security.py +4688 -0
- elasticsearch9/_sync/client/shutdown.py +268 -0
- elasticsearch9/_sync/client/simulate.py +145 -0
- elasticsearch9/_sync/client/slm.py +559 -0
- elasticsearch9/_sync/client/snapshot.py +1338 -0
- elasticsearch9/_sync/client/sql.py +469 -0
- elasticsearch9/_sync/client/ssl.py +76 -0
- elasticsearch9/_sync/client/synonyms.py +413 -0
- elasticsearch9/_sync/client/tasks.py +295 -0
- elasticsearch9/_sync/client/text_structure.py +664 -0
- elasticsearch9/_sync/client/transform.py +922 -0
- elasticsearch9/_sync/client/utils.py +475 -0
- elasticsearch9/_sync/client/watcher.py +894 -0
- elasticsearch9/_sync/client/xpack.py +134 -0
- elasticsearch9/_utils.py +34 -0
- elasticsearch9/_version.py +18 -0
- elasticsearch9/client.py +126 -0
- elasticsearch9/compat.py +79 -0
- elasticsearch9/dsl/__init__.py +203 -0
- elasticsearch9/dsl/_async/__init__.py +16 -0
- elasticsearch9/dsl/_async/document.py +522 -0
- elasticsearch9/dsl/_async/faceted_search.py +50 -0
- elasticsearch9/dsl/_async/index.py +639 -0
- elasticsearch9/dsl/_async/mapping.py +49 -0
- elasticsearch9/dsl/_async/search.py +237 -0
- elasticsearch9/dsl/_async/update_by_query.py +47 -0
- elasticsearch9/dsl/_sync/__init__.py +16 -0
- elasticsearch9/dsl/_sync/document.py +514 -0
- elasticsearch9/dsl/_sync/faceted_search.py +50 -0
- elasticsearch9/dsl/_sync/index.py +597 -0
- elasticsearch9/dsl/_sync/mapping.py +49 -0
- elasticsearch9/dsl/_sync/search.py +230 -0
- elasticsearch9/dsl/_sync/update_by_query.py +45 -0
- elasticsearch9/dsl/aggs.py +3734 -0
- elasticsearch9/dsl/analysis.py +341 -0
- elasticsearch9/dsl/async_connections.py +37 -0
- elasticsearch9/dsl/connections.py +142 -0
- elasticsearch9/dsl/document.py +20 -0
- elasticsearch9/dsl/document_base.py +444 -0
- elasticsearch9/dsl/exceptions.py +32 -0
- elasticsearch9/dsl/faceted_search.py +28 -0
- elasticsearch9/dsl/faceted_search_base.py +489 -0
- elasticsearch9/dsl/field.py +4392 -0
- elasticsearch9/dsl/function.py +180 -0
- elasticsearch9/dsl/index.py +23 -0
- elasticsearch9/dsl/index_base.py +178 -0
- elasticsearch9/dsl/mapping.py +19 -0
- elasticsearch9/dsl/mapping_base.py +219 -0
- elasticsearch9/dsl/query.py +2822 -0
- elasticsearch9/dsl/response/__init__.py +388 -0
- elasticsearch9/dsl/response/aggs.py +100 -0
- elasticsearch9/dsl/response/hit.py +53 -0
- elasticsearch9/dsl/search.py +20 -0
- elasticsearch9/dsl/search_base.py +1053 -0
- elasticsearch9/dsl/serializer.py +34 -0
- elasticsearch9/dsl/types.py +6453 -0
- elasticsearch9/dsl/update_by_query.py +19 -0
- elasticsearch9/dsl/update_by_query_base.py +149 -0
- elasticsearch9/dsl/utils.py +687 -0
- elasticsearch9/dsl/wrappers.py +144 -0
- elasticsearch9/exceptions.py +133 -0
- elasticsearch9/helpers/__init__.py +41 -0
- elasticsearch9/helpers/actions.py +875 -0
- elasticsearch9/helpers/errors.py +40 -0
- elasticsearch9/helpers/vectorstore/__init__.py +62 -0
- elasticsearch9/helpers/vectorstore/_async/__init__.py +16 -0
- elasticsearch9/helpers/vectorstore/_async/_utils.py +39 -0
- elasticsearch9/helpers/vectorstore/_async/embedding_service.py +89 -0
- elasticsearch9/helpers/vectorstore/_async/strategies.py +487 -0
- elasticsearch9/helpers/vectorstore/_async/vectorstore.py +421 -0
- elasticsearch9/helpers/vectorstore/_sync/__init__.py +16 -0
- elasticsearch9/helpers/vectorstore/_sync/_utils.py +39 -0
- elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +89 -0
- elasticsearch9/helpers/vectorstore/_sync/strategies.py +487 -0
- elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +421 -0
- elasticsearch9/helpers/vectorstore/_utils.py +116 -0
- elasticsearch9/py.typed +0 -0
- elasticsearch9/serializer.py +250 -0
- elasticsearch9-9.0.0.dist-info/METADATA +175 -0
- elasticsearch9-9.0.0.dist-info/RECORD +160 -0
- elasticsearch9-9.0.0.dist-info/WHEEL +4 -0
- elasticsearch9-9.0.0.dist-info/licenses/LICENSE +176 -0
- elasticsearch9-9.0.0.dist-info/licenses/NOTICE +2 -0
|
@@ -0,0 +1,766 @@
|
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright
|
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
18
|
+
import typing as t
|
|
19
|
+
|
|
20
|
+
from elastic_transport import ObjectApiResponse
|
|
21
|
+
|
|
22
|
+
from ._base import NamespacedClient
|
|
23
|
+
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class IngestClient(NamespacedClient):
|
|
27
|
+
|
|
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
|
+
.. raw:: html
|
|
42
|
+
|
|
43
|
+
<p>Delete GeoIP database configurations.</p>
|
|
44
|
+
<p>Delete one or more IP geolocation database configurations.</p>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-delete-geoip-database>`_
|
|
48
|
+
|
|
49
|
+
:param id: A comma-separated list of geoip database configurations to delete
|
|
50
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
51
|
+
If no response is received before the timeout expires, the request fails
|
|
52
|
+
and returns an error.
|
|
53
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
54
|
+
before the timeout expires, the request fails and returns an error.
|
|
55
|
+
"""
|
|
56
|
+
if id in SKIP_IN_PATH:
|
|
57
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
58
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
59
|
+
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
|
|
60
|
+
__query: t.Dict[str, t.Any] = {}
|
|
61
|
+
if error_trace is not None:
|
|
62
|
+
__query["error_trace"] = error_trace
|
|
63
|
+
if filter_path is not None:
|
|
64
|
+
__query["filter_path"] = filter_path
|
|
65
|
+
if human is not None:
|
|
66
|
+
__query["human"] = human
|
|
67
|
+
if master_timeout is not None:
|
|
68
|
+
__query["master_timeout"] = master_timeout
|
|
69
|
+
if pretty is not None:
|
|
70
|
+
__query["pretty"] = pretty
|
|
71
|
+
if timeout is not None:
|
|
72
|
+
__query["timeout"] = timeout
|
|
73
|
+
__headers = {"accept": "application/json"}
|
|
74
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
75
|
+
"DELETE",
|
|
76
|
+
__path,
|
|
77
|
+
params=__query,
|
|
78
|
+
headers=__headers,
|
|
79
|
+
endpoint_id="ingest.delete_geoip_database",
|
|
80
|
+
path_parts=__path_parts,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
@_rewrite_parameters()
|
|
84
|
+
async def delete_ip_location_database(
|
|
85
|
+
self,
|
|
86
|
+
*,
|
|
87
|
+
id: t.Union[str, t.Sequence[str]],
|
|
88
|
+
error_trace: t.Optional[bool] = None,
|
|
89
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
90
|
+
human: t.Optional[bool] = None,
|
|
91
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
92
|
+
pretty: t.Optional[bool] = None,
|
|
93
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
94
|
+
) -> ObjectApiResponse[t.Any]:
|
|
95
|
+
"""
|
|
96
|
+
.. raw:: html
|
|
97
|
+
|
|
98
|
+
<p>Delete IP geolocation database configurations.</p>
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-delete-ip-location-database>`_
|
|
102
|
+
|
|
103
|
+
:param id: A comma-separated list of IP location database configurations.
|
|
104
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
105
|
+
If no response is received before the timeout expires, the request fails
|
|
106
|
+
and returns an error. A value of `-1` indicates that the request should never
|
|
107
|
+
time out.
|
|
108
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
109
|
+
before the timeout expires, the request fails and returns an error. A value
|
|
110
|
+
of `-1` indicates that the request should never time out.
|
|
111
|
+
"""
|
|
112
|
+
if id in SKIP_IN_PATH:
|
|
113
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
114
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
115
|
+
__path = f'/_ingest/ip_location/database/{__path_parts["id"]}'
|
|
116
|
+
__query: t.Dict[str, t.Any] = {}
|
|
117
|
+
if error_trace is not None:
|
|
118
|
+
__query["error_trace"] = error_trace
|
|
119
|
+
if filter_path is not None:
|
|
120
|
+
__query["filter_path"] = filter_path
|
|
121
|
+
if human is not None:
|
|
122
|
+
__query["human"] = human
|
|
123
|
+
if master_timeout is not None:
|
|
124
|
+
__query["master_timeout"] = master_timeout
|
|
125
|
+
if pretty is not None:
|
|
126
|
+
__query["pretty"] = pretty
|
|
127
|
+
if timeout is not None:
|
|
128
|
+
__query["timeout"] = timeout
|
|
129
|
+
__headers = {"accept": "application/json"}
|
|
130
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
131
|
+
"DELETE",
|
|
132
|
+
__path,
|
|
133
|
+
params=__query,
|
|
134
|
+
headers=__headers,
|
|
135
|
+
endpoint_id="ingest.delete_ip_location_database",
|
|
136
|
+
path_parts=__path_parts,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
@_rewrite_parameters()
|
|
140
|
+
async def delete_pipeline(
|
|
141
|
+
self,
|
|
142
|
+
*,
|
|
143
|
+
id: str,
|
|
144
|
+
error_trace: t.Optional[bool] = None,
|
|
145
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
146
|
+
human: t.Optional[bool] = None,
|
|
147
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
148
|
+
pretty: t.Optional[bool] = None,
|
|
149
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
150
|
+
) -> ObjectApiResponse[t.Any]:
|
|
151
|
+
"""
|
|
152
|
+
.. raw:: html
|
|
153
|
+
|
|
154
|
+
<p>Delete pipelines.
|
|
155
|
+
Delete one or more ingest pipelines.</p>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-delete-pipeline>`_
|
|
159
|
+
|
|
160
|
+
:param id: Pipeline ID or wildcard expression of pipeline IDs used to limit the
|
|
161
|
+
request. To delete all ingest pipelines in a cluster, use a value of `*`.
|
|
162
|
+
:param master_timeout: Period to wait for a connection to the master node. If
|
|
163
|
+
no response is received before the timeout expires, the request fails and
|
|
164
|
+
returns an error.
|
|
165
|
+
:param timeout: Period to wait for a response. If no response is received before
|
|
166
|
+
the timeout expires, the request fails and returns an error.
|
|
167
|
+
"""
|
|
168
|
+
if id in SKIP_IN_PATH:
|
|
169
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
170
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
171
|
+
__path = f'/_ingest/pipeline/{__path_parts["id"]}'
|
|
172
|
+
__query: t.Dict[str, t.Any] = {}
|
|
173
|
+
if error_trace is not None:
|
|
174
|
+
__query["error_trace"] = error_trace
|
|
175
|
+
if filter_path is not None:
|
|
176
|
+
__query["filter_path"] = filter_path
|
|
177
|
+
if human is not None:
|
|
178
|
+
__query["human"] = human
|
|
179
|
+
if master_timeout is not None:
|
|
180
|
+
__query["master_timeout"] = master_timeout
|
|
181
|
+
if pretty is not None:
|
|
182
|
+
__query["pretty"] = pretty
|
|
183
|
+
if timeout is not None:
|
|
184
|
+
__query["timeout"] = timeout
|
|
185
|
+
__headers = {"accept": "application/json"}
|
|
186
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
187
|
+
"DELETE",
|
|
188
|
+
__path,
|
|
189
|
+
params=__query,
|
|
190
|
+
headers=__headers,
|
|
191
|
+
endpoint_id="ingest.delete_pipeline",
|
|
192
|
+
path_parts=__path_parts,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
@_rewrite_parameters()
|
|
196
|
+
async def geo_ip_stats(
|
|
197
|
+
self,
|
|
198
|
+
*,
|
|
199
|
+
error_trace: t.Optional[bool] = None,
|
|
200
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
201
|
+
human: t.Optional[bool] = None,
|
|
202
|
+
pretty: t.Optional[bool] = None,
|
|
203
|
+
) -> ObjectApiResponse[t.Any]:
|
|
204
|
+
"""
|
|
205
|
+
.. raw:: html
|
|
206
|
+
|
|
207
|
+
<p>Get GeoIP statistics.
|
|
208
|
+
Get download statistics for GeoIP2 databases that are used with the GeoIP processor.</p>
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
`<https://www.elastic.co/docs/reference/enrich-processor/geoip-processor>`_
|
|
212
|
+
"""
|
|
213
|
+
__path_parts: t.Dict[str, str] = {}
|
|
214
|
+
__path = "/_ingest/geoip/stats"
|
|
215
|
+
__query: t.Dict[str, t.Any] = {}
|
|
216
|
+
if error_trace is not None:
|
|
217
|
+
__query["error_trace"] = error_trace
|
|
218
|
+
if filter_path is not None:
|
|
219
|
+
__query["filter_path"] = filter_path
|
|
220
|
+
if human is not None:
|
|
221
|
+
__query["human"] = human
|
|
222
|
+
if pretty is not None:
|
|
223
|
+
__query["pretty"] = pretty
|
|
224
|
+
__headers = {"accept": "application/json"}
|
|
225
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
226
|
+
"GET",
|
|
227
|
+
__path,
|
|
228
|
+
params=__query,
|
|
229
|
+
headers=__headers,
|
|
230
|
+
endpoint_id="ingest.geo_ip_stats",
|
|
231
|
+
path_parts=__path_parts,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
@_rewrite_parameters()
|
|
235
|
+
async def get_geoip_database(
|
|
236
|
+
self,
|
|
237
|
+
*,
|
|
238
|
+
id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
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>Get GeoIP database configurations.</p>
|
|
248
|
+
<p>Get information about one or more IP geolocation database configurations.</p>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-get-geoip-database>`_
|
|
252
|
+
|
|
253
|
+
:param id: A comma-separated list of database configuration IDs to retrieve.
|
|
254
|
+
Wildcard (`*`) expressions are supported. To get all database configurations,
|
|
255
|
+
omit this parameter or use `*`.
|
|
256
|
+
"""
|
|
257
|
+
__path_parts: t.Dict[str, str]
|
|
258
|
+
if id not in SKIP_IN_PATH:
|
|
259
|
+
__path_parts = {"id": _quote(id)}
|
|
260
|
+
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
|
|
261
|
+
else:
|
|
262
|
+
__path_parts = {}
|
|
263
|
+
__path = "/_ingest/geoip/database"
|
|
264
|
+
__query: t.Dict[str, t.Any] = {}
|
|
265
|
+
if error_trace is not None:
|
|
266
|
+
__query["error_trace"] = error_trace
|
|
267
|
+
if filter_path is not None:
|
|
268
|
+
__query["filter_path"] = filter_path
|
|
269
|
+
if human is not None:
|
|
270
|
+
__query["human"] = human
|
|
271
|
+
if pretty is not None:
|
|
272
|
+
__query["pretty"] = pretty
|
|
273
|
+
__headers = {"accept": "application/json"}
|
|
274
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
275
|
+
"GET",
|
|
276
|
+
__path,
|
|
277
|
+
params=__query,
|
|
278
|
+
headers=__headers,
|
|
279
|
+
endpoint_id="ingest.get_geoip_database",
|
|
280
|
+
path_parts=__path_parts,
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
@_rewrite_parameters()
|
|
284
|
+
async def get_ip_location_database(
|
|
285
|
+
self,
|
|
286
|
+
*,
|
|
287
|
+
id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
288
|
+
error_trace: t.Optional[bool] = None,
|
|
289
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
290
|
+
human: t.Optional[bool] = None,
|
|
291
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
292
|
+
pretty: t.Optional[bool] = None,
|
|
293
|
+
) -> ObjectApiResponse[t.Any]:
|
|
294
|
+
"""
|
|
295
|
+
.. raw:: html
|
|
296
|
+
|
|
297
|
+
<p>Get IP geolocation database configurations.</p>
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-get-ip-location-database>`_
|
|
301
|
+
|
|
302
|
+
:param id: Comma-separated list of database configuration IDs to retrieve. Wildcard
|
|
303
|
+
(`*`) expressions are supported. To get all database configurations, omit
|
|
304
|
+
this parameter or use `*`.
|
|
305
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
306
|
+
If no response is received before the timeout expires, the request fails
|
|
307
|
+
and returns an error. A value of `-1` indicates that the request should never
|
|
308
|
+
time out.
|
|
309
|
+
"""
|
|
310
|
+
__path_parts: t.Dict[str, str]
|
|
311
|
+
if id not in SKIP_IN_PATH:
|
|
312
|
+
__path_parts = {"id": _quote(id)}
|
|
313
|
+
__path = f'/_ingest/ip_location/database/{__path_parts["id"]}'
|
|
314
|
+
else:
|
|
315
|
+
__path_parts = {}
|
|
316
|
+
__path = "/_ingest/ip_location/database"
|
|
317
|
+
__query: t.Dict[str, t.Any] = {}
|
|
318
|
+
if error_trace is not None:
|
|
319
|
+
__query["error_trace"] = error_trace
|
|
320
|
+
if filter_path is not None:
|
|
321
|
+
__query["filter_path"] = filter_path
|
|
322
|
+
if human is not None:
|
|
323
|
+
__query["human"] = human
|
|
324
|
+
if master_timeout is not None:
|
|
325
|
+
__query["master_timeout"] = master_timeout
|
|
326
|
+
if pretty is not None:
|
|
327
|
+
__query["pretty"] = pretty
|
|
328
|
+
__headers = {"accept": "application/json"}
|
|
329
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
330
|
+
"GET",
|
|
331
|
+
__path,
|
|
332
|
+
params=__query,
|
|
333
|
+
headers=__headers,
|
|
334
|
+
endpoint_id="ingest.get_ip_location_database",
|
|
335
|
+
path_parts=__path_parts,
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
@_rewrite_parameters()
|
|
339
|
+
async def get_pipeline(
|
|
340
|
+
self,
|
|
341
|
+
*,
|
|
342
|
+
id: t.Optional[str] = None,
|
|
343
|
+
error_trace: t.Optional[bool] = None,
|
|
344
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
345
|
+
human: t.Optional[bool] = None,
|
|
346
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
347
|
+
pretty: t.Optional[bool] = None,
|
|
348
|
+
summary: t.Optional[bool] = None,
|
|
349
|
+
) -> ObjectApiResponse[t.Any]:
|
|
350
|
+
"""
|
|
351
|
+
.. raw:: html
|
|
352
|
+
|
|
353
|
+
<p>Get pipelines.</p>
|
|
354
|
+
<p>Get information about one or more ingest pipelines.
|
|
355
|
+
This API returns a local reference of the pipeline.</p>
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-get-pipeline>`_
|
|
359
|
+
|
|
360
|
+
:param id: Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions
|
|
361
|
+
are supported. To get all ingest pipelines, omit this parameter or use `*`.
|
|
362
|
+
:param master_timeout: Period to wait for a connection to the master node. If
|
|
363
|
+
no response is received before the timeout expires, the request fails and
|
|
364
|
+
returns an error.
|
|
365
|
+
:param summary: Return pipelines without their definitions (default: false)
|
|
366
|
+
"""
|
|
367
|
+
__path_parts: t.Dict[str, str]
|
|
368
|
+
if id not in SKIP_IN_PATH:
|
|
369
|
+
__path_parts = {"id": _quote(id)}
|
|
370
|
+
__path = f'/_ingest/pipeline/{__path_parts["id"]}'
|
|
371
|
+
else:
|
|
372
|
+
__path_parts = {}
|
|
373
|
+
__path = "/_ingest/pipeline"
|
|
374
|
+
__query: t.Dict[str, t.Any] = {}
|
|
375
|
+
if error_trace is not None:
|
|
376
|
+
__query["error_trace"] = error_trace
|
|
377
|
+
if filter_path is not None:
|
|
378
|
+
__query["filter_path"] = filter_path
|
|
379
|
+
if human is not None:
|
|
380
|
+
__query["human"] = human
|
|
381
|
+
if master_timeout is not None:
|
|
382
|
+
__query["master_timeout"] = master_timeout
|
|
383
|
+
if pretty is not None:
|
|
384
|
+
__query["pretty"] = pretty
|
|
385
|
+
if summary is not None:
|
|
386
|
+
__query["summary"] = summary
|
|
387
|
+
__headers = {"accept": "application/json"}
|
|
388
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
389
|
+
"GET",
|
|
390
|
+
__path,
|
|
391
|
+
params=__query,
|
|
392
|
+
headers=__headers,
|
|
393
|
+
endpoint_id="ingest.get_pipeline",
|
|
394
|
+
path_parts=__path_parts,
|
|
395
|
+
)
|
|
396
|
+
|
|
397
|
+
@_rewrite_parameters()
|
|
398
|
+
async def processor_grok(
|
|
399
|
+
self,
|
|
400
|
+
*,
|
|
401
|
+
error_trace: t.Optional[bool] = None,
|
|
402
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
403
|
+
human: t.Optional[bool] = None,
|
|
404
|
+
pretty: t.Optional[bool] = None,
|
|
405
|
+
) -> ObjectApiResponse[t.Any]:
|
|
406
|
+
"""
|
|
407
|
+
.. raw:: html
|
|
408
|
+
|
|
409
|
+
<p>Run a grok processor.
|
|
410
|
+
Extract structured fields out of a single text field within a document.
|
|
411
|
+
You must choose which field to extract matched fields from, as well as the grok pattern you expect will match.
|
|
412
|
+
A grok pattern is like a regular expression that supports aliased expressions that can be reused.</p>
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
`<https://www.elastic.co/docs/reference/enrich-processor/grok-processor>`_
|
|
416
|
+
"""
|
|
417
|
+
__path_parts: t.Dict[str, str] = {}
|
|
418
|
+
__path = "/_ingest/processor/grok"
|
|
419
|
+
__query: t.Dict[str, t.Any] = {}
|
|
420
|
+
if error_trace is not None:
|
|
421
|
+
__query["error_trace"] = error_trace
|
|
422
|
+
if filter_path is not None:
|
|
423
|
+
__query["filter_path"] = filter_path
|
|
424
|
+
if human is not None:
|
|
425
|
+
__query["human"] = human
|
|
426
|
+
if pretty is not None:
|
|
427
|
+
__query["pretty"] = pretty
|
|
428
|
+
__headers = {"accept": "application/json"}
|
|
429
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
430
|
+
"GET",
|
|
431
|
+
__path,
|
|
432
|
+
params=__query,
|
|
433
|
+
headers=__headers,
|
|
434
|
+
endpoint_id="ingest.processor_grok",
|
|
435
|
+
path_parts=__path_parts,
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
@_rewrite_parameters(
|
|
439
|
+
body_fields=("maxmind", "name"),
|
|
440
|
+
)
|
|
441
|
+
async def put_geoip_database(
|
|
442
|
+
self,
|
|
443
|
+
*,
|
|
444
|
+
id: str,
|
|
445
|
+
maxmind: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
446
|
+
name: t.Optional[str] = None,
|
|
447
|
+
error_trace: t.Optional[bool] = None,
|
|
448
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
449
|
+
human: t.Optional[bool] = None,
|
|
450
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
451
|
+
pretty: t.Optional[bool] = None,
|
|
452
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
453
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
454
|
+
) -> ObjectApiResponse[t.Any]:
|
|
455
|
+
"""
|
|
456
|
+
.. raw:: html
|
|
457
|
+
|
|
458
|
+
<p>Create or update a GeoIP database configuration.</p>
|
|
459
|
+
<p>Refer to the create or update IP geolocation database configuration API.</p>
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-put-geoip-database>`_
|
|
463
|
+
|
|
464
|
+
:param id: ID of the database configuration to create or update.
|
|
465
|
+
:param maxmind: The configuration necessary to identify which IP geolocation
|
|
466
|
+
provider to use to download the database, as well as any provider-specific
|
|
467
|
+
configuration necessary for such downloading. At present, the only supported
|
|
468
|
+
provider is maxmind, and the maxmind provider requires that an account_id
|
|
469
|
+
(string) is configured.
|
|
470
|
+
:param name: The provider-assigned name of the IP geolocation database to download.
|
|
471
|
+
:param master_timeout: Period to wait for a connection to the master node. If
|
|
472
|
+
no response is received before the timeout expires, the request fails and
|
|
473
|
+
returns an error.
|
|
474
|
+
:param timeout: Period to wait for a response. If no response is received before
|
|
475
|
+
the timeout expires, the request fails and returns an error.
|
|
476
|
+
"""
|
|
477
|
+
if id in SKIP_IN_PATH:
|
|
478
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
479
|
+
if maxmind is None and body is None:
|
|
480
|
+
raise ValueError("Empty value passed for parameter 'maxmind'")
|
|
481
|
+
if name is None and body is None:
|
|
482
|
+
raise ValueError("Empty value passed for parameter 'name'")
|
|
483
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
484
|
+
__path = f'/_ingest/geoip/database/{__path_parts["id"]}'
|
|
485
|
+
__query: t.Dict[str, t.Any] = {}
|
|
486
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
487
|
+
if error_trace is not None:
|
|
488
|
+
__query["error_trace"] = error_trace
|
|
489
|
+
if filter_path is not None:
|
|
490
|
+
__query["filter_path"] = filter_path
|
|
491
|
+
if human is not None:
|
|
492
|
+
__query["human"] = human
|
|
493
|
+
if master_timeout is not None:
|
|
494
|
+
__query["master_timeout"] = master_timeout
|
|
495
|
+
if pretty is not None:
|
|
496
|
+
__query["pretty"] = pretty
|
|
497
|
+
if timeout is not None:
|
|
498
|
+
__query["timeout"] = timeout
|
|
499
|
+
if not __body:
|
|
500
|
+
if maxmind is not None:
|
|
501
|
+
__body["maxmind"] = maxmind
|
|
502
|
+
if name is not None:
|
|
503
|
+
__body["name"] = name
|
|
504
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
505
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
506
|
+
"PUT",
|
|
507
|
+
__path,
|
|
508
|
+
params=__query,
|
|
509
|
+
headers=__headers,
|
|
510
|
+
body=__body,
|
|
511
|
+
endpoint_id="ingest.put_geoip_database",
|
|
512
|
+
path_parts=__path_parts,
|
|
513
|
+
)
|
|
514
|
+
|
|
515
|
+
@_rewrite_parameters(
|
|
516
|
+
body_name="configuration",
|
|
517
|
+
)
|
|
518
|
+
async def put_ip_location_database(
|
|
519
|
+
self,
|
|
520
|
+
*,
|
|
521
|
+
id: str,
|
|
522
|
+
configuration: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
523
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
524
|
+
error_trace: t.Optional[bool] = None,
|
|
525
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
526
|
+
human: t.Optional[bool] = None,
|
|
527
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
528
|
+
pretty: t.Optional[bool] = None,
|
|
529
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
530
|
+
) -> ObjectApiResponse[t.Any]:
|
|
531
|
+
"""
|
|
532
|
+
.. raw:: html
|
|
533
|
+
|
|
534
|
+
<p>Create or update an IP geolocation database configuration.</p>
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-put-ip-location-database>`_
|
|
538
|
+
|
|
539
|
+
:param id: The database configuration identifier.
|
|
540
|
+
:param configuration:
|
|
541
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
542
|
+
If no response is received before the timeout expires, the request fails
|
|
543
|
+
and returns an error. A value of `-1` indicates that the request should never
|
|
544
|
+
time out.
|
|
545
|
+
:param timeout: The period to wait for a response from all relevant nodes in
|
|
546
|
+
the cluster after updating the cluster metadata. If no response is received
|
|
547
|
+
before the timeout expires, the cluster metadata update still applies but
|
|
548
|
+
the response indicates that it was not completely acknowledged. A value of
|
|
549
|
+
`-1` indicates that the request should never time out.
|
|
550
|
+
"""
|
|
551
|
+
if id in SKIP_IN_PATH:
|
|
552
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
553
|
+
if configuration is None and body is None:
|
|
554
|
+
raise ValueError(
|
|
555
|
+
"Empty value passed for parameters 'configuration' and 'body', one of them should be set."
|
|
556
|
+
)
|
|
557
|
+
elif configuration is not None and body is not None:
|
|
558
|
+
raise ValueError("Cannot set both 'configuration' and 'body'")
|
|
559
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
560
|
+
__path = f'/_ingest/ip_location/database/{__path_parts["id"]}'
|
|
561
|
+
__query: t.Dict[str, t.Any] = {}
|
|
562
|
+
if error_trace is not None:
|
|
563
|
+
__query["error_trace"] = error_trace
|
|
564
|
+
if filter_path is not None:
|
|
565
|
+
__query["filter_path"] = filter_path
|
|
566
|
+
if human is not None:
|
|
567
|
+
__query["human"] = human
|
|
568
|
+
if master_timeout is not None:
|
|
569
|
+
__query["master_timeout"] = master_timeout
|
|
570
|
+
if pretty is not None:
|
|
571
|
+
__query["pretty"] = pretty
|
|
572
|
+
if timeout is not None:
|
|
573
|
+
__query["timeout"] = timeout
|
|
574
|
+
__body = configuration if configuration is not None else body
|
|
575
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
576
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
577
|
+
"PUT",
|
|
578
|
+
__path,
|
|
579
|
+
params=__query,
|
|
580
|
+
headers=__headers,
|
|
581
|
+
body=__body,
|
|
582
|
+
endpoint_id="ingest.put_ip_location_database",
|
|
583
|
+
path_parts=__path_parts,
|
|
584
|
+
)
|
|
585
|
+
|
|
586
|
+
@_rewrite_parameters(
|
|
587
|
+
body_fields=(
|
|
588
|
+
"deprecated",
|
|
589
|
+
"description",
|
|
590
|
+
"meta",
|
|
591
|
+
"on_failure",
|
|
592
|
+
"processors",
|
|
593
|
+
"version",
|
|
594
|
+
),
|
|
595
|
+
parameter_aliases={"_meta": "meta"},
|
|
596
|
+
)
|
|
597
|
+
async def put_pipeline(
|
|
598
|
+
self,
|
|
599
|
+
*,
|
|
600
|
+
id: str,
|
|
601
|
+
deprecated: t.Optional[bool] = None,
|
|
602
|
+
description: t.Optional[str] = None,
|
|
603
|
+
error_trace: t.Optional[bool] = None,
|
|
604
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
605
|
+
human: t.Optional[bool] = None,
|
|
606
|
+
if_version: t.Optional[int] = None,
|
|
607
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
608
|
+
meta: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
609
|
+
on_failure: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
610
|
+
pretty: t.Optional[bool] = None,
|
|
611
|
+
processors: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
612
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
613
|
+
version: t.Optional[int] = None,
|
|
614
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
615
|
+
) -> ObjectApiResponse[t.Any]:
|
|
616
|
+
"""
|
|
617
|
+
.. raw:: html
|
|
618
|
+
|
|
619
|
+
<p>Create or update a pipeline.
|
|
620
|
+
Changes made using this API take effect immediately.</p>
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
`<https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines>`_
|
|
624
|
+
|
|
625
|
+
:param id: ID of the ingest pipeline to create or update.
|
|
626
|
+
:param deprecated: Marks this ingest pipeline as deprecated. When a deprecated
|
|
627
|
+
ingest pipeline is referenced as the default or final pipeline when creating
|
|
628
|
+
or updating a non-deprecated index template, Elasticsearch will emit a deprecation
|
|
629
|
+
warning.
|
|
630
|
+
:param description: Description of the ingest pipeline.
|
|
631
|
+
:param if_version: Required version for optimistic concurrency control for pipeline
|
|
632
|
+
updates
|
|
633
|
+
:param master_timeout: Period to wait for a connection to the master node. If
|
|
634
|
+
no response is received before the timeout expires, the request fails and
|
|
635
|
+
returns an error.
|
|
636
|
+
:param meta: Optional metadata about the ingest pipeline. May have any contents.
|
|
637
|
+
This map is not automatically generated by Elasticsearch.
|
|
638
|
+
:param on_failure: Processors to run immediately after a processor failure. Each
|
|
639
|
+
processor supports a processor-level `on_failure` value. If a processor without
|
|
640
|
+
an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter
|
|
641
|
+
as a fallback. The processors in this parameter run sequentially in the order
|
|
642
|
+
specified. Elasticsearch will not attempt to run the pipeline's remaining
|
|
643
|
+
processors.
|
|
644
|
+
:param processors: Processors used to perform transformations on documents before
|
|
645
|
+
indexing. Processors run sequentially in the order specified.
|
|
646
|
+
:param timeout: Period to wait for a response. If no response is received before
|
|
647
|
+
the timeout expires, the request fails and returns an error.
|
|
648
|
+
:param version: Version number used by external systems to track ingest pipelines.
|
|
649
|
+
This parameter is intended for external systems only. Elasticsearch does
|
|
650
|
+
not use or validate pipeline version numbers.
|
|
651
|
+
"""
|
|
652
|
+
if id in SKIP_IN_PATH:
|
|
653
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
654
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
655
|
+
__path = f'/_ingest/pipeline/{__path_parts["id"]}'
|
|
656
|
+
__query: t.Dict[str, t.Any] = {}
|
|
657
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
658
|
+
if error_trace is not None:
|
|
659
|
+
__query["error_trace"] = error_trace
|
|
660
|
+
if filter_path is not None:
|
|
661
|
+
__query["filter_path"] = filter_path
|
|
662
|
+
if human is not None:
|
|
663
|
+
__query["human"] = human
|
|
664
|
+
if if_version is not None:
|
|
665
|
+
__query["if_version"] = if_version
|
|
666
|
+
if master_timeout is not None:
|
|
667
|
+
__query["master_timeout"] = master_timeout
|
|
668
|
+
if pretty is not None:
|
|
669
|
+
__query["pretty"] = pretty
|
|
670
|
+
if timeout is not None:
|
|
671
|
+
__query["timeout"] = timeout
|
|
672
|
+
if not __body:
|
|
673
|
+
if deprecated is not None:
|
|
674
|
+
__body["deprecated"] = deprecated
|
|
675
|
+
if description is not None:
|
|
676
|
+
__body["description"] = description
|
|
677
|
+
if meta is not None:
|
|
678
|
+
__body["_meta"] = meta
|
|
679
|
+
if on_failure is not None:
|
|
680
|
+
__body["on_failure"] = on_failure
|
|
681
|
+
if processors is not None:
|
|
682
|
+
__body["processors"] = processors
|
|
683
|
+
if version is not None:
|
|
684
|
+
__body["version"] = version
|
|
685
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
686
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
687
|
+
"PUT",
|
|
688
|
+
__path,
|
|
689
|
+
params=__query,
|
|
690
|
+
headers=__headers,
|
|
691
|
+
body=__body,
|
|
692
|
+
endpoint_id="ingest.put_pipeline",
|
|
693
|
+
path_parts=__path_parts,
|
|
694
|
+
)
|
|
695
|
+
|
|
696
|
+
@_rewrite_parameters(
|
|
697
|
+
body_fields=("docs", "pipeline"),
|
|
698
|
+
)
|
|
699
|
+
async def simulate(
|
|
700
|
+
self,
|
|
701
|
+
*,
|
|
702
|
+
docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
703
|
+
id: t.Optional[str] = None,
|
|
704
|
+
error_trace: t.Optional[bool] = None,
|
|
705
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
706
|
+
human: t.Optional[bool] = None,
|
|
707
|
+
pipeline: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
708
|
+
pretty: t.Optional[bool] = None,
|
|
709
|
+
verbose: t.Optional[bool] = None,
|
|
710
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
711
|
+
) -> ObjectApiResponse[t.Any]:
|
|
712
|
+
"""
|
|
713
|
+
.. raw:: html
|
|
714
|
+
|
|
715
|
+
<p>Simulate a pipeline.</p>
|
|
716
|
+
<p>Run an ingest pipeline against a set of provided documents.
|
|
717
|
+
You can either specify an existing pipeline to use with the provided documents or supply a pipeline definition in the body of the request.</p>
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ingest-simulate>`_
|
|
721
|
+
|
|
722
|
+
:param docs: Sample documents to test in the pipeline.
|
|
723
|
+
:param id: The pipeline to test. If you don't specify a `pipeline` in the request
|
|
724
|
+
body, this parameter is required.
|
|
725
|
+
:param pipeline: The pipeline to test. If you don't specify the `pipeline` request
|
|
726
|
+
path parameter, this parameter is required. If you specify both this and
|
|
727
|
+
the request path parameter, the API only uses the request path parameter.
|
|
728
|
+
:param verbose: If `true`, the response includes output data for each processor
|
|
729
|
+
in the executed pipeline.
|
|
730
|
+
"""
|
|
731
|
+
if docs is None and body is None:
|
|
732
|
+
raise ValueError("Empty value passed for parameter 'docs'")
|
|
733
|
+
__path_parts: t.Dict[str, str]
|
|
734
|
+
if id not in SKIP_IN_PATH:
|
|
735
|
+
__path_parts = {"id": _quote(id)}
|
|
736
|
+
__path = f'/_ingest/pipeline/{__path_parts["id"]}/_simulate'
|
|
737
|
+
else:
|
|
738
|
+
__path_parts = {}
|
|
739
|
+
__path = "/_ingest/pipeline/_simulate"
|
|
740
|
+
__query: t.Dict[str, t.Any] = {}
|
|
741
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
742
|
+
if error_trace is not None:
|
|
743
|
+
__query["error_trace"] = error_trace
|
|
744
|
+
if filter_path is not None:
|
|
745
|
+
__query["filter_path"] = filter_path
|
|
746
|
+
if human is not None:
|
|
747
|
+
__query["human"] = human
|
|
748
|
+
if pretty is not None:
|
|
749
|
+
__query["pretty"] = pretty
|
|
750
|
+
if verbose is not None:
|
|
751
|
+
__query["verbose"] = verbose
|
|
752
|
+
if not __body:
|
|
753
|
+
if docs is not None:
|
|
754
|
+
__body["docs"] = docs
|
|
755
|
+
if pipeline is not None:
|
|
756
|
+
__body["pipeline"] = pipeline
|
|
757
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
758
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
759
|
+
"POST",
|
|
760
|
+
__path,
|
|
761
|
+
params=__query,
|
|
762
|
+
headers=__headers,
|
|
763
|
+
body=__body,
|
|
764
|
+
endpoint_id="ingest.simulate",
|
|
765
|
+
path_parts=__path_parts,
|
|
766
|
+
)
|