elasticsearch 8.17.1__py3-none-any.whl → 8.18.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 +2146 -859
- elasticsearch/_async/client/_base.py +0 -1
- elasticsearch/_async/client/async_search.py +44 -29
- elasticsearch/_async/client/autoscaling.py +32 -26
- elasticsearch/_async/client/cat.py +244 -169
- elasticsearch/_async/client/ccr.py +268 -128
- elasticsearch/_async/client/cluster.py +191 -164
- elasticsearch/_async/client/connector.py +212 -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 +352 -4
- elasticsearch/_async/client/features.py +37 -27
- elasticsearch/_async/client/fleet.py +22 -10
- elasticsearch/_async/client/graph.py +10 -9
- elasticsearch/_async/client/ilm.py +108 -77
- elasticsearch/_async/client/indices.py +1112 -677
- elasticsearch/_async/client/inference.py +1875 -133
- 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 +642 -365
- elasticsearch/_async/client/monitoring.py +6 -3
- elasticsearch/_async/client/nodes.py +51 -53
- 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 +896 -558
- 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 +190 -213
- 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 +116 -72
- elasticsearch/_async/client/xpack.py +18 -9
- elasticsearch/_async/helpers.py +1 -2
- elasticsearch/_sync/client/__init__.py +2146 -859
- elasticsearch/_sync/client/_base.py +0 -1
- elasticsearch/_sync/client/async_search.py +44 -29
- elasticsearch/_sync/client/autoscaling.py +32 -26
- elasticsearch/_sync/client/cat.py +244 -169
- elasticsearch/_sync/client/ccr.py +268 -128
- elasticsearch/_sync/client/cluster.py +191 -164
- elasticsearch/_sync/client/connector.py +212 -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 +352 -4
- elasticsearch/_sync/client/features.py +37 -27
- elasticsearch/_sync/client/fleet.py +22 -10
- elasticsearch/_sync/client/graph.py +10 -9
- elasticsearch/_sync/client/ilm.py +108 -77
- elasticsearch/_sync/client/indices.py +1112 -677
- elasticsearch/_sync/client/inference.py +1875 -133
- 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 +642 -365
- elasticsearch/_sync/client/monitoring.py +6 -3
- elasticsearch/_sync/client/nodes.py +51 -53
- 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 +896 -558
- 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 +190 -213
- 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 -4
- elasticsearch/_sync/client/watcher.py +116 -72
- 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 +233 -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 +226 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3730 -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 +4254 -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 +2816 -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 +1040 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6471 -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 +119 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/METADATA +12 -2
- elasticsearch-8.18.0.dist-info/RECORD +161 -0
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.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,6 +30,344 @@ class EsqlClient(NamespacedClient):
|
|
|
30
30
|
"query",
|
|
31
31
|
"columnar",
|
|
32
32
|
"filter",
|
|
33
|
+
"include_ccs_metadata",
|
|
34
|
+
"locale",
|
|
35
|
+
"params",
|
|
36
|
+
"profile",
|
|
37
|
+
"tables",
|
|
38
|
+
"wait_for_completion_timeout",
|
|
39
|
+
),
|
|
40
|
+
ignore_deprecated_options={"params"},
|
|
41
|
+
)
|
|
42
|
+
def async_query(
|
|
43
|
+
self,
|
|
44
|
+
*,
|
|
45
|
+
query: t.Optional[str] = None,
|
|
46
|
+
columnar: t.Optional[bool] = None,
|
|
47
|
+
delimiter: t.Optional[str] = None,
|
|
48
|
+
drop_null_columns: t.Optional[bool] = None,
|
|
49
|
+
error_trace: t.Optional[bool] = None,
|
|
50
|
+
filter: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
51
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
52
|
+
format: t.Optional[
|
|
53
|
+
t.Union[
|
|
54
|
+
str,
|
|
55
|
+
t.Literal[
|
|
56
|
+
"arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml"
|
|
57
|
+
],
|
|
58
|
+
]
|
|
59
|
+
] = None,
|
|
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,
|
|
64
|
+
locale: t.Optional[str] = None,
|
|
65
|
+
params: t.Optional[
|
|
66
|
+
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
|
|
67
|
+
] = None,
|
|
68
|
+
pretty: t.Optional[bool] = None,
|
|
69
|
+
profile: t.Optional[bool] = None,
|
|
70
|
+
tables: t.Optional[
|
|
71
|
+
t.Mapping[str, t.Mapping[str, t.Mapping[str, t.Any]]]
|
|
72
|
+
] = None,
|
|
73
|
+
wait_for_completion_timeout: t.Optional[
|
|
74
|
+
t.Union[str, t.Literal[-1], t.Literal[0]]
|
|
75
|
+
] = None,
|
|
76
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
77
|
+
) -> ObjectApiResponse[t.Any]:
|
|
78
|
+
"""
|
|
79
|
+
.. raw:: html
|
|
80
|
+
|
|
81
|
+
<p>Run an async ES|QL query.
|
|
82
|
+
Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available.</p>
|
|
83
|
+
<p>The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties.</p>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/esql-async-query-api.html>`_
|
|
87
|
+
|
|
88
|
+
:param query: The ES|QL query API accepts an ES|QL query string in the query
|
|
89
|
+
parameter, runs it, and returns the results.
|
|
90
|
+
:param columnar: By default, ES|QL returns results as rows. For example, FROM
|
|
91
|
+
returns each individual document as one row. For the JSON, YAML, CBOR and
|
|
92
|
+
smile formats, ES|QL can return the results in a columnar fashion where one
|
|
93
|
+
row represents all the values of a certain column in the results.
|
|
94
|
+
:param delimiter: The character to use between values within a CSV row. It is
|
|
95
|
+
valid only for the CSV format.
|
|
96
|
+
:param drop_null_columns: Indicates whether columns that are entirely `null`
|
|
97
|
+
will be removed from the `columns` and `values` portion of the results. If
|
|
98
|
+
`true`, the response will include an extra section under the name `all_columns`
|
|
99
|
+
which has the name of all the columns.
|
|
100
|
+
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
101
|
+
set of documents that an ES|QL query runs on.
|
|
102
|
+
:param format: A short version of the Accept header, for example `json` or `yaml`.
|
|
103
|
+
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
104
|
+
query, the response will include an extra `_clusters` object with information
|
|
105
|
+
about the clusters that participated in the search along with info such as
|
|
106
|
+
shards count.
|
|
107
|
+
:param keep_alive: The period for which the query and its results are stored
|
|
108
|
+
in the cluster. The default period is five days. When this period expires,
|
|
109
|
+
the query and its results are deleted, even if the query is still ongoing.
|
|
110
|
+
If the `keep_on_completion` parameter is false, Elasticsearch only stores
|
|
111
|
+
async queries that do not complete within the period set by the `wait_for_completion_timeout`
|
|
112
|
+
parameter, regardless of this value.
|
|
113
|
+
:param keep_on_completion: Indicates whether the query and its results are stored
|
|
114
|
+
in the cluster. If false, the query and its results are stored in the cluster
|
|
115
|
+
only if the request does not complete during the period set by the `wait_for_completion_timeout`
|
|
116
|
+
parameter.
|
|
117
|
+
:param locale:
|
|
118
|
+
:param params: To avoid any attempts of hacking or code injection, extract the
|
|
119
|
+
values in a separate list of parameters. Use question mark placeholders (?)
|
|
120
|
+
in the query string for each of the parameters.
|
|
121
|
+
:param profile: If provided and `true` the response will include an extra `profile`
|
|
122
|
+
object with information on how the query was executed. This information is
|
|
123
|
+
for human debugging and its format can change at any time but it can give
|
|
124
|
+
some insight into the performance of each part of the query.
|
|
125
|
+
:param tables: Tables to use with the LOOKUP operation. The top level key is
|
|
126
|
+
the table name and the next level key is the column name.
|
|
127
|
+
:param wait_for_completion_timeout: The period to wait for the request to finish.
|
|
128
|
+
By default, the request waits for 1 second for the query results. If the
|
|
129
|
+
query completes during this period, results are returned Otherwise, a query
|
|
130
|
+
ID is returned that can later be used to retrieve the results.
|
|
131
|
+
"""
|
|
132
|
+
if query is None and body is None:
|
|
133
|
+
raise ValueError("Empty value passed for parameter 'query'")
|
|
134
|
+
__path_parts: t.Dict[str, str] = {}
|
|
135
|
+
__path = "/_query/async"
|
|
136
|
+
__query: t.Dict[str, t.Any] = {}
|
|
137
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
138
|
+
if delimiter is not None:
|
|
139
|
+
__query["delimiter"] = delimiter
|
|
140
|
+
if drop_null_columns is not None:
|
|
141
|
+
__query["drop_null_columns"] = drop_null_columns
|
|
142
|
+
if error_trace is not None:
|
|
143
|
+
__query["error_trace"] = error_trace
|
|
144
|
+
if filter_path is not None:
|
|
145
|
+
__query["filter_path"] = filter_path
|
|
146
|
+
if format is not None:
|
|
147
|
+
__query["format"] = format
|
|
148
|
+
if human is not None:
|
|
149
|
+
__query["human"] = human
|
|
150
|
+
if keep_alive is not None:
|
|
151
|
+
__query["keep_alive"] = keep_alive
|
|
152
|
+
if keep_on_completion is not None:
|
|
153
|
+
__query["keep_on_completion"] = keep_on_completion
|
|
154
|
+
if pretty is not None:
|
|
155
|
+
__query["pretty"] = pretty
|
|
156
|
+
if not __body:
|
|
157
|
+
if query is not None:
|
|
158
|
+
__body["query"] = query
|
|
159
|
+
if columnar is not None:
|
|
160
|
+
__body["columnar"] = columnar
|
|
161
|
+
if filter is not None:
|
|
162
|
+
__body["filter"] = filter
|
|
163
|
+
if include_ccs_metadata is not None:
|
|
164
|
+
__body["include_ccs_metadata"] = include_ccs_metadata
|
|
165
|
+
if locale is not None:
|
|
166
|
+
__body["locale"] = locale
|
|
167
|
+
if params is not None:
|
|
168
|
+
__body["params"] = params
|
|
169
|
+
if profile is not None:
|
|
170
|
+
__body["profile"] = profile
|
|
171
|
+
if tables is not None:
|
|
172
|
+
__body["tables"] = tables
|
|
173
|
+
if wait_for_completion_timeout is not None:
|
|
174
|
+
__body["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
175
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
176
|
+
return self.perform_request( # type: ignore[return-value]
|
|
177
|
+
"POST",
|
|
178
|
+
__path,
|
|
179
|
+
params=__query,
|
|
180
|
+
headers=__headers,
|
|
181
|
+
body=__body,
|
|
182
|
+
endpoint_id="esql.async_query",
|
|
183
|
+
path_parts=__path_parts,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
@_rewrite_parameters()
|
|
187
|
+
def async_query_delete(
|
|
188
|
+
self,
|
|
189
|
+
*,
|
|
190
|
+
id: str,
|
|
191
|
+
error_trace: t.Optional[bool] = None,
|
|
192
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
193
|
+
human: t.Optional[bool] = None,
|
|
194
|
+
pretty: t.Optional[bool] = None,
|
|
195
|
+
) -> ObjectApiResponse[t.Any]:
|
|
196
|
+
"""
|
|
197
|
+
.. raw:: html
|
|
198
|
+
|
|
199
|
+
<p>Delete an async ES|QL query.
|
|
200
|
+
If the query is still running, it is cancelled.
|
|
201
|
+
Otherwise, the stored results are deleted.</p>
|
|
202
|
+
<p>If the Elasticsearch security features are enabled, only the following users can use this API to delete a query:</p>
|
|
203
|
+
<ul>
|
|
204
|
+
<li>The authenticated user that submitted the original query request</li>
|
|
205
|
+
<li>Users with the <code>cancel_task</code> cluster privilege</li>
|
|
206
|
+
</ul>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/esql-async-query-delete-api.html>`_
|
|
210
|
+
|
|
211
|
+
:param id: The unique identifier of the query. A query ID is provided in the
|
|
212
|
+
ES|QL async query API response for a query that does not complete in the
|
|
213
|
+
designated time. A query ID is also provided when the request was submitted
|
|
214
|
+
with the `keep_on_completion` parameter set to `true`.
|
|
215
|
+
"""
|
|
216
|
+
if id in SKIP_IN_PATH:
|
|
217
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
218
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
219
|
+
__path = f'/_query/async/{__path_parts["id"]}'
|
|
220
|
+
__query: t.Dict[str, t.Any] = {}
|
|
221
|
+
if error_trace is not None:
|
|
222
|
+
__query["error_trace"] = error_trace
|
|
223
|
+
if filter_path is not None:
|
|
224
|
+
__query["filter_path"] = filter_path
|
|
225
|
+
if human is not None:
|
|
226
|
+
__query["human"] = human
|
|
227
|
+
if pretty is not None:
|
|
228
|
+
__query["pretty"] = pretty
|
|
229
|
+
__headers = {"accept": "application/json"}
|
|
230
|
+
return self.perform_request( # type: ignore[return-value]
|
|
231
|
+
"DELETE",
|
|
232
|
+
__path,
|
|
233
|
+
params=__query,
|
|
234
|
+
headers=__headers,
|
|
235
|
+
endpoint_id="esql.async_query_delete",
|
|
236
|
+
path_parts=__path_parts,
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
@_rewrite_parameters()
|
|
240
|
+
def async_query_get(
|
|
241
|
+
self,
|
|
242
|
+
*,
|
|
243
|
+
id: str,
|
|
244
|
+
drop_null_columns: t.Optional[bool] = None,
|
|
245
|
+
error_trace: t.Optional[bool] = None,
|
|
246
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
247
|
+
human: t.Optional[bool] = None,
|
|
248
|
+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
249
|
+
pretty: t.Optional[bool] = None,
|
|
250
|
+
wait_for_completion_timeout: t.Optional[
|
|
251
|
+
t.Union[str, t.Literal[-1], t.Literal[0]]
|
|
252
|
+
] = None,
|
|
253
|
+
) -> ObjectApiResponse[t.Any]:
|
|
254
|
+
"""
|
|
255
|
+
.. raw:: html
|
|
256
|
+
|
|
257
|
+
<p>Get async ES|QL query results.
|
|
258
|
+
Get the current status and available results or stored results for an ES|QL asynchronous query.
|
|
259
|
+
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>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/esql-async-query-get-api.html>`_
|
|
263
|
+
|
|
264
|
+
:param id: The unique identifier of the query. A query ID is provided in the
|
|
265
|
+
ES|QL async query API response for a query that does not complete in the
|
|
266
|
+
designated time. A query ID is also provided when the request was submitted
|
|
267
|
+
with the `keep_on_completion` parameter set to `true`.
|
|
268
|
+
:param drop_null_columns: Indicates whether columns that are entirely `null`
|
|
269
|
+
will be removed from the `columns` and `values` portion of the results. If
|
|
270
|
+
`true`, the response will include an extra section under the name `all_columns`
|
|
271
|
+
which has the name of all the columns.
|
|
272
|
+
:param keep_alive: The period for which the query and its results are stored
|
|
273
|
+
in the cluster. When this period expires, the query and its results are deleted,
|
|
274
|
+
even if the query is still ongoing.
|
|
275
|
+
:param wait_for_completion_timeout: The period to wait for the request to finish.
|
|
276
|
+
By default, the request waits for complete query results. If the request
|
|
277
|
+
completes during the period specified in this parameter, complete query results
|
|
278
|
+
are returned. Otherwise, the response returns an `is_running` value of `true`
|
|
279
|
+
and no results.
|
|
280
|
+
"""
|
|
281
|
+
if id in SKIP_IN_PATH:
|
|
282
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
283
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
284
|
+
__path = f'/_query/async/{__path_parts["id"]}'
|
|
285
|
+
__query: t.Dict[str, t.Any] = {}
|
|
286
|
+
if drop_null_columns is not None:
|
|
287
|
+
__query["drop_null_columns"] = drop_null_columns
|
|
288
|
+
if error_trace is not None:
|
|
289
|
+
__query["error_trace"] = error_trace
|
|
290
|
+
if filter_path is not None:
|
|
291
|
+
__query["filter_path"] = filter_path
|
|
292
|
+
if human is not None:
|
|
293
|
+
__query["human"] = human
|
|
294
|
+
if keep_alive is not None:
|
|
295
|
+
__query["keep_alive"] = keep_alive
|
|
296
|
+
if pretty is not None:
|
|
297
|
+
__query["pretty"] = pretty
|
|
298
|
+
if wait_for_completion_timeout is not None:
|
|
299
|
+
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
300
|
+
__headers = {"accept": "application/json"}
|
|
301
|
+
return self.perform_request( # type: ignore[return-value]
|
|
302
|
+
"GET",
|
|
303
|
+
__path,
|
|
304
|
+
params=__query,
|
|
305
|
+
headers=__headers,
|
|
306
|
+
endpoint_id="esql.async_query_get",
|
|
307
|
+
path_parts=__path_parts,
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
@_rewrite_parameters()
|
|
311
|
+
def async_query_stop(
|
|
312
|
+
self,
|
|
313
|
+
*,
|
|
314
|
+
id: str,
|
|
315
|
+
drop_null_columns: t.Optional[bool] = None,
|
|
316
|
+
error_trace: t.Optional[bool] = None,
|
|
317
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
318
|
+
human: t.Optional[bool] = None,
|
|
319
|
+
pretty: t.Optional[bool] = None,
|
|
320
|
+
) -> ObjectApiResponse[t.Any]:
|
|
321
|
+
"""
|
|
322
|
+
.. raw:: html
|
|
323
|
+
|
|
324
|
+
<p>Stop async ES|QL query.</p>
|
|
325
|
+
<p>This API interrupts the query execution and returns the results so far.
|
|
326
|
+
If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can stop it.</p>
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/esql-async-query-stop-api.html>`_
|
|
330
|
+
|
|
331
|
+
:param id: The unique identifier of the query. A query ID is provided in the
|
|
332
|
+
ES|QL async query API response for a query that does not complete in the
|
|
333
|
+
designated time. A query ID is also provided when the request was submitted
|
|
334
|
+
with the `keep_on_completion` parameter set to `true`.
|
|
335
|
+
:param drop_null_columns: Indicates whether columns that are entirely `null`
|
|
336
|
+
will be removed from the `columns` and `values` portion of the results. If
|
|
337
|
+
`true`, the response will include an extra section under the name `all_columns`
|
|
338
|
+
which has the name of all the columns.
|
|
339
|
+
"""
|
|
340
|
+
if id in SKIP_IN_PATH:
|
|
341
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
342
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
343
|
+
__path = f'/_query/async/{__path_parts["id"]}/stop'
|
|
344
|
+
__query: t.Dict[str, t.Any] = {}
|
|
345
|
+
if drop_null_columns is not None:
|
|
346
|
+
__query["drop_null_columns"] = drop_null_columns
|
|
347
|
+
if error_trace is not None:
|
|
348
|
+
__query["error_trace"] = error_trace
|
|
349
|
+
if filter_path is not None:
|
|
350
|
+
__query["filter_path"] = filter_path
|
|
351
|
+
if human is not None:
|
|
352
|
+
__query["human"] = human
|
|
353
|
+
if pretty is not None:
|
|
354
|
+
__query["pretty"] = pretty
|
|
355
|
+
__headers = {"accept": "application/json"}
|
|
356
|
+
return self.perform_request( # type: ignore[return-value]
|
|
357
|
+
"POST",
|
|
358
|
+
__path,
|
|
359
|
+
params=__query,
|
|
360
|
+
headers=__headers,
|
|
361
|
+
endpoint_id="esql.async_query_stop",
|
|
362
|
+
path_parts=__path_parts,
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
@_rewrite_parameters(
|
|
366
|
+
body_fields=(
|
|
367
|
+
"query",
|
|
368
|
+
"columnar",
|
|
369
|
+
"filter",
|
|
370
|
+
"include_ccs_metadata",
|
|
33
371
|
"locale",
|
|
34
372
|
"params",
|
|
35
373
|
"profile",
|
|
@@ -56,6 +394,7 @@ class EsqlClient(NamespacedClient):
|
|
|
56
394
|
]
|
|
57
395
|
] = None,
|
|
58
396
|
human: t.Optional[bool] = None,
|
|
397
|
+
include_ccs_metadata: t.Optional[bool] = None,
|
|
59
398
|
locale: t.Optional[str] = None,
|
|
60
399
|
params: t.Optional[
|
|
61
400
|
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
|
|
@@ -68,10 +407,13 @@ class EsqlClient(NamespacedClient):
|
|
|
68
407
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
69
408
|
) -> ObjectApiResponse[t.Any]:
|
|
70
409
|
"""
|
|
71
|
-
|
|
72
|
-
|
|
410
|
+
.. raw:: html
|
|
411
|
+
|
|
412
|
+
<p>Run an ES|QL query.
|
|
413
|
+
Get search results for an ES|QL (Elasticsearch query language) query.</p>
|
|
414
|
+
|
|
73
415
|
|
|
74
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
416
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/esql-rest.html>`_
|
|
75
417
|
|
|
76
418
|
:param query: The ES|QL query API accepts an ES|QL query string in the query
|
|
77
419
|
parameter, runs it, and returns the results.
|
|
@@ -88,6 +430,10 @@ class EsqlClient(NamespacedClient):
|
|
|
88
430
|
:param filter: Specify a Query DSL query in the filter parameter to filter the
|
|
89
431
|
set of documents that an ES|QL query runs on.
|
|
90
432
|
:param format: A short version of the Accept header, e.g. json, yaml.
|
|
433
|
+
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
|
|
434
|
+
query, the response will include an extra `_clusters` object with information
|
|
435
|
+
about the clusters that participated in the search along with info such as
|
|
436
|
+
shards count.
|
|
91
437
|
:param locale:
|
|
92
438
|
:param params: To avoid any attempts of hacking or code injection, extract the
|
|
93
439
|
values in a separate list of parameters. Use question mark placeholders (?)
|
|
@@ -126,6 +472,8 @@ class EsqlClient(NamespacedClient):
|
|
|
126
472
|
__body["columnar"] = columnar
|
|
127
473
|
if filter is not None:
|
|
128
474
|
__body["filter"] = filter
|
|
475
|
+
if include_ccs_metadata is not None:
|
|
476
|
+
__body["include_ccs_metadata"] = include_ccs_metadata
|
|
129
477
|
if locale is not None:
|
|
130
478
|
__body["locale"] = locale
|
|
131
479
|
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/guide/en/elasticsearch/reference/8.18/get-features-api.html>`_
|
|
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/guide/en/elasticsearch/reference/8.18/reset-features-api.html>`_
|
|
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/guide/en/elasticsearch/reference/8.18/get-global-checkpoints.html>`_
|
|
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,14 @@ 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>Executes several <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html">fleet searches</a> with a single API request.
|
|
142
|
+
The API follows the same structure as the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html">multi search</a> API. However, similar to the fleet search API, it
|
|
143
|
+
supports the wait_for_checkpoints parameter.</p>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/fleet-multi-search.html>`_
|
|
139
147
|
|
|
140
148
|
:param searches:
|
|
141
149
|
:param index: A single target to search. If the target is an index alias, it
|
|
@@ -378,9 +386,13 @@ 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>The purpose of the fleet search api is to provide a search api where the search will only be executed
|
|
392
|
+
after provided checkpoint has been processed and is visible for searches inside of Elasticsearch.</p>
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/fleet-search.html>`_
|
|
384
396
|
|
|
385
397
|
:param index: A single target to search. If the target is an index alias, it
|
|
386
398
|
must resolve to a single index.
|
|
@@ -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/guide/en/elasticsearch/reference/8.18/graph-explore-api.html>`_
|
|
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
|