elasticsearch 8.17.1__py3-none-any.whl → 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.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2125 -1053
- elasticsearch/_async/client/_base.py +1 -2
- elasticsearch/_async/client/async_search.py +46 -35
- elasticsearch/_async/client/autoscaling.py +32 -26
- elasticsearch/_async/client/cat.py +244 -176
- elasticsearch/_async/client/ccr.py +268 -128
- elasticsearch/_async/client/cluster.py +191 -164
- elasticsearch/_async/client/connector.py +226 -116
- elasticsearch/_async/client/dangling_indices.py +22 -16
- elasticsearch/_async/client/enrich.py +51 -11
- elasticsearch/_async/client/eql.py +54 -13
- elasticsearch/_async/client/esql.py +351 -7
- elasticsearch/_async/client/features.py +37 -27
- elasticsearch/_async/client/fleet.py +32 -22
- elasticsearch/_async/client/graph.py +10 -9
- elasticsearch/_async/client/ilm.py +115 -77
- elasticsearch/_async/client/indices.py +1119 -772
- elasticsearch/_async/client/inference.py +1933 -84
- elasticsearch/_async/client/ingest.py +83 -50
- elasticsearch/_async/client/license.py +90 -38
- elasticsearch/_async/client/logstash.py +20 -9
- elasticsearch/_async/client/migration.py +26 -17
- elasticsearch/_async/client/ml.py +646 -374
- elasticsearch/_async/client/monitoring.py +6 -3
- elasticsearch/_async/client/nodes.py +52 -54
- elasticsearch/_async/client/query_rules.py +59 -33
- elasticsearch/_async/client/rollup.py +124 -86
- elasticsearch/_async/client/search_application.py +60 -32
- elasticsearch/_async/client/searchable_snapshots.py +25 -12
- elasticsearch/_async/client/security.py +903 -562
- elasticsearch/_async/client/shutdown.py +34 -36
- elasticsearch/_async/client/simulate.py +22 -28
- elasticsearch/_async/client/slm.py +65 -40
- elasticsearch/_async/client/snapshot.py +454 -327
- elasticsearch/_async/client/sql.py +43 -22
- elasticsearch/_async/client/ssl.py +17 -18
- elasticsearch/_async/client/synonyms.py +58 -37
- elasticsearch/_async/client/tasks.py +77 -48
- elasticsearch/_async/client/text_structure.py +65 -56
- elasticsearch/_async/client/transform.py +124 -93
- elasticsearch/_async/client/watcher.py +117 -73
- elasticsearch/_async/client/xpack.py +18 -9
- elasticsearch/_async/helpers.py +1 -2
- elasticsearch/_sync/client/__init__.py +2125 -1053
- elasticsearch/_sync/client/_base.py +1 -2
- elasticsearch/_sync/client/async_search.py +46 -35
- elasticsearch/_sync/client/autoscaling.py +32 -26
- elasticsearch/_sync/client/cat.py +244 -176
- elasticsearch/_sync/client/ccr.py +268 -128
- elasticsearch/_sync/client/cluster.py +191 -164
- elasticsearch/_sync/client/connector.py +226 -116
- elasticsearch/_sync/client/dangling_indices.py +22 -16
- elasticsearch/_sync/client/enrich.py +51 -11
- elasticsearch/_sync/client/eql.py +54 -13
- elasticsearch/_sync/client/esql.py +351 -7
- elasticsearch/_sync/client/features.py +37 -27
- elasticsearch/_sync/client/fleet.py +32 -22
- elasticsearch/_sync/client/graph.py +10 -9
- elasticsearch/_sync/client/ilm.py +115 -77
- elasticsearch/_sync/client/indices.py +1119 -772
- elasticsearch/_sync/client/inference.py +1933 -84
- elasticsearch/_sync/client/ingest.py +83 -50
- elasticsearch/_sync/client/license.py +90 -38
- elasticsearch/_sync/client/logstash.py +20 -9
- elasticsearch/_sync/client/migration.py +26 -17
- elasticsearch/_sync/client/ml.py +646 -374
- elasticsearch/_sync/client/monitoring.py +6 -3
- elasticsearch/_sync/client/nodes.py +52 -54
- elasticsearch/_sync/client/query_rules.py +59 -33
- elasticsearch/_sync/client/rollup.py +124 -86
- elasticsearch/_sync/client/search_application.py +60 -32
- elasticsearch/_sync/client/searchable_snapshots.py +25 -12
- elasticsearch/_sync/client/security.py +903 -562
- elasticsearch/_sync/client/shutdown.py +34 -36
- elasticsearch/_sync/client/simulate.py +22 -28
- elasticsearch/_sync/client/slm.py +65 -40
- elasticsearch/_sync/client/snapshot.py +454 -327
- elasticsearch/_sync/client/sql.py +43 -22
- elasticsearch/_sync/client/ssl.py +17 -18
- elasticsearch/_sync/client/synonyms.py +58 -37
- elasticsearch/_sync/client/tasks.py +77 -48
- elasticsearch/_sync/client/text_structure.py +65 -56
- elasticsearch/_sync/client/transform.py +124 -93
- elasticsearch/_sync/client/utils.py +1 -41
- elasticsearch/_sync/client/watcher.py +117 -73
- elasticsearch/_sync/client/xpack.py +18 -9
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- elasticsearch/dsl/__init__.py +203 -0
- elasticsearch/dsl/_async/__init__.py +16 -0
- elasticsearch/dsl/_async/document.py +522 -0
- elasticsearch/dsl/_async/faceted_search.py +50 -0
- elasticsearch/dsl/_async/index.py +639 -0
- elasticsearch/dsl/_async/mapping.py +49 -0
- elasticsearch/dsl/_async/search.py +237 -0
- elasticsearch/dsl/_async/update_by_query.py +47 -0
- elasticsearch/dsl/_sync/__init__.py +16 -0
- elasticsearch/dsl/_sync/document.py +514 -0
- elasticsearch/dsl/_sync/faceted_search.py +50 -0
- elasticsearch/dsl/_sync/index.py +597 -0
- elasticsearch/dsl/_sync/mapping.py +49 -0
- elasticsearch/dsl/_sync/search.py +230 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3734 -0
- elasticsearch/dsl/analysis.py +341 -0
- elasticsearch/dsl/async_connections.py +37 -0
- elasticsearch/dsl/connections.py +142 -0
- elasticsearch/dsl/document.py +20 -0
- elasticsearch/dsl/document_base.py +444 -0
- elasticsearch/dsl/exceptions.py +32 -0
- elasticsearch/dsl/faceted_search.py +28 -0
- elasticsearch/dsl/faceted_search_base.py +489 -0
- elasticsearch/dsl/field.py +4392 -0
- elasticsearch/dsl/function.py +180 -0
- elasticsearch/dsl/index.py +23 -0
- elasticsearch/dsl/index_base.py +178 -0
- elasticsearch/dsl/mapping.py +19 -0
- elasticsearch/dsl/mapping_base.py +219 -0
- elasticsearch/dsl/query.py +2822 -0
- elasticsearch/dsl/response/__init__.py +388 -0
- elasticsearch/dsl/response/aggs.py +100 -0
- elasticsearch/dsl/response/hit.py +53 -0
- elasticsearch/dsl/search.py +20 -0
- elasticsearch/dsl/search_base.py +1053 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6453 -0
- elasticsearch/dsl/update_by_query.py +19 -0
- elasticsearch/dsl/update_by_query_base.py +149 -0
- elasticsearch/dsl/utils.py +687 -0
- elasticsearch/dsl/wrappers.py +144 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_async/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/METADATA +12 -15
- elasticsearch-9.0.0.dist-info/RECORD +160 -0
- elasticsearch/transport.py +0 -57
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -20,7 +20,7 @@ import typing as t
|
|
|
20
20
|
from elastic_transport import ObjectApiResponse
|
|
21
21
|
|
|
22
22
|
from ._base import NamespacedClient
|
|
23
|
-
from .utils import _rewrite_parameters
|
|
23
|
+
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class EsqlClient(NamespacedClient):
|
|
@@ -30,14 +30,16 @@ class EsqlClient(NamespacedClient):
|
|
|
30
30
|
"query",
|
|
31
31
|
"columnar",
|
|
32
32
|
"filter",
|
|
33
|
+
"include_ccs_metadata",
|
|
33
34
|
"locale",
|
|
34
35
|
"params",
|
|
35
36
|
"profile",
|
|
36
37
|
"tables",
|
|
38
|
+
"wait_for_completion_timeout",
|
|
37
39
|
),
|
|
38
40
|
ignore_deprecated_options={"params"},
|
|
39
41
|
)
|
|
40
|
-
async def
|
|
42
|
+
async def async_query(
|
|
41
43
|
self,
|
|
42
44
|
*,
|
|
43
45
|
query: t.Optional[str] = None,
|
|
@@ -56,10 +58,343 @@ class EsqlClient(NamespacedClient):
|
|
|
56
58
|
]
|
|
57
59
|
] = None,
|
|
58
60
|
human: t.Optional[bool] = None,
|
|
61
|
+
include_ccs_metadata: t.Optional[bool] = None,
|
|
62
|
+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
63
|
+
keep_on_completion: t.Optional[bool] = None,
|
|
59
64
|
locale: t.Optional[str] = None,
|
|
60
|
-
params: t.Optional[
|
|
61
|
-
|
|
65
|
+
params: t.Optional[t.Sequence[t.Union[None, bool, float, int, str]]] = None,
|
|
66
|
+
pretty: t.Optional[bool] = None,
|
|
67
|
+
profile: t.Optional[bool] = None,
|
|
68
|
+
tables: t.Optional[
|
|
69
|
+
t.Mapping[str, t.Mapping[str, t.Mapping[str, t.Any]]]
|
|
70
|
+
] = None,
|
|
71
|
+
wait_for_completion_timeout: t.Optional[
|
|
72
|
+
t.Union[str, t.Literal[-1], t.Literal[0]]
|
|
62
73
|
] = None,
|
|
74
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
75
|
+
) -> ObjectApiResponse[t.Any]:
|
|
76
|
+
"""
|
|
77
|
+
.. raw:: html
|
|
78
|
+
|
|
79
|
+
<p>Run an async ES|QL query.
|
|
80
|
+
Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available.</p>
|
|
81
|
+
<p>The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties.</p>
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query>`_
|
|
85
|
+
|
|
86
|
+
:param query: The ES|QL query API accepts an ES|QL query string in the query
|
|
87
|
+
parameter, runs it, and returns the results.
|
|
88
|
+
:param columnar: By default, ES|QL returns results as rows. For example, FROM
|
|
89
|
+
returns each individual document as one row. For the JSON, YAML, CBOR and
|
|
90
|
+
smile formats, ES|QL can return the results in a columnar fashion where one
|
|
91
|
+
row represents all the values of a certain column in the results.
|
|
92
|
+
:param delimiter: The character to use between values within a CSV row. It is
|
|
93
|
+
valid only for the CSV format.
|
|
94
|
+
:param drop_null_columns: Indicates whether columns that are entirely `null`
|
|
95
|
+
will be removed from the `columns` and `values` portion of the results. If
|
|
96
|
+
`true`, the response will include an extra section under the name `all_columns`
|
|
97
|
+
which has the name of all the columns.
|
|
98
|
+
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
99
|
+
set of documents that an ES|QL query runs on.
|
|
100
|
+
:param format: A short version of the Accept header, for example `json` or `yaml`.
|
|
101
|
+
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
102
|
+
query, the response will include an extra `_clusters` object with information
|
|
103
|
+
about the clusters that participated in the search along with info such as
|
|
104
|
+
shards count.
|
|
105
|
+
:param keep_alive: The period for which the query and its results are stored
|
|
106
|
+
in the cluster. The default period is five days. When this period expires,
|
|
107
|
+
the query and its results are deleted, even if the query is still ongoing.
|
|
108
|
+
If the `keep_on_completion` parameter is false, Elasticsearch only stores
|
|
109
|
+
async queries that do not complete within the period set by the `wait_for_completion_timeout`
|
|
110
|
+
parameter, regardless of this value.
|
|
111
|
+
:param keep_on_completion: Indicates whether the query and its results are stored
|
|
112
|
+
in the cluster. If false, the query and its results are stored in the cluster
|
|
113
|
+
only if the request does not complete during the period set by the `wait_for_completion_timeout`
|
|
114
|
+
parameter.
|
|
115
|
+
:param locale:
|
|
116
|
+
:param params: To avoid any attempts of hacking or code injection, extract the
|
|
117
|
+
values in a separate list of parameters. Use question mark placeholders (?)
|
|
118
|
+
in the query string for each of the parameters.
|
|
119
|
+
:param profile: If provided and `true` the response will include an extra `profile`
|
|
120
|
+
object with information on how the query was executed. This information is
|
|
121
|
+
for human debugging and its format can change at any time but it can give
|
|
122
|
+
some insight into the performance of each part of the query.
|
|
123
|
+
:param tables: Tables to use with the LOOKUP operation. The top level key is
|
|
124
|
+
the table name and the next level key is the column name.
|
|
125
|
+
:param wait_for_completion_timeout: The period to wait for the request to finish.
|
|
126
|
+
By default, the request waits for 1 second for the query results. If the
|
|
127
|
+
query completes during this period, results are returned Otherwise, a query
|
|
128
|
+
ID is returned that can later be used to retrieve the results.
|
|
129
|
+
"""
|
|
130
|
+
if query is None and body is None:
|
|
131
|
+
raise ValueError("Empty value passed for parameter 'query'")
|
|
132
|
+
__path_parts: t.Dict[str, str] = {}
|
|
133
|
+
__path = "/_query/async"
|
|
134
|
+
__query: t.Dict[str, t.Any] = {}
|
|
135
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
136
|
+
if delimiter is not None:
|
|
137
|
+
__query["delimiter"] = delimiter
|
|
138
|
+
if drop_null_columns is not None:
|
|
139
|
+
__query["drop_null_columns"] = drop_null_columns
|
|
140
|
+
if error_trace is not None:
|
|
141
|
+
__query["error_trace"] = error_trace
|
|
142
|
+
if filter_path is not None:
|
|
143
|
+
__query["filter_path"] = filter_path
|
|
144
|
+
if format is not None:
|
|
145
|
+
__query["format"] = format
|
|
146
|
+
if human is not None:
|
|
147
|
+
__query["human"] = human
|
|
148
|
+
if keep_alive is not None:
|
|
149
|
+
__query["keep_alive"] = keep_alive
|
|
150
|
+
if keep_on_completion is not None:
|
|
151
|
+
__query["keep_on_completion"] = keep_on_completion
|
|
152
|
+
if pretty is not None:
|
|
153
|
+
__query["pretty"] = pretty
|
|
154
|
+
if not __body:
|
|
155
|
+
if query is not None:
|
|
156
|
+
__body["query"] = query
|
|
157
|
+
if columnar is not None:
|
|
158
|
+
__body["columnar"] = columnar
|
|
159
|
+
if filter is not None:
|
|
160
|
+
__body["filter"] = filter
|
|
161
|
+
if include_ccs_metadata is not None:
|
|
162
|
+
__body["include_ccs_metadata"] = include_ccs_metadata
|
|
163
|
+
if locale is not None:
|
|
164
|
+
__body["locale"] = locale
|
|
165
|
+
if params is not None:
|
|
166
|
+
__body["params"] = params
|
|
167
|
+
if profile is not None:
|
|
168
|
+
__body["profile"] = profile
|
|
169
|
+
if tables is not None:
|
|
170
|
+
__body["tables"] = tables
|
|
171
|
+
if wait_for_completion_timeout is not None:
|
|
172
|
+
__body["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
173
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
174
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
175
|
+
"POST",
|
|
176
|
+
__path,
|
|
177
|
+
params=__query,
|
|
178
|
+
headers=__headers,
|
|
179
|
+
body=__body,
|
|
180
|
+
endpoint_id="esql.async_query",
|
|
181
|
+
path_parts=__path_parts,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
@_rewrite_parameters()
|
|
185
|
+
async def async_query_delete(
|
|
186
|
+
self,
|
|
187
|
+
*,
|
|
188
|
+
id: str,
|
|
189
|
+
error_trace: t.Optional[bool] = None,
|
|
190
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
191
|
+
human: t.Optional[bool] = None,
|
|
192
|
+
pretty: t.Optional[bool] = None,
|
|
193
|
+
) -> ObjectApiResponse[t.Any]:
|
|
194
|
+
"""
|
|
195
|
+
.. raw:: html
|
|
196
|
+
|
|
197
|
+
<p>Delete an async ES|QL query.
|
|
198
|
+
If the query is still running, it is cancelled.
|
|
199
|
+
Otherwise, the stored results are deleted.</p>
|
|
200
|
+
<p>If the Elasticsearch security features are enabled, only the following users can use this API to delete a query:</p>
|
|
201
|
+
<ul>
|
|
202
|
+
<li>The authenticated user that submitted the original query request</li>
|
|
203
|
+
<li>Users with the <code>cancel_task</code> cluster privilege</li>
|
|
204
|
+
</ul>
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query-delete>`_
|
|
208
|
+
|
|
209
|
+
:param id: The unique identifier of the query. A query ID is provided in the
|
|
210
|
+
ES|QL async query API response for a query that does not complete in the
|
|
211
|
+
designated time. A query ID is also provided when the request was submitted
|
|
212
|
+
with the `keep_on_completion` parameter set to `true`.
|
|
213
|
+
"""
|
|
214
|
+
if id in SKIP_IN_PATH:
|
|
215
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
216
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
217
|
+
__path = f'/_query/async/{__path_parts["id"]}'
|
|
218
|
+
__query: t.Dict[str, t.Any] = {}
|
|
219
|
+
if error_trace is not None:
|
|
220
|
+
__query["error_trace"] = error_trace
|
|
221
|
+
if filter_path is not None:
|
|
222
|
+
__query["filter_path"] = filter_path
|
|
223
|
+
if human is not None:
|
|
224
|
+
__query["human"] = human
|
|
225
|
+
if pretty is not None:
|
|
226
|
+
__query["pretty"] = pretty
|
|
227
|
+
__headers = {"accept": "application/json"}
|
|
228
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
229
|
+
"DELETE",
|
|
230
|
+
__path,
|
|
231
|
+
params=__query,
|
|
232
|
+
headers=__headers,
|
|
233
|
+
endpoint_id="esql.async_query_delete",
|
|
234
|
+
path_parts=__path_parts,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
@_rewrite_parameters()
|
|
238
|
+
async def async_query_get(
|
|
239
|
+
self,
|
|
240
|
+
*,
|
|
241
|
+
id: str,
|
|
242
|
+
drop_null_columns: t.Optional[bool] = None,
|
|
243
|
+
error_trace: t.Optional[bool] = None,
|
|
244
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
245
|
+
human: t.Optional[bool] = None,
|
|
246
|
+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
247
|
+
pretty: t.Optional[bool] = None,
|
|
248
|
+
wait_for_completion_timeout: t.Optional[
|
|
249
|
+
t.Union[str, t.Literal[-1], t.Literal[0]]
|
|
250
|
+
] = None,
|
|
251
|
+
) -> ObjectApiResponse[t.Any]:
|
|
252
|
+
"""
|
|
253
|
+
.. raw:: html
|
|
254
|
+
|
|
255
|
+
<p>Get async ES|QL query results.
|
|
256
|
+
Get the current status and available results or stored results for an ES|QL asynchronous query.
|
|
257
|
+
If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API.</p>
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query-get>`_
|
|
261
|
+
|
|
262
|
+
:param id: The unique identifier of the query. A query ID is provided in the
|
|
263
|
+
ES|QL async query API response for a query that does not complete in the
|
|
264
|
+
designated time. A query ID is also provided when the request was submitted
|
|
265
|
+
with the `keep_on_completion` parameter set to `true`.
|
|
266
|
+
:param drop_null_columns: Indicates whether columns that are entirely `null`
|
|
267
|
+
will be removed from the `columns` and `values` portion of the results. If
|
|
268
|
+
`true`, the response will include an extra section under the name `all_columns`
|
|
269
|
+
which has the name of all the columns.
|
|
270
|
+
:param keep_alive: The period for which the query and its results are stored
|
|
271
|
+
in the cluster. When this period expires, the query and its results are deleted,
|
|
272
|
+
even if the query is still ongoing.
|
|
273
|
+
:param wait_for_completion_timeout: The period to wait for the request to finish.
|
|
274
|
+
By default, the request waits for complete query results. If the request
|
|
275
|
+
completes during the period specified in this parameter, complete query results
|
|
276
|
+
are returned. Otherwise, the response returns an `is_running` value of `true`
|
|
277
|
+
and no results.
|
|
278
|
+
"""
|
|
279
|
+
if id in SKIP_IN_PATH:
|
|
280
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
281
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
282
|
+
__path = f'/_query/async/{__path_parts["id"]}'
|
|
283
|
+
__query: t.Dict[str, t.Any] = {}
|
|
284
|
+
if drop_null_columns is not None:
|
|
285
|
+
__query["drop_null_columns"] = drop_null_columns
|
|
286
|
+
if error_trace is not None:
|
|
287
|
+
__query["error_trace"] = error_trace
|
|
288
|
+
if filter_path is not None:
|
|
289
|
+
__query["filter_path"] = filter_path
|
|
290
|
+
if human is not None:
|
|
291
|
+
__query["human"] = human
|
|
292
|
+
if keep_alive is not None:
|
|
293
|
+
__query["keep_alive"] = keep_alive
|
|
294
|
+
if pretty is not None:
|
|
295
|
+
__query["pretty"] = pretty
|
|
296
|
+
if wait_for_completion_timeout is not None:
|
|
297
|
+
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
298
|
+
__headers = {"accept": "application/json"}
|
|
299
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
300
|
+
"GET",
|
|
301
|
+
__path,
|
|
302
|
+
params=__query,
|
|
303
|
+
headers=__headers,
|
|
304
|
+
endpoint_id="esql.async_query_get",
|
|
305
|
+
path_parts=__path_parts,
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
@_rewrite_parameters()
|
|
309
|
+
async def async_query_stop(
|
|
310
|
+
self,
|
|
311
|
+
*,
|
|
312
|
+
id: str,
|
|
313
|
+
drop_null_columns: t.Optional[bool] = None,
|
|
314
|
+
error_trace: t.Optional[bool] = None,
|
|
315
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
316
|
+
human: t.Optional[bool] = None,
|
|
317
|
+
pretty: t.Optional[bool] = None,
|
|
318
|
+
) -> ObjectApiResponse[t.Any]:
|
|
319
|
+
"""
|
|
320
|
+
.. raw:: html
|
|
321
|
+
|
|
322
|
+
<p>Stop async ES|QL query.</p>
|
|
323
|
+
<p>This API interrupts the query execution and returns the results so far.
|
|
324
|
+
If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can stop it.</p>
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query-stop>`_
|
|
328
|
+
|
|
329
|
+
:param id: The unique identifier of the query. A query ID is provided in the
|
|
330
|
+
ES|QL async query API response for a query that does not complete in the
|
|
331
|
+
designated time. A query ID is also provided when the request was submitted
|
|
332
|
+
with the `keep_on_completion` parameter set to `true`.
|
|
333
|
+
:param drop_null_columns: Indicates whether columns that are entirely `null`
|
|
334
|
+
will be removed from the `columns` and `values` portion of the results. If
|
|
335
|
+
`true`, the response will include an extra section under the name `all_columns`
|
|
336
|
+
which has the name of all the columns.
|
|
337
|
+
"""
|
|
338
|
+
if id in SKIP_IN_PATH:
|
|
339
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
340
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
341
|
+
__path = f'/_query/async/{__path_parts["id"]}/stop'
|
|
342
|
+
__query: t.Dict[str, t.Any] = {}
|
|
343
|
+
if drop_null_columns is not None:
|
|
344
|
+
__query["drop_null_columns"] = drop_null_columns
|
|
345
|
+
if error_trace is not None:
|
|
346
|
+
__query["error_trace"] = error_trace
|
|
347
|
+
if filter_path is not None:
|
|
348
|
+
__query["filter_path"] = filter_path
|
|
349
|
+
if human is not None:
|
|
350
|
+
__query["human"] = human
|
|
351
|
+
if pretty is not None:
|
|
352
|
+
__query["pretty"] = pretty
|
|
353
|
+
__headers = {"accept": "application/json"}
|
|
354
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
355
|
+
"POST",
|
|
356
|
+
__path,
|
|
357
|
+
params=__query,
|
|
358
|
+
headers=__headers,
|
|
359
|
+
endpoint_id="esql.async_query_stop",
|
|
360
|
+
path_parts=__path_parts,
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
@_rewrite_parameters(
|
|
364
|
+
body_fields=(
|
|
365
|
+
"query",
|
|
366
|
+
"columnar",
|
|
367
|
+
"filter",
|
|
368
|
+
"include_ccs_metadata",
|
|
369
|
+
"locale",
|
|
370
|
+
"params",
|
|
371
|
+
"profile",
|
|
372
|
+
"tables",
|
|
373
|
+
),
|
|
374
|
+
ignore_deprecated_options={"params"},
|
|
375
|
+
)
|
|
376
|
+
async def query(
|
|
377
|
+
self,
|
|
378
|
+
*,
|
|
379
|
+
query: t.Optional[str] = None,
|
|
380
|
+
columnar: t.Optional[bool] = None,
|
|
381
|
+
delimiter: t.Optional[str] = None,
|
|
382
|
+
drop_null_columns: t.Optional[bool] = None,
|
|
383
|
+
error_trace: t.Optional[bool] = None,
|
|
384
|
+
filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
385
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
386
|
+
format: t.Optional[
|
|
387
|
+
t.Union[
|
|
388
|
+
str,
|
|
389
|
+
t.Literal[
|
|
390
|
+
"arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml"
|
|
391
|
+
],
|
|
392
|
+
]
|
|
393
|
+
] = None,
|
|
394
|
+
human: t.Optional[bool] = None,
|
|
395
|
+
include_ccs_metadata: t.Optional[bool] = None,
|
|
396
|
+
locale: t.Optional[str] = None,
|
|
397
|
+
params: t.Optional[t.Sequence[t.Union[None, bool, float, int, str]]] = None,
|
|
63
398
|
pretty: t.Optional[bool] = None,
|
|
64
399
|
profile: t.Optional[bool] = None,
|
|
65
400
|
tables: t.Optional[
|
|
@@ -68,10 +403,13 @@ class EsqlClient(NamespacedClient):
|
|
|
68
403
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
69
404
|
) -> ObjectApiResponse[t.Any]:
|
|
70
405
|
"""
|
|
71
|
-
|
|
72
|
-
|
|
406
|
+
.. raw:: html
|
|
407
|
+
|
|
408
|
+
<p>Run an ES|QL query.
|
|
409
|
+
Get search results for an ES|QL (Elasticsearch query language) query.</p>
|
|
410
|
+
|
|
73
411
|
|
|
74
|
-
`<https://www.elastic.co/
|
|
412
|
+
`<https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql-rest>`_
|
|
75
413
|
|
|
76
414
|
:param query: The ES|QL query API accepts an ES|QL query string in the query
|
|
77
415
|
parameter, runs it, and returns the results.
|
|
@@ -88,6 +426,10 @@ class EsqlClient(NamespacedClient):
|
|
|
88
426
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
89
427
|
set of documents that an ES|QL query runs on.
|
|
90
428
|
:param format: A short version of the Accept header, e.g. json, yaml.
|
|
429
|
+
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
430
|
+
query, the response will include an extra `_clusters` object with information
|
|
431
|
+
about the clusters that participated in the search along with info such as
|
|
432
|
+
shards count.
|
|
91
433
|
:param locale:
|
|
92
434
|
:param params: To avoid any attempts of hacking or code injection, extract the
|
|
93
435
|
values in a separate list of parameters. Use question mark placeholders (?)
|
|
@@ -126,6 +468,8 @@ class EsqlClient(NamespacedClient):
|
|
|
126
468
|
__body["columnar"] = columnar
|
|
127
469
|
if filter is not None:
|
|
128
470
|
__body["filter"] = filter
|
|
471
|
+
if include_ccs_metadata is not None:
|
|
472
|
+
__body["include_ccs_metadata"] = include_ccs_metadata
|
|
129
473
|
if locale is not None:
|
|
130
474
|
__body["locale"] = locale
|
|
131
475
|
if params is not None:
|
|
@@ -32,22 +32,25 @@ class FeaturesClient(NamespacedClient):
|
|
|
32
32
|
error_trace: t.Optional[bool] = None,
|
|
33
33
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
34
34
|
human: t.Optional[bool] = None,
|
|
35
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
35
36
|
pretty: t.Optional[bool] = None,
|
|
36
37
|
) -> ObjectApiResponse[t.Any]:
|
|
37
38
|
"""
|
|
38
|
-
|
|
39
|
-
the `feature_states` field when creating a snapshot. You can use this API to
|
|
40
|
-
determine which feature states to include when taking a snapshot. By default,
|
|
41
|
-
all feature states are included in a snapshot if that snapshot includes the global
|
|
42
|
-
state, or none if it does not. A feature state includes one or more system indices
|
|
43
|
-
necessary for a given feature to function. In order to ensure data integrity,
|
|
44
|
-
all system indices that comprise a feature state are snapshotted and restored
|
|
45
|
-
together. The features listed by this API are a combination of built-in features
|
|
46
|
-
and features defined by plugins. In order for a feature state to be listed in
|
|
47
|
-
this API and recognized as a valid feature state by the create snapshot API,
|
|
48
|
-
the plugin that defines that feature must be installed on the master node.
|
|
39
|
+
.. raw:: html
|
|
49
40
|
|
|
50
|
-
|
|
41
|
+
<p>Get the features.
|
|
42
|
+
Get a list of features that can be included in snapshots using the <code>feature_states</code> field when creating a snapshot.
|
|
43
|
+
You can use this API to determine which feature states to include when taking a snapshot.
|
|
44
|
+
By default, all feature states are included in a snapshot if that snapshot includes the global state, or none if it does not.</p>
|
|
45
|
+
<p>A feature state includes one or more system indices necessary for a given feature to function.
|
|
46
|
+
In order to ensure data integrity, all system indices that comprise a feature state are snapshotted and restored together.</p>
|
|
47
|
+
<p>The features listed by this API are a combination of built-in features and features defined by plugins.
|
|
48
|
+
In order for a feature state to be listed in this API and recognized as a valid feature state by the create snapshot API, the plugin that defines that feature must be installed on the master node.</p>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-features-get-features>`_
|
|
52
|
+
|
|
53
|
+
:param master_timeout: Period to wait for a connection to the master node.
|
|
51
54
|
"""
|
|
52
55
|
__path_parts: t.Dict[str, str] = {}
|
|
53
56
|
__path = "/_features"
|
|
@@ -58,6 +61,8 @@ class FeaturesClient(NamespacedClient):
|
|
|
58
61
|
__query["filter_path"] = filter_path
|
|
59
62
|
if human is not None:
|
|
60
63
|
__query["human"] = human
|
|
64
|
+
if master_timeout is not None:
|
|
65
|
+
__query["master_timeout"] = master_timeout
|
|
61
66
|
if pretty is not None:
|
|
62
67
|
__query["pretty"] = pretty
|
|
63
68
|
__headers = {"accept": "application/json"}
|
|
@@ -78,25 +83,28 @@ class FeaturesClient(NamespacedClient):
|
|
|
78
83
|
error_trace: t.Optional[bool] = None,
|
|
79
84
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
80
85
|
human: t.Optional[bool] = None,
|
|
86
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
81
87
|
pretty: t.Optional[bool] = None,
|
|
82
88
|
) -> ObjectApiResponse[t.Any]:
|
|
83
89
|
"""
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
.. raw:: html
|
|
91
|
+
|
|
92
|
+
<p>Reset the features.
|
|
93
|
+
Clear all of the state information stored in system indices by Elasticsearch features, including the security and machine learning indices.</p>
|
|
94
|
+
<p>WARNING: Intended for development and testing use only. Do not reset features on a production cluster.</p>
|
|
95
|
+
<p>Return a cluster to the same state as a new installation by resetting the feature state for all Elasticsearch features.
|
|
96
|
+
This deletes all state information stored in system indices.</p>
|
|
97
|
+
<p>The response code is HTTP 200 if the state is successfully reset for all features.
|
|
98
|
+
It is HTTP 500 if the reset operation failed for any feature.</p>
|
|
99
|
+
<p>Note that select features might provide a way to reset particular system indices.
|
|
100
|
+
Using this API resets all features, both those that are built-in and implemented as plugins.</p>
|
|
101
|
+
<p>To list the features that will be affected, use the get features API.</p>
|
|
102
|
+
<p>IMPORTANT: The features installed on the node you submit this request to are the features that will be reset. Run on the master node if you have any doubts about which plugins are installed on individual nodes.</p>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-features-reset-features>`_
|
|
98
106
|
|
|
99
|
-
|
|
107
|
+
:param master_timeout: Period to wait for a connection to the master node.
|
|
100
108
|
"""
|
|
101
109
|
__path_parts: t.Dict[str, str] = {}
|
|
102
110
|
__path = "/_features/_reset"
|
|
@@ -107,6 +115,8 @@ class FeaturesClient(NamespacedClient):
|
|
|
107
115
|
__query["filter_path"] = filter_path
|
|
108
116
|
if human is not None:
|
|
109
117
|
__query["human"] = human
|
|
118
|
+
if master_timeout is not None:
|
|
119
|
+
__query["master_timeout"] = master_timeout
|
|
110
120
|
if pretty is not None:
|
|
111
121
|
__query["pretty"] = pretty
|
|
112
122
|
__headers = {"accept": "application/json"}
|
|
@@ -46,10 +46,14 @@ class FleetClient(NamespacedClient):
|
|
|
46
46
|
wait_for_index: t.Optional[bool] = None,
|
|
47
47
|
) -> ObjectApiResponse[t.Any]:
|
|
48
48
|
"""
|
|
49
|
-
|
|
50
|
-
use by the fleet server project.
|
|
49
|
+
.. raw:: html
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
<p>Get global checkpoints.</p>
|
|
52
|
+
<p>Get the current global checkpoints for an index.
|
|
53
|
+
This API is designed for internal use by the Fleet server project.</p>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-fleet>`_
|
|
53
57
|
|
|
54
58
|
:param index: A single index or index alias that resolves to a single index.
|
|
55
59
|
:param checkpoints: A comma separated list of previous global checkpoints. When
|
|
@@ -132,10 +136,15 @@ class FleetClient(NamespacedClient):
|
|
|
132
136
|
wait_for_checkpoints: t.Optional[t.Sequence[int]] = None,
|
|
133
137
|
) -> ObjectApiResponse[t.Any]:
|
|
134
138
|
"""
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
.. raw:: html
|
|
140
|
+
|
|
141
|
+
<p>Run multiple Fleet searches.
|
|
142
|
+
Run several Fleet searches with a single API request.
|
|
143
|
+
The API follows the same structure as the multi search API.
|
|
144
|
+
However, similar to the Fleet search API, it supports the <code>wait_for_checkpoints</code> parameter.</p>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-fleet-msearch>`_
|
|
139
148
|
|
|
140
149
|
:param searches:
|
|
141
150
|
:param index: A single target to search. If the target is an index alias, it
|
|
@@ -146,9 +155,9 @@ class FleetClient(NamespacedClient):
|
|
|
146
155
|
example, a request targeting foo*,bar* returns an error if an index starts
|
|
147
156
|
with foo but no index starts with bar.
|
|
148
157
|
:param allow_partial_search_results: If true, returns partial results if there
|
|
149
|
-
are shard request timeouts or
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
are shard request timeouts or shard failures. If false, returns an error
|
|
159
|
+
with no partial results. Defaults to the configured cluster setting `search.default_allow_partial_results`,
|
|
160
|
+
which is true by default.
|
|
152
161
|
:param ccs_minimize_roundtrips: If true, network roundtrips between the coordinating
|
|
153
162
|
node and remote clusters are minimized for cross-cluster search requests.
|
|
154
163
|
:param expand_wildcards: Type of index that wildcard expressions can match. If
|
|
@@ -322,7 +331,6 @@ class FleetClient(NamespacedClient):
|
|
|
322
331
|
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
|
|
323
332
|
lenient: t.Optional[bool] = None,
|
|
324
333
|
max_concurrent_shard_requests: t.Optional[int] = None,
|
|
325
|
-
min_compatible_shard_node: t.Optional[str] = None,
|
|
326
334
|
min_score: t.Optional[float] = None,
|
|
327
335
|
pit: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
328
336
|
post_filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
@@ -342,7 +350,7 @@ class FleetClient(NamespacedClient):
|
|
|
342
350
|
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
343
351
|
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
344
352
|
search_after: t.Optional[
|
|
345
|
-
t.Sequence[t.Union[None, bool, float, int, str
|
|
353
|
+
t.Sequence[t.Union[None, bool, float, int, str]]
|
|
346
354
|
] = None,
|
|
347
355
|
search_type: t.Optional[
|
|
348
356
|
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
|
|
@@ -378,9 +386,14 @@ class FleetClient(NamespacedClient):
|
|
|
378
386
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
379
387
|
) -> ObjectApiResponse[t.Any]:
|
|
380
388
|
"""
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
389
|
+
.. raw:: html
|
|
390
|
+
|
|
391
|
+
<p>Run a Fleet search.
|
|
392
|
+
The purpose of the Fleet search API is to provide an API where the search will be run only
|
|
393
|
+
after the provided checkpoint has been processed and is visible for searches inside of Elasticsearch.</p>
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-fleet-search>`_
|
|
384
397
|
|
|
385
398
|
:param index: A single target to search. If the target is an index alias, it
|
|
386
399
|
must resolve to a single index.
|
|
@@ -388,9 +401,9 @@ class FleetClient(NamespacedClient):
|
|
|
388
401
|
:param aggs:
|
|
389
402
|
:param allow_no_indices:
|
|
390
403
|
:param allow_partial_search_results: If true, returns partial results if there
|
|
391
|
-
are shard request timeouts or
|
|
392
|
-
|
|
393
|
-
|
|
404
|
+
are shard request timeouts or shard failures. If false, returns an error
|
|
405
|
+
with no partial results. Defaults to the configured cluster setting `search.default_allow_partial_results`,
|
|
406
|
+
which is true by default.
|
|
394
407
|
:param analyze_wildcard:
|
|
395
408
|
:param analyzer:
|
|
396
409
|
:param batched_reduce_size:
|
|
@@ -416,9 +429,8 @@ class FleetClient(NamespacedClient):
|
|
|
416
429
|
:param indices_boost: Boosts the _score of documents from specified indices.
|
|
417
430
|
:param lenient:
|
|
418
431
|
:param max_concurrent_shard_requests:
|
|
419
|
-
:param min_compatible_shard_node:
|
|
420
432
|
:param min_score: Minimum _score for matching documents. Documents with a lower
|
|
421
|
-
_score are not included in
|
|
433
|
+
_score are not included in search results and results collected by aggregations.
|
|
422
434
|
:param pit: Limits the search to a point in time (PIT). If you provide a PIT,
|
|
423
435
|
you cannot specify an <index> in the request path.
|
|
424
436
|
:param post_filter:
|
|
@@ -531,8 +543,6 @@ class FleetClient(NamespacedClient):
|
|
|
531
543
|
__query["lenient"] = lenient
|
|
532
544
|
if max_concurrent_shard_requests is not None:
|
|
533
545
|
__query["max_concurrent_shard_requests"] = max_concurrent_shard_requests
|
|
534
|
-
if min_compatible_shard_node is not None:
|
|
535
|
-
__query["min_compatible_shard_node"] = min_compatible_shard_node
|
|
536
546
|
if pre_filter_shard_size is not None:
|
|
537
547
|
__query["pre_filter_shard_size"] = pre_filter_shard_size
|
|
538
548
|
if preference is not None:
|
|
@@ -45,16 +45,17 @@ class GraphClient(NamespacedClient):
|
|
|
45
45
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
46
46
|
) -> ObjectApiResponse[t.Any]:
|
|
47
47
|
"""
|
|
48
|
-
|
|
49
|
-
and terms in an Elasticsearch data stream or index. The easiest way to understand
|
|
50
|
-
the behavior of this API is to use the Graph UI to explore connections. An initial
|
|
51
|
-
request to the `_explore` API contains a seed query that identifies the documents
|
|
52
|
-
of interest and specifies the fields that define the vertices and connections
|
|
53
|
-
you want to include in the graph. Subsequent requests enable you to spider out
|
|
54
|
-
from one more vertices of interest. You can exclude vertices that have already
|
|
55
|
-
been returned.
|
|
48
|
+
.. raw:: html
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
<p>Explore graph analytics.
|
|
51
|
+
Extract and summarize information about the documents and terms in an Elasticsearch data stream or index.
|
|
52
|
+
The easiest way to understand the behavior of this API is to use the Graph UI to explore connections.
|
|
53
|
+
An initial request to the <code>_explore</code> API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph.
|
|
54
|
+
Subsequent requests enable you to spider out from one more vertices of interest.
|
|
55
|
+
You can exclude vertices that have already been returned.</p>
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-graph>`_
|
|
58
59
|
|
|
59
60
|
:param index: Name of the index.
|
|
60
61
|
:param connections: Specifies or more fields from which you want to extract terms
|