elasticsearch 8.14.0__py3-none-any.whl → 8.15.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/_async/client/__init__.py +196 -168
- elasticsearch/_async/client/async_search.py +35 -20
- elasticsearch/_async/client/autoscaling.py +4 -4
- elasticsearch/_async/client/cat.py +785 -180
- elasticsearch/_async/client/ccr.py +20 -32
- elasticsearch/_async/client/cluster.py +87 -79
- elasticsearch/_async/client/connector.py +1470 -0
- elasticsearch/_async/client/dangling_indices.py +7 -11
- elasticsearch/_async/client/enrich.py +8 -8
- elasticsearch/_async/client/eql.py +17 -16
- elasticsearch/_async/client/esql.py +2 -2
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +18 -17
- elasticsearch/_async/client/graph.py +4 -4
- elasticsearch/_async/client/ilm.py +36 -44
- elasticsearch/_async/client/indices.py +282 -317
- elasticsearch/_async/client/inference.py +42 -33
- elasticsearch/_async/client/ingest.py +22 -23
- elasticsearch/_async/client/license.py +18 -10
- elasticsearch/_async/client/logstash.py +6 -6
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +383 -176
- elasticsearch/_async/client/monitoring.py +2 -2
- elasticsearch/_async/client/nodes.py +32 -32
- elasticsearch/_async/client/query_rules.py +384 -0
- elasticsearch/_async/client/rollup.py +13 -13
- elasticsearch/_async/client/search_application.py +10 -10
- elasticsearch/_async/client/searchable_snapshots.py +9 -13
- elasticsearch/_async/client/security.py +577 -104
- elasticsearch/_async/client/shutdown.py +7 -7
- elasticsearch/_async/client/slm.py +11 -13
- elasticsearch/_async/client/snapshot.py +39 -52
- elasticsearch/_async/client/sql.py +12 -14
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +8 -8
- elasticsearch/_async/client/tasks.py +9 -10
- elasticsearch/_async/client/text_structure.py +3 -3
- elasticsearch/_async/client/transform.py +89 -34
- elasticsearch/_async/client/watcher.py +30 -15
- elasticsearch/_async/client/xpack.py +6 -7
- elasticsearch/_otel.py +2 -6
- elasticsearch/_sync/client/__init__.py +196 -168
- elasticsearch/_sync/client/async_search.py +35 -20
- elasticsearch/_sync/client/autoscaling.py +4 -4
- elasticsearch/_sync/client/cat.py +785 -180
- elasticsearch/_sync/client/ccr.py +20 -32
- elasticsearch/_sync/client/cluster.py +87 -79
- elasticsearch/_sync/client/connector.py +1470 -0
- elasticsearch/_sync/client/dangling_indices.py +7 -11
- elasticsearch/_sync/client/enrich.py +8 -8
- elasticsearch/_sync/client/eql.py +17 -16
- elasticsearch/_sync/client/esql.py +2 -2
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +18 -17
- elasticsearch/_sync/client/graph.py +4 -4
- elasticsearch/_sync/client/ilm.py +36 -44
- elasticsearch/_sync/client/indices.py +282 -317
- elasticsearch/_sync/client/inference.py +42 -33
- elasticsearch/_sync/client/ingest.py +22 -23
- elasticsearch/_sync/client/license.py +18 -10
- elasticsearch/_sync/client/logstash.py +6 -6
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +383 -176
- elasticsearch/_sync/client/monitoring.py +2 -2
- elasticsearch/_sync/client/nodes.py +32 -32
- elasticsearch/_sync/client/query_rules.py +384 -0
- elasticsearch/_sync/client/rollup.py +13 -13
- elasticsearch/_sync/client/search_application.py +10 -10
- elasticsearch/_sync/client/searchable_snapshots.py +9 -13
- elasticsearch/_sync/client/security.py +577 -104
- elasticsearch/_sync/client/shutdown.py +7 -7
- elasticsearch/_sync/client/slm.py +11 -13
- elasticsearch/_sync/client/snapshot.py +39 -52
- elasticsearch/_sync/client/sql.py +12 -14
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +8 -8
- elasticsearch/_sync/client/tasks.py +9 -10
- elasticsearch/_sync/client/text_structure.py +3 -3
- elasticsearch/_sync/client/transform.py +89 -34
- elasticsearch/_sync/client/watcher.py +30 -15
- elasticsearch/_sync/client/xpack.py +6 -7
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +3 -3
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +36 -6
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +36 -6
- elasticsearch/serializer.py +34 -0
- elasticsearch-8.15.0.dist-info/METADATA +177 -0
- elasticsearch-8.15.0.dist-info/RECORD +117 -0
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info}/WHEEL +1 -2
- elasticsearch/_async/client/query_ruleset.py +0 -205
- elasticsearch/_sync/client/query_ruleset.py +0 -205
- elasticsearch-8.14.0.dist-info/METADATA +0 -161
- elasticsearch-8.14.0.dist-info/RECORD +0 -116
- elasticsearch-8.14.0.dist-info/top_level.txt +0 -1
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info/licenses}/LICENSE +0 -0
- {elasticsearch-8.14.0.dist-info → elasticsearch-8.15.0.dist-info/licenses}/NOTICE +0 -0
|
@@ -31,7 +31,7 @@ class MonitoringClient(NamespacedClient):
|
|
|
31
31
|
def bulk(
|
|
32
32
|
self,
|
|
33
33
|
*,
|
|
34
|
-
interval: t.Union[
|
|
34
|
+
interval: t.Union[str, t.Literal[-1], t.Literal[0]],
|
|
35
35
|
operations: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
36
36
|
body: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
37
37
|
system_api_version: str,
|
|
@@ -44,7 +44,7 @@ class MonitoringClient(NamespacedClient):
|
|
|
44
44
|
"""
|
|
45
45
|
Used by the monitoring features to send monitoring data.
|
|
46
46
|
|
|
47
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
47
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/monitor-elasticsearch-cluster.html>`_
|
|
48
48
|
|
|
49
49
|
:param interval: Collection interval (e.g., '10s' or '10000ms') of the payload
|
|
50
50
|
:param operations:
|
|
@@ -37,9 +37,10 @@ class NodesClient(NamespacedClient):
|
|
|
37
37
|
pretty: t.Optional[bool] = None,
|
|
38
38
|
) -> ObjectApiResponse[t.Any]:
|
|
39
39
|
"""
|
|
40
|
-
|
|
40
|
+
You can use this API to clear the archived repositories metering information
|
|
41
|
+
in the cluster.
|
|
41
42
|
|
|
42
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
43
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/clear-repositories-metering-archive-api.html>`_
|
|
43
44
|
|
|
44
45
|
:param node_id: Comma-separated list of node IDs or names used to limit returned
|
|
45
46
|
information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes).
|
|
@@ -85,9 +86,13 @@ class NodesClient(NamespacedClient):
|
|
|
85
86
|
pretty: t.Optional[bool] = None,
|
|
86
87
|
) -> ObjectApiResponse[t.Any]:
|
|
87
88
|
"""
|
|
88
|
-
|
|
89
|
+
You can use the cluster repositories metering API to retrieve repositories metering
|
|
90
|
+
information in a cluster. This API exposes monotonically non-decreasing counters
|
|
91
|
+
and it’s expected that clients would durably store the information needed to
|
|
92
|
+
compute aggregations over a period of time. Additionally, the information exposed
|
|
93
|
+
by this API is volatile, meaning that it won’t be present after node restarts.
|
|
89
94
|
|
|
90
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
95
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/get-repositories-metering-api.html>`_
|
|
91
96
|
|
|
92
97
|
:param node_id: Comma-separated list of node IDs or names used to limit returned
|
|
93
98
|
information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes).
|
|
@@ -124,25 +129,24 @@ class NodesClient(NamespacedClient):
|
|
|
124
129
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
125
130
|
human: t.Optional[bool] = None,
|
|
126
131
|
ignore_idle_threads: t.Optional[bool] = None,
|
|
127
|
-
interval: t.Optional[t.Union[
|
|
128
|
-
master_timeout: t.Optional[
|
|
129
|
-
t.Union["t.Literal[-1]", "t.Literal[0]", str]
|
|
130
|
-
] = None,
|
|
132
|
+
interval: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
133
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
131
134
|
pretty: t.Optional[bool] = None,
|
|
132
135
|
snapshots: t.Optional[int] = None,
|
|
133
136
|
sort: t.Optional[
|
|
134
|
-
t.Union[
|
|
137
|
+
t.Union[str, t.Literal["block", "cpu", "gpu", "mem", "wait"]]
|
|
135
138
|
] = None,
|
|
136
139
|
threads: t.Optional[int] = None,
|
|
137
|
-
timeout: t.Optional[t.Union[
|
|
140
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
138
141
|
type: t.Optional[
|
|
139
|
-
t.Union[
|
|
142
|
+
t.Union[str, t.Literal["block", "cpu", "gpu", "mem", "wait"]]
|
|
140
143
|
] = None,
|
|
141
144
|
) -> TextApiResponse:
|
|
142
145
|
"""
|
|
143
|
-
|
|
146
|
+
This API yields a breakdown of the hot threads on each selected node in the cluster.
|
|
147
|
+
The output is plain text with a breakdown of each node’s top hot threads.
|
|
144
148
|
|
|
145
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
149
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/cluster-nodes-hot-threads.html>`_
|
|
146
150
|
|
|
147
151
|
:param node_id: List of node IDs or names used to limit returned information.
|
|
148
152
|
:param ignore_idle_threads: If true, known idle threads (e.g. waiting in a socket
|
|
@@ -210,16 +214,14 @@ class NodesClient(NamespacedClient):
|
|
|
210
214
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
211
215
|
flat_settings: t.Optional[bool] = None,
|
|
212
216
|
human: t.Optional[bool] = None,
|
|
213
|
-
master_timeout: t.Optional[
|
|
214
|
-
t.Union["t.Literal[-1]", "t.Literal[0]", str]
|
|
215
|
-
] = None,
|
|
217
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
216
218
|
pretty: t.Optional[bool] = None,
|
|
217
|
-
timeout: t.Optional[t.Union[
|
|
219
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
218
220
|
) -> ObjectApiResponse[t.Any]:
|
|
219
221
|
"""
|
|
220
|
-
Returns
|
|
222
|
+
Returns cluster nodes information.
|
|
221
223
|
|
|
222
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
224
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/cluster-nodes-info.html>`_
|
|
223
225
|
|
|
224
226
|
:param node_id: Comma-separated list of node IDs or names used to limit returned
|
|
225
227
|
information.
|
|
@@ -282,13 +284,13 @@ class NodesClient(NamespacedClient):
|
|
|
282
284
|
human: t.Optional[bool] = None,
|
|
283
285
|
pretty: t.Optional[bool] = None,
|
|
284
286
|
secure_settings_password: t.Optional[str] = None,
|
|
285
|
-
timeout: t.Optional[t.Union[
|
|
287
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
286
288
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
287
289
|
) -> ObjectApiResponse[t.Any]:
|
|
288
290
|
"""
|
|
289
|
-
Reloads
|
|
291
|
+
Reloads the keystore on nodes in the cluster.
|
|
290
292
|
|
|
291
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
293
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/secure-settings.html#reloadable-secure-settings>`_
|
|
292
294
|
|
|
293
295
|
:param node_id: The names of particular nodes in the cluster to target.
|
|
294
296
|
:param secure_settings_password: The password for the Elasticsearch keystore.
|
|
@@ -349,19 +351,17 @@ class NodesClient(NamespacedClient):
|
|
|
349
351
|
include_segment_file_sizes: t.Optional[bool] = None,
|
|
350
352
|
include_unloaded_segments: t.Optional[bool] = None,
|
|
351
353
|
level: t.Optional[
|
|
352
|
-
t.Union[
|
|
353
|
-
] = None,
|
|
354
|
-
master_timeout: t.Optional[
|
|
355
|
-
t.Union["t.Literal[-1]", "t.Literal[0]", str]
|
|
354
|
+
t.Union[str, t.Literal["cluster", "indices", "shards"]]
|
|
356
355
|
] = None,
|
|
356
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
357
357
|
pretty: t.Optional[bool] = None,
|
|
358
|
-
timeout: t.Optional[t.Union[
|
|
358
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
359
359
|
types: t.Optional[t.Sequence[str]] = None,
|
|
360
360
|
) -> ObjectApiResponse[t.Any]:
|
|
361
361
|
"""
|
|
362
|
-
Returns
|
|
362
|
+
Returns cluster nodes statistics.
|
|
363
363
|
|
|
364
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
364
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/cluster-nodes-stats.html>`_
|
|
365
365
|
|
|
366
366
|
:param node_id: Comma-separated list of node IDs or names used to limit returned
|
|
367
367
|
information.
|
|
@@ -473,12 +473,12 @@ class NodesClient(NamespacedClient):
|
|
|
473
473
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
474
474
|
human: t.Optional[bool] = None,
|
|
475
475
|
pretty: t.Optional[bool] = None,
|
|
476
|
-
timeout: t.Optional[t.Union[
|
|
476
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
477
477
|
) -> ObjectApiResponse[t.Any]:
|
|
478
478
|
"""
|
|
479
|
-
Returns
|
|
479
|
+
Returns information on the usage of features.
|
|
480
480
|
|
|
481
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
481
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/cluster-nodes-usage.html>`_
|
|
482
482
|
|
|
483
483
|
:param node_id: A comma-separated list of node IDs or names to limit the returned
|
|
484
484
|
information; use `_local` to return information from the node you're connecting
|
|
@@ -0,0 +1,384 @@
|
|
|
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 QueryRulesClient(NamespacedClient):
|
|
27
|
+
|
|
28
|
+
@_rewrite_parameters()
|
|
29
|
+
def delete_rule(
|
|
30
|
+
self,
|
|
31
|
+
*,
|
|
32
|
+
ruleset_id: str,
|
|
33
|
+
rule_id: str,
|
|
34
|
+
error_trace: t.Optional[bool] = None,
|
|
35
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
36
|
+
human: t.Optional[bool] = None,
|
|
37
|
+
pretty: t.Optional[bool] = None,
|
|
38
|
+
) -> ObjectApiResponse[t.Any]:
|
|
39
|
+
"""
|
|
40
|
+
Deletes a query rule within a query ruleset.
|
|
41
|
+
|
|
42
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/delete-query-rule.html>`_
|
|
43
|
+
|
|
44
|
+
:param ruleset_id: The unique identifier of the query ruleset containing the
|
|
45
|
+
rule to delete
|
|
46
|
+
:param rule_id: The unique identifier of the query rule within the specified
|
|
47
|
+
ruleset to delete
|
|
48
|
+
"""
|
|
49
|
+
if ruleset_id in SKIP_IN_PATH:
|
|
50
|
+
raise ValueError("Empty value passed for parameter 'ruleset_id'")
|
|
51
|
+
if rule_id in SKIP_IN_PATH:
|
|
52
|
+
raise ValueError("Empty value passed for parameter 'rule_id'")
|
|
53
|
+
__path_parts: t.Dict[str, str] = {
|
|
54
|
+
"ruleset_id": _quote(ruleset_id),
|
|
55
|
+
"rule_id": _quote(rule_id),
|
|
56
|
+
}
|
|
57
|
+
__path = f'/_query_rules/{__path_parts["ruleset_id"]}/_rule/{__path_parts["rule_id"]}'
|
|
58
|
+
__query: t.Dict[str, t.Any] = {}
|
|
59
|
+
if error_trace is not None:
|
|
60
|
+
__query["error_trace"] = error_trace
|
|
61
|
+
if filter_path is not None:
|
|
62
|
+
__query["filter_path"] = filter_path
|
|
63
|
+
if human is not None:
|
|
64
|
+
__query["human"] = human
|
|
65
|
+
if pretty is not None:
|
|
66
|
+
__query["pretty"] = pretty
|
|
67
|
+
__headers = {"accept": "application/json"}
|
|
68
|
+
return self.perform_request( # type: ignore[return-value]
|
|
69
|
+
"DELETE",
|
|
70
|
+
__path,
|
|
71
|
+
params=__query,
|
|
72
|
+
headers=__headers,
|
|
73
|
+
endpoint_id="query_rules.delete_rule",
|
|
74
|
+
path_parts=__path_parts,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
@_rewrite_parameters()
|
|
78
|
+
def delete_ruleset(
|
|
79
|
+
self,
|
|
80
|
+
*,
|
|
81
|
+
ruleset_id: str,
|
|
82
|
+
error_trace: t.Optional[bool] = None,
|
|
83
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
84
|
+
human: t.Optional[bool] = None,
|
|
85
|
+
pretty: t.Optional[bool] = None,
|
|
86
|
+
) -> ObjectApiResponse[t.Any]:
|
|
87
|
+
"""
|
|
88
|
+
Deletes a query ruleset.
|
|
89
|
+
|
|
90
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/delete-query-ruleset.html>`_
|
|
91
|
+
|
|
92
|
+
:param ruleset_id: The unique identifier of the query ruleset to delete
|
|
93
|
+
"""
|
|
94
|
+
if ruleset_id in SKIP_IN_PATH:
|
|
95
|
+
raise ValueError("Empty value passed for parameter 'ruleset_id'")
|
|
96
|
+
__path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)}
|
|
97
|
+
__path = f'/_query_rules/{__path_parts["ruleset_id"]}'
|
|
98
|
+
__query: t.Dict[str, t.Any] = {}
|
|
99
|
+
if error_trace is not None:
|
|
100
|
+
__query["error_trace"] = error_trace
|
|
101
|
+
if filter_path is not None:
|
|
102
|
+
__query["filter_path"] = filter_path
|
|
103
|
+
if human is not None:
|
|
104
|
+
__query["human"] = human
|
|
105
|
+
if pretty is not None:
|
|
106
|
+
__query["pretty"] = pretty
|
|
107
|
+
__headers = {"accept": "application/json"}
|
|
108
|
+
return self.perform_request( # type: ignore[return-value]
|
|
109
|
+
"DELETE",
|
|
110
|
+
__path,
|
|
111
|
+
params=__query,
|
|
112
|
+
headers=__headers,
|
|
113
|
+
endpoint_id="query_rules.delete_ruleset",
|
|
114
|
+
path_parts=__path_parts,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
@_rewrite_parameters()
|
|
118
|
+
def get_rule(
|
|
119
|
+
self,
|
|
120
|
+
*,
|
|
121
|
+
ruleset_id: str,
|
|
122
|
+
rule_id: str,
|
|
123
|
+
error_trace: t.Optional[bool] = None,
|
|
124
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
125
|
+
human: t.Optional[bool] = None,
|
|
126
|
+
pretty: t.Optional[bool] = None,
|
|
127
|
+
) -> ObjectApiResponse[t.Any]:
|
|
128
|
+
"""
|
|
129
|
+
Returns the details about a query rule within a query ruleset
|
|
130
|
+
|
|
131
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/get-query-rule.html>`_
|
|
132
|
+
|
|
133
|
+
:param ruleset_id: The unique identifier of the query ruleset containing the
|
|
134
|
+
rule to retrieve
|
|
135
|
+
:param rule_id: The unique identifier of the query rule within the specified
|
|
136
|
+
ruleset to retrieve
|
|
137
|
+
"""
|
|
138
|
+
if ruleset_id in SKIP_IN_PATH:
|
|
139
|
+
raise ValueError("Empty value passed for parameter 'ruleset_id'")
|
|
140
|
+
if rule_id in SKIP_IN_PATH:
|
|
141
|
+
raise ValueError("Empty value passed for parameter 'rule_id'")
|
|
142
|
+
__path_parts: t.Dict[str, str] = {
|
|
143
|
+
"ruleset_id": _quote(ruleset_id),
|
|
144
|
+
"rule_id": _quote(rule_id),
|
|
145
|
+
}
|
|
146
|
+
__path = f'/_query_rules/{__path_parts["ruleset_id"]}/_rule/{__path_parts["rule_id"]}'
|
|
147
|
+
__query: t.Dict[str, t.Any] = {}
|
|
148
|
+
if error_trace is not None:
|
|
149
|
+
__query["error_trace"] = error_trace
|
|
150
|
+
if filter_path is not None:
|
|
151
|
+
__query["filter_path"] = filter_path
|
|
152
|
+
if human is not None:
|
|
153
|
+
__query["human"] = human
|
|
154
|
+
if pretty is not None:
|
|
155
|
+
__query["pretty"] = pretty
|
|
156
|
+
__headers = {"accept": "application/json"}
|
|
157
|
+
return self.perform_request( # type: ignore[return-value]
|
|
158
|
+
"GET",
|
|
159
|
+
__path,
|
|
160
|
+
params=__query,
|
|
161
|
+
headers=__headers,
|
|
162
|
+
endpoint_id="query_rules.get_rule",
|
|
163
|
+
path_parts=__path_parts,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
@_rewrite_parameters()
|
|
167
|
+
def get_ruleset(
|
|
168
|
+
self,
|
|
169
|
+
*,
|
|
170
|
+
ruleset_id: str,
|
|
171
|
+
error_trace: t.Optional[bool] = None,
|
|
172
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
173
|
+
human: t.Optional[bool] = None,
|
|
174
|
+
pretty: t.Optional[bool] = None,
|
|
175
|
+
) -> ObjectApiResponse[t.Any]:
|
|
176
|
+
"""
|
|
177
|
+
Returns the details about a query ruleset
|
|
178
|
+
|
|
179
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/get-query-ruleset.html>`_
|
|
180
|
+
|
|
181
|
+
:param ruleset_id: The unique identifier of the query ruleset
|
|
182
|
+
"""
|
|
183
|
+
if ruleset_id in SKIP_IN_PATH:
|
|
184
|
+
raise ValueError("Empty value passed for parameter 'ruleset_id'")
|
|
185
|
+
__path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)}
|
|
186
|
+
__path = f'/_query_rules/{__path_parts["ruleset_id"]}'
|
|
187
|
+
__query: t.Dict[str, t.Any] = {}
|
|
188
|
+
if error_trace is not None:
|
|
189
|
+
__query["error_trace"] = error_trace
|
|
190
|
+
if filter_path is not None:
|
|
191
|
+
__query["filter_path"] = filter_path
|
|
192
|
+
if human is not None:
|
|
193
|
+
__query["human"] = human
|
|
194
|
+
if pretty is not None:
|
|
195
|
+
__query["pretty"] = pretty
|
|
196
|
+
__headers = {"accept": "application/json"}
|
|
197
|
+
return self.perform_request( # type: ignore[return-value]
|
|
198
|
+
"GET",
|
|
199
|
+
__path,
|
|
200
|
+
params=__query,
|
|
201
|
+
headers=__headers,
|
|
202
|
+
endpoint_id="query_rules.get_ruleset",
|
|
203
|
+
path_parts=__path_parts,
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
@_rewrite_parameters(
|
|
207
|
+
parameter_aliases={"from": "from_"},
|
|
208
|
+
)
|
|
209
|
+
def list_rulesets(
|
|
210
|
+
self,
|
|
211
|
+
*,
|
|
212
|
+
error_trace: t.Optional[bool] = None,
|
|
213
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
214
|
+
from_: t.Optional[int] = None,
|
|
215
|
+
human: t.Optional[bool] = None,
|
|
216
|
+
pretty: t.Optional[bool] = None,
|
|
217
|
+
size: t.Optional[int] = None,
|
|
218
|
+
) -> ObjectApiResponse[t.Any]:
|
|
219
|
+
"""
|
|
220
|
+
Returns summarized information about existing query rulesets.
|
|
221
|
+
|
|
222
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/list-query-rulesets.html>`_
|
|
223
|
+
|
|
224
|
+
:param from_: Starting offset (default: 0)
|
|
225
|
+
:param size: specifies a max number of results to get
|
|
226
|
+
"""
|
|
227
|
+
__path_parts: t.Dict[str, str] = {}
|
|
228
|
+
__path = "/_query_rules"
|
|
229
|
+
__query: t.Dict[str, t.Any] = {}
|
|
230
|
+
if error_trace is not None:
|
|
231
|
+
__query["error_trace"] = error_trace
|
|
232
|
+
if filter_path is not None:
|
|
233
|
+
__query["filter_path"] = filter_path
|
|
234
|
+
if from_ is not None:
|
|
235
|
+
__query["from"] = from_
|
|
236
|
+
if human is not None:
|
|
237
|
+
__query["human"] = human
|
|
238
|
+
if pretty is not None:
|
|
239
|
+
__query["pretty"] = pretty
|
|
240
|
+
if size is not None:
|
|
241
|
+
__query["size"] = size
|
|
242
|
+
__headers = {"accept": "application/json"}
|
|
243
|
+
return self.perform_request( # type: ignore[return-value]
|
|
244
|
+
"GET",
|
|
245
|
+
__path,
|
|
246
|
+
params=__query,
|
|
247
|
+
headers=__headers,
|
|
248
|
+
endpoint_id="query_rules.list_rulesets",
|
|
249
|
+
path_parts=__path_parts,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
@_rewrite_parameters(
|
|
253
|
+
body_fields=("actions", "criteria", "type", "priority"),
|
|
254
|
+
)
|
|
255
|
+
def put_rule(
|
|
256
|
+
self,
|
|
257
|
+
*,
|
|
258
|
+
ruleset_id: str,
|
|
259
|
+
rule_id: str,
|
|
260
|
+
actions: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
261
|
+
criteria: t.Optional[
|
|
262
|
+
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
|
|
263
|
+
] = None,
|
|
264
|
+
type: t.Optional[t.Union[str, t.Literal["pinned"]]] = None,
|
|
265
|
+
error_trace: t.Optional[bool] = None,
|
|
266
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
267
|
+
human: t.Optional[bool] = None,
|
|
268
|
+
pretty: t.Optional[bool] = None,
|
|
269
|
+
priority: t.Optional[int] = None,
|
|
270
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
271
|
+
) -> ObjectApiResponse[t.Any]:
|
|
272
|
+
"""
|
|
273
|
+
Creates or updates a query rule within a query ruleset.
|
|
274
|
+
|
|
275
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/put-query-rule.html>`_
|
|
276
|
+
|
|
277
|
+
:param ruleset_id: The unique identifier of the query ruleset containing the
|
|
278
|
+
rule to be created or updated
|
|
279
|
+
:param rule_id: The unique identifier of the query rule within the specified
|
|
280
|
+
ruleset to be created or updated
|
|
281
|
+
:param actions:
|
|
282
|
+
:param criteria:
|
|
283
|
+
:param type:
|
|
284
|
+
:param priority:
|
|
285
|
+
"""
|
|
286
|
+
if ruleset_id in SKIP_IN_PATH:
|
|
287
|
+
raise ValueError("Empty value passed for parameter 'ruleset_id'")
|
|
288
|
+
if rule_id in SKIP_IN_PATH:
|
|
289
|
+
raise ValueError("Empty value passed for parameter 'rule_id'")
|
|
290
|
+
if actions is None and body is None:
|
|
291
|
+
raise ValueError("Empty value passed for parameter 'actions'")
|
|
292
|
+
if criteria is None and body is None:
|
|
293
|
+
raise ValueError("Empty value passed for parameter 'criteria'")
|
|
294
|
+
if type is None and body is None:
|
|
295
|
+
raise ValueError("Empty value passed for parameter 'type'")
|
|
296
|
+
__path_parts: t.Dict[str, str] = {
|
|
297
|
+
"ruleset_id": _quote(ruleset_id),
|
|
298
|
+
"rule_id": _quote(rule_id),
|
|
299
|
+
}
|
|
300
|
+
__path = f'/_query_rules/{__path_parts["ruleset_id"]}/_rule/{__path_parts["rule_id"]}'
|
|
301
|
+
__query: t.Dict[str, t.Any] = {}
|
|
302
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
303
|
+
if error_trace is not None:
|
|
304
|
+
__query["error_trace"] = error_trace
|
|
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 pretty is not None:
|
|
310
|
+
__query["pretty"] = pretty
|
|
311
|
+
if not __body:
|
|
312
|
+
if actions is not None:
|
|
313
|
+
__body["actions"] = actions
|
|
314
|
+
if criteria is not None:
|
|
315
|
+
__body["criteria"] = criteria
|
|
316
|
+
if type is not None:
|
|
317
|
+
__body["type"] = type
|
|
318
|
+
if priority is not None:
|
|
319
|
+
__body["priority"] = priority
|
|
320
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
321
|
+
return self.perform_request( # type: ignore[return-value]
|
|
322
|
+
"PUT",
|
|
323
|
+
__path,
|
|
324
|
+
params=__query,
|
|
325
|
+
headers=__headers,
|
|
326
|
+
body=__body,
|
|
327
|
+
endpoint_id="query_rules.put_rule",
|
|
328
|
+
path_parts=__path_parts,
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
@_rewrite_parameters(
|
|
332
|
+
body_fields=("rules",),
|
|
333
|
+
)
|
|
334
|
+
def put_ruleset(
|
|
335
|
+
self,
|
|
336
|
+
*,
|
|
337
|
+
ruleset_id: str,
|
|
338
|
+
rules: t.Optional[
|
|
339
|
+
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
|
|
340
|
+
] = None,
|
|
341
|
+
error_trace: t.Optional[bool] = None,
|
|
342
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
343
|
+
human: t.Optional[bool] = None,
|
|
344
|
+
pretty: t.Optional[bool] = None,
|
|
345
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
346
|
+
) -> ObjectApiResponse[t.Any]:
|
|
347
|
+
"""
|
|
348
|
+
Creates or updates a query ruleset.
|
|
349
|
+
|
|
350
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/put-query-ruleset.html>`_
|
|
351
|
+
|
|
352
|
+
:param ruleset_id: The unique identifier of the query ruleset to be created or
|
|
353
|
+
updated
|
|
354
|
+
:param rules:
|
|
355
|
+
"""
|
|
356
|
+
if ruleset_id in SKIP_IN_PATH:
|
|
357
|
+
raise ValueError("Empty value passed for parameter 'ruleset_id'")
|
|
358
|
+
if rules is None and body is None:
|
|
359
|
+
raise ValueError("Empty value passed for parameter 'rules'")
|
|
360
|
+
__path_parts: t.Dict[str, str] = {"ruleset_id": _quote(ruleset_id)}
|
|
361
|
+
__path = f'/_query_rules/{__path_parts["ruleset_id"]}'
|
|
362
|
+
__query: t.Dict[str, t.Any] = {}
|
|
363
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
364
|
+
if error_trace is not None:
|
|
365
|
+
__query["error_trace"] = error_trace
|
|
366
|
+
if filter_path is not None:
|
|
367
|
+
__query["filter_path"] = filter_path
|
|
368
|
+
if human is not None:
|
|
369
|
+
__query["human"] = human
|
|
370
|
+
if pretty is not None:
|
|
371
|
+
__query["pretty"] = pretty
|
|
372
|
+
if not __body:
|
|
373
|
+
if rules is not None:
|
|
374
|
+
__body["rules"] = rules
|
|
375
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
376
|
+
return self.perform_request( # type: ignore[return-value]
|
|
377
|
+
"PUT",
|
|
378
|
+
__path,
|
|
379
|
+
params=__query,
|
|
380
|
+
headers=__headers,
|
|
381
|
+
body=__body,
|
|
382
|
+
endpoint_id="query_rules.put_ruleset",
|
|
383
|
+
path_parts=__path_parts,
|
|
384
|
+
)
|
|
@@ -38,7 +38,7 @@ class RollupClient(NamespacedClient):
|
|
|
38
38
|
"""
|
|
39
39
|
Deletes an existing rollup job.
|
|
40
40
|
|
|
41
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
41
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-delete-job.html>`_
|
|
42
42
|
|
|
43
43
|
:param id: Identifier for the job.
|
|
44
44
|
"""
|
|
@@ -78,7 +78,7 @@ class RollupClient(NamespacedClient):
|
|
|
78
78
|
"""
|
|
79
79
|
Retrieves the configuration, stats, and status of rollup jobs.
|
|
80
80
|
|
|
81
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
81
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-get-job.html>`_
|
|
82
82
|
|
|
83
83
|
:param id: Identifier for the rollup job. If it is `_all` or omitted, the API
|
|
84
84
|
returns all rollup jobs.
|
|
@@ -123,7 +123,7 @@ class RollupClient(NamespacedClient):
|
|
|
123
123
|
Returns the capabilities of any rollup jobs that have been configured for a specific
|
|
124
124
|
index or index pattern.
|
|
125
125
|
|
|
126
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
126
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-get-rollup-caps.html>`_
|
|
127
127
|
|
|
128
128
|
:param id: Index, indices or index-pattern to return rollup capabilities for.
|
|
129
129
|
`_all` may be used to fetch rollup capabilities from all jobs.
|
|
@@ -165,10 +165,10 @@ class RollupClient(NamespacedClient):
|
|
|
165
165
|
pretty: t.Optional[bool] = None,
|
|
166
166
|
) -> ObjectApiResponse[t.Any]:
|
|
167
167
|
"""
|
|
168
|
-
Returns the rollup capabilities of all jobs inside of a rollup index (
|
|
169
|
-
index where rollup data is stored).
|
|
168
|
+
Returns the rollup capabilities of all jobs inside of a rollup index (for example,
|
|
169
|
+
the index where rollup data is stored).
|
|
170
170
|
|
|
171
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
171
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-get-rollup-index-caps.html>`_
|
|
172
172
|
|
|
173
173
|
:param index: Data stream or index to check for rollup capabilities. Wildcard
|
|
174
174
|
(`*`) expressions are supported.
|
|
@@ -224,13 +224,13 @@ class RollupClient(NamespacedClient):
|
|
|
224
224
|
human: t.Optional[bool] = None,
|
|
225
225
|
metrics: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
226
226
|
pretty: t.Optional[bool] = None,
|
|
227
|
-
timeout: t.Optional[t.Union[
|
|
227
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
228
228
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
229
229
|
) -> ObjectApiResponse[t.Any]:
|
|
230
230
|
"""
|
|
231
231
|
Creates a rollup job.
|
|
232
232
|
|
|
233
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
233
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-put-job.html>`_
|
|
234
234
|
|
|
235
235
|
:param id: Identifier for the rollup job. This can be any alphanumeric string
|
|
236
236
|
and uniquely identifies the data that is associated with the rollup job.
|
|
@@ -344,9 +344,9 @@ class RollupClient(NamespacedClient):
|
|
|
344
344
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
345
345
|
) -> ObjectApiResponse[t.Any]:
|
|
346
346
|
"""
|
|
347
|
-
Enables searching rolled-up data using the standard
|
|
347
|
+
Enables searching rolled-up data using the standard Query DSL.
|
|
348
348
|
|
|
349
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
349
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-search.html>`_
|
|
350
350
|
|
|
351
351
|
:param index: Enables searching rolled-up data using the standard Query DSL.
|
|
352
352
|
:param aggregations: Specifies aggregations.
|
|
@@ -409,7 +409,7 @@ class RollupClient(NamespacedClient):
|
|
|
409
409
|
"""
|
|
410
410
|
Starts an existing, stopped rollup job.
|
|
411
411
|
|
|
412
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
412
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-start-job.html>`_
|
|
413
413
|
|
|
414
414
|
:param id: Identifier for the rollup job.
|
|
415
415
|
"""
|
|
@@ -445,13 +445,13 @@ class RollupClient(NamespacedClient):
|
|
|
445
445
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
446
446
|
human: t.Optional[bool] = None,
|
|
447
447
|
pretty: t.Optional[bool] = None,
|
|
448
|
-
timeout: t.Optional[t.Union[
|
|
448
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
449
449
|
wait_for_completion: t.Optional[bool] = None,
|
|
450
450
|
) -> ObjectApiResponse[t.Any]:
|
|
451
451
|
"""
|
|
452
452
|
Stops an existing, started rollup job.
|
|
453
453
|
|
|
454
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
454
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.15/rollup-stop-job.html>`_
|
|
455
455
|
|
|
456
456
|
:param id: Identifier for the rollup job.
|
|
457
457
|
:param timeout: If `wait_for_completion` is `true`, the API blocks for (at maximum)
|