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,359 @@
|
|
|
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 EqlClient(NamespacedClient):
|
|
27
|
+
|
|
28
|
+
@_rewrite_parameters()
|
|
29
|
+
async def delete(
|
|
30
|
+
self,
|
|
31
|
+
*,
|
|
32
|
+
id: 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
|
+
pretty: t.Optional[bool] = None,
|
|
37
|
+
) -> ObjectApiResponse[t.Any]:
|
|
38
|
+
"""
|
|
39
|
+
.. raw:: html
|
|
40
|
+
|
|
41
|
+
<p>Delete an async EQL search.
|
|
42
|
+
Delete an async EQL search or a stored synchronous EQL search.
|
|
43
|
+
The API also deletes results for the search.</p>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-eql-delete>`_
|
|
47
|
+
|
|
48
|
+
:param id: Identifier for the search to delete. A search ID is provided in the
|
|
49
|
+
EQL search API's response for an async search. A search ID is also provided
|
|
50
|
+
if the request’s `keep_on_completion` parameter is `true`.
|
|
51
|
+
"""
|
|
52
|
+
if id in SKIP_IN_PATH:
|
|
53
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
54
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
55
|
+
__path = f'/_eql/search/{__path_parts["id"]}'
|
|
56
|
+
__query: t.Dict[str, t.Any] = {}
|
|
57
|
+
if error_trace is not None:
|
|
58
|
+
__query["error_trace"] = error_trace
|
|
59
|
+
if filter_path is not None:
|
|
60
|
+
__query["filter_path"] = filter_path
|
|
61
|
+
if human is not None:
|
|
62
|
+
__query["human"] = human
|
|
63
|
+
if pretty is not None:
|
|
64
|
+
__query["pretty"] = pretty
|
|
65
|
+
__headers = {"accept": "application/json"}
|
|
66
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
67
|
+
"DELETE",
|
|
68
|
+
__path,
|
|
69
|
+
params=__query,
|
|
70
|
+
headers=__headers,
|
|
71
|
+
endpoint_id="eql.delete",
|
|
72
|
+
path_parts=__path_parts,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
@_rewrite_parameters()
|
|
76
|
+
async def get(
|
|
77
|
+
self,
|
|
78
|
+
*,
|
|
79
|
+
id: str,
|
|
80
|
+
error_trace: t.Optional[bool] = None,
|
|
81
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
82
|
+
human: t.Optional[bool] = None,
|
|
83
|
+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
84
|
+
pretty: t.Optional[bool] = None,
|
|
85
|
+
wait_for_completion_timeout: t.Optional[
|
|
86
|
+
t.Union[str, t.Literal[-1], t.Literal[0]]
|
|
87
|
+
] = None,
|
|
88
|
+
) -> ObjectApiResponse[t.Any]:
|
|
89
|
+
"""
|
|
90
|
+
.. raw:: html
|
|
91
|
+
|
|
92
|
+
<p>Get async EQL search results.
|
|
93
|
+
Get the current status and available results for an async EQL search or a stored synchronous EQL search.</p>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-eql-get>`_
|
|
97
|
+
|
|
98
|
+
:param id: Identifier for the search.
|
|
99
|
+
:param keep_alive: Period for which the search and its results are stored on
|
|
100
|
+
the cluster. Defaults to the keep_alive value set by the search’s EQL search
|
|
101
|
+
API request.
|
|
102
|
+
:param wait_for_completion_timeout: Timeout duration to wait for the request
|
|
103
|
+
to finish. Defaults to no timeout, meaning the request waits for complete
|
|
104
|
+
search results.
|
|
105
|
+
"""
|
|
106
|
+
if id in SKIP_IN_PATH:
|
|
107
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
108
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
109
|
+
__path = f'/_eql/search/{__path_parts["id"]}'
|
|
110
|
+
__query: t.Dict[str, t.Any] = {}
|
|
111
|
+
if error_trace is not None:
|
|
112
|
+
__query["error_trace"] = error_trace
|
|
113
|
+
if filter_path is not None:
|
|
114
|
+
__query["filter_path"] = filter_path
|
|
115
|
+
if human is not None:
|
|
116
|
+
__query["human"] = human
|
|
117
|
+
if keep_alive is not None:
|
|
118
|
+
__query["keep_alive"] = keep_alive
|
|
119
|
+
if pretty is not None:
|
|
120
|
+
__query["pretty"] = pretty
|
|
121
|
+
if wait_for_completion_timeout is not None:
|
|
122
|
+
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
123
|
+
__headers = {"accept": "application/json"}
|
|
124
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
125
|
+
"GET",
|
|
126
|
+
__path,
|
|
127
|
+
params=__query,
|
|
128
|
+
headers=__headers,
|
|
129
|
+
endpoint_id="eql.get",
|
|
130
|
+
path_parts=__path_parts,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
@_rewrite_parameters()
|
|
134
|
+
async def get_status(
|
|
135
|
+
self,
|
|
136
|
+
*,
|
|
137
|
+
id: str,
|
|
138
|
+
error_trace: t.Optional[bool] = None,
|
|
139
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
140
|
+
human: t.Optional[bool] = None,
|
|
141
|
+
pretty: t.Optional[bool] = None,
|
|
142
|
+
) -> ObjectApiResponse[t.Any]:
|
|
143
|
+
"""
|
|
144
|
+
.. raw:: html
|
|
145
|
+
|
|
146
|
+
<p>Get the async EQL status.
|
|
147
|
+
Get the current status for an async EQL search or a stored synchronous EQL search without returning results.</p>
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-eql-get-status>`_
|
|
151
|
+
|
|
152
|
+
:param id: Identifier for the search.
|
|
153
|
+
"""
|
|
154
|
+
if id in SKIP_IN_PATH:
|
|
155
|
+
raise ValueError("Empty value passed for parameter 'id'")
|
|
156
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
157
|
+
__path = f'/_eql/search/status/{__path_parts["id"]}'
|
|
158
|
+
__query: t.Dict[str, t.Any] = {}
|
|
159
|
+
if error_trace is not None:
|
|
160
|
+
__query["error_trace"] = error_trace
|
|
161
|
+
if filter_path is not None:
|
|
162
|
+
__query["filter_path"] = filter_path
|
|
163
|
+
if human is not None:
|
|
164
|
+
__query["human"] = human
|
|
165
|
+
if pretty is not None:
|
|
166
|
+
__query["pretty"] = pretty
|
|
167
|
+
__headers = {"accept": "application/json"}
|
|
168
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
169
|
+
"GET",
|
|
170
|
+
__path,
|
|
171
|
+
params=__query,
|
|
172
|
+
headers=__headers,
|
|
173
|
+
endpoint_id="eql.get_status",
|
|
174
|
+
path_parts=__path_parts,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
@_rewrite_parameters(
|
|
178
|
+
body_fields=(
|
|
179
|
+
"query",
|
|
180
|
+
"allow_partial_search_results",
|
|
181
|
+
"allow_partial_sequence_results",
|
|
182
|
+
"case_sensitive",
|
|
183
|
+
"event_category_field",
|
|
184
|
+
"fetch_size",
|
|
185
|
+
"fields",
|
|
186
|
+
"filter",
|
|
187
|
+
"keep_alive",
|
|
188
|
+
"keep_on_completion",
|
|
189
|
+
"max_samples_per_key",
|
|
190
|
+
"result_position",
|
|
191
|
+
"runtime_mappings",
|
|
192
|
+
"size",
|
|
193
|
+
"tiebreaker_field",
|
|
194
|
+
"timestamp_field",
|
|
195
|
+
"wait_for_completion_timeout",
|
|
196
|
+
),
|
|
197
|
+
)
|
|
198
|
+
async def search(
|
|
199
|
+
self,
|
|
200
|
+
*,
|
|
201
|
+
index: t.Union[str, t.Sequence[str]],
|
|
202
|
+
query: t.Optional[str] = None,
|
|
203
|
+
allow_no_indices: t.Optional[bool] = None,
|
|
204
|
+
allow_partial_search_results: t.Optional[bool] = None,
|
|
205
|
+
allow_partial_sequence_results: t.Optional[bool] = None,
|
|
206
|
+
case_sensitive: t.Optional[bool] = None,
|
|
207
|
+
error_trace: t.Optional[bool] = None,
|
|
208
|
+
event_category_field: t.Optional[str] = None,
|
|
209
|
+
expand_wildcards: t.Optional[
|
|
210
|
+
t.Union[
|
|
211
|
+
t.Sequence[
|
|
212
|
+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
|
|
213
|
+
],
|
|
214
|
+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
|
|
215
|
+
]
|
|
216
|
+
] = None,
|
|
217
|
+
fetch_size: t.Optional[int] = None,
|
|
218
|
+
fields: t.Optional[
|
|
219
|
+
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
|
|
220
|
+
] = None,
|
|
221
|
+
filter: t.Optional[
|
|
222
|
+
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
|
|
223
|
+
] = None,
|
|
224
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
225
|
+
human: t.Optional[bool] = None,
|
|
226
|
+
ignore_unavailable: t.Optional[bool] = None,
|
|
227
|
+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
228
|
+
keep_on_completion: t.Optional[bool] = None,
|
|
229
|
+
max_samples_per_key: t.Optional[int] = None,
|
|
230
|
+
pretty: t.Optional[bool] = None,
|
|
231
|
+
result_position: t.Optional[t.Union[str, t.Literal["head", "tail"]]] = None,
|
|
232
|
+
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
233
|
+
size: t.Optional[int] = None,
|
|
234
|
+
tiebreaker_field: t.Optional[str] = None,
|
|
235
|
+
timestamp_field: t.Optional[str] = None,
|
|
236
|
+
wait_for_completion_timeout: t.Optional[
|
|
237
|
+
t.Union[str, t.Literal[-1], t.Literal[0]]
|
|
238
|
+
] = None,
|
|
239
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
240
|
+
) -> ObjectApiResponse[t.Any]:
|
|
241
|
+
"""
|
|
242
|
+
.. raw:: html
|
|
243
|
+
|
|
244
|
+
<p>Get EQL search results.
|
|
245
|
+
Returns search results for an Event Query Language (EQL) query.
|
|
246
|
+
EQL assumes each document in a data stream or index corresponds to an event.</p>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-eql-search>`_
|
|
250
|
+
|
|
251
|
+
:param index: The name of the index to scope the operation
|
|
252
|
+
:param query: EQL query you wish to run.
|
|
253
|
+
:param allow_no_indices:
|
|
254
|
+
:param allow_partial_search_results: Allow query execution also in case of shard
|
|
255
|
+
failures. If true, the query will keep running and will return results based
|
|
256
|
+
on the available shards. For sequences, the behavior can be further refined
|
|
257
|
+
using allow_partial_sequence_results
|
|
258
|
+
:param allow_partial_sequence_results: This flag applies only to sequences and
|
|
259
|
+
has effect only if allow_partial_search_results=true. If true, the sequence
|
|
260
|
+
query will return results based on the available shards, ignoring the others.
|
|
261
|
+
If false, the sequence query will return successfully, but will always have
|
|
262
|
+
empty results.
|
|
263
|
+
:param case_sensitive:
|
|
264
|
+
:param event_category_field: Field containing the event classification, such
|
|
265
|
+
as process, file, or network.
|
|
266
|
+
:param expand_wildcards:
|
|
267
|
+
:param fetch_size: Maximum number of events to search at a time for sequence
|
|
268
|
+
queries.
|
|
269
|
+
:param fields: Array of wildcard (*) patterns. The response returns values for
|
|
270
|
+
field names matching these patterns in the fields property of each hit.
|
|
271
|
+
:param filter: Query, written in Query DSL, used to filter the events on which
|
|
272
|
+
the EQL query runs.
|
|
273
|
+
:param ignore_unavailable: If true, missing or closed indices are not included
|
|
274
|
+
in the response.
|
|
275
|
+
:param keep_alive:
|
|
276
|
+
:param keep_on_completion:
|
|
277
|
+
:param max_samples_per_key: By default, the response of a sample query contains
|
|
278
|
+
up to `10` samples, with one sample per unique set of join keys. Use the
|
|
279
|
+
`size` parameter to get a smaller or larger set of samples. To retrieve more
|
|
280
|
+
than one sample per set of join keys, use the `max_samples_per_key` parameter.
|
|
281
|
+
Pipes are not supported for sample queries.
|
|
282
|
+
:param result_position:
|
|
283
|
+
:param runtime_mappings:
|
|
284
|
+
:param size: For basic queries, the maximum number of matching events to return.
|
|
285
|
+
Defaults to 10
|
|
286
|
+
:param tiebreaker_field: Field used to sort hits with the same timestamp in ascending
|
|
287
|
+
order
|
|
288
|
+
:param timestamp_field: Field containing event timestamp. Default "@timestamp"
|
|
289
|
+
:param wait_for_completion_timeout:
|
|
290
|
+
"""
|
|
291
|
+
if index in SKIP_IN_PATH:
|
|
292
|
+
raise ValueError("Empty value passed for parameter 'index'")
|
|
293
|
+
if query is None and body is None:
|
|
294
|
+
raise ValueError("Empty value passed for parameter 'query'")
|
|
295
|
+
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
|
|
296
|
+
__path = f'/{__path_parts["index"]}/_eql/search'
|
|
297
|
+
__query: t.Dict[str, t.Any] = {}
|
|
298
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
299
|
+
if allow_no_indices is not None:
|
|
300
|
+
__query["allow_no_indices"] = allow_no_indices
|
|
301
|
+
if error_trace is not None:
|
|
302
|
+
__query["error_trace"] = error_trace
|
|
303
|
+
if expand_wildcards is not None:
|
|
304
|
+
__query["expand_wildcards"] = expand_wildcards
|
|
305
|
+
if filter_path is not None:
|
|
306
|
+
__query["filter_path"] = filter_path
|
|
307
|
+
if human is not None:
|
|
308
|
+
__query["human"] = human
|
|
309
|
+
if ignore_unavailable is not None:
|
|
310
|
+
__query["ignore_unavailable"] = ignore_unavailable
|
|
311
|
+
if pretty is not None:
|
|
312
|
+
__query["pretty"] = pretty
|
|
313
|
+
if not __body:
|
|
314
|
+
if query is not None:
|
|
315
|
+
__body["query"] = query
|
|
316
|
+
if allow_partial_search_results is not None:
|
|
317
|
+
__body["allow_partial_search_results"] = allow_partial_search_results
|
|
318
|
+
if allow_partial_sequence_results is not None:
|
|
319
|
+
__body["allow_partial_sequence_results"] = (
|
|
320
|
+
allow_partial_sequence_results
|
|
321
|
+
)
|
|
322
|
+
if case_sensitive is not None:
|
|
323
|
+
__body["case_sensitive"] = case_sensitive
|
|
324
|
+
if event_category_field is not None:
|
|
325
|
+
__body["event_category_field"] = event_category_field
|
|
326
|
+
if fetch_size is not None:
|
|
327
|
+
__body["fetch_size"] = fetch_size
|
|
328
|
+
if fields is not None:
|
|
329
|
+
__body["fields"] = fields
|
|
330
|
+
if filter is not None:
|
|
331
|
+
__body["filter"] = filter
|
|
332
|
+
if keep_alive is not None:
|
|
333
|
+
__body["keep_alive"] = keep_alive
|
|
334
|
+
if keep_on_completion is not None:
|
|
335
|
+
__body["keep_on_completion"] = keep_on_completion
|
|
336
|
+
if max_samples_per_key is not None:
|
|
337
|
+
__body["max_samples_per_key"] = max_samples_per_key
|
|
338
|
+
if result_position is not None:
|
|
339
|
+
__body["result_position"] = result_position
|
|
340
|
+
if runtime_mappings is not None:
|
|
341
|
+
__body["runtime_mappings"] = runtime_mappings
|
|
342
|
+
if size is not None:
|
|
343
|
+
__body["size"] = size
|
|
344
|
+
if tiebreaker_field is not None:
|
|
345
|
+
__body["tiebreaker_field"] = tiebreaker_field
|
|
346
|
+
if timestamp_field is not None:
|
|
347
|
+
__body["timestamp_field"] = timestamp_field
|
|
348
|
+
if wait_for_completion_timeout is not None:
|
|
349
|
+
__body["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
350
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
351
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
352
|
+
"POST",
|
|
353
|
+
__path,
|
|
354
|
+
params=__query,
|
|
355
|
+
headers=__headers,
|
|
356
|
+
body=__body,
|
|
357
|
+
endpoint_id="eql.search",
|
|
358
|
+
path_parts=__path_parts,
|
|
359
|
+
)
|