elasticsearch 8.11.1__py3-none-any.whl → 8.12.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 +493 -347
- elasticsearch/_async/client/async_search.py +108 -72
- elasticsearch/_async/client/autoscaling.py +13 -8
- elasticsearch/_async/client/cat.py +26 -26
- elasticsearch/_async/client/ccr.py +178 -117
- elasticsearch/_async/client/cluster.py +56 -48
- elasticsearch/_async/client/dangling_indices.py +3 -3
- elasticsearch/_async/client/enrich.py +15 -13
- elasticsearch/_async/client/eql.py +53 -36
- elasticsearch/_async/client/esql.py +99 -0
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +111 -71
- elasticsearch/_async/client/graph.py +13 -11
- elasticsearch/_async/client/ilm.py +33 -27
- elasticsearch/_async/client/indices.py +326 -227
- elasticsearch/_async/client/inference.py +212 -0
- elasticsearch/_async/client/ingest.py +28 -24
- elasticsearch/_async/client/license.py +15 -13
- elasticsearch/_async/client/logstash.py +13 -10
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +758 -538
- elasticsearch/_async/client/monitoring.py +10 -5
- elasticsearch/_async/client/nodes.py +13 -11
- elasticsearch/_async/client/query_ruleset.py +12 -10
- elasticsearch/_async/client/rollup.py +59 -46
- elasticsearch/_async/client/search_application.py +23 -16
- elasticsearch/_async/client/searchable_snapshots.py +23 -16
- elasticsearch/_async/client/security.py +391 -289
- elasticsearch/_async/client/shutdown.py +18 -14
- elasticsearch/_async/client/slm.py +23 -21
- elasticsearch/_async/client/snapshot.py +91 -65
- elasticsearch/_async/client/sql.py +81 -58
- elasticsearch/_async/client/ssl.py +1 -1
- elasticsearch/_async/client/synonyms.py +23 -19
- elasticsearch/_async/client/tasks.py +3 -3
- elasticsearch/_async/client/text_structure.py +10 -5
- elasticsearch/_async/client/transform.py +111 -75
- elasticsearch/_async/client/watcher.py +77 -55
- elasticsearch/_async/client/xpack.py +2 -2
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_sync/client/__init__.py +493 -347
- elasticsearch/_sync/client/async_search.py +108 -72
- elasticsearch/_sync/client/autoscaling.py +13 -8
- elasticsearch/_sync/client/cat.py +26 -26
- elasticsearch/_sync/client/ccr.py +178 -117
- elasticsearch/_sync/client/cluster.py +56 -48
- elasticsearch/_sync/client/dangling_indices.py +3 -3
- elasticsearch/_sync/client/enrich.py +15 -13
- elasticsearch/_sync/client/eql.py +53 -36
- elasticsearch/_sync/client/esql.py +99 -0
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +111 -71
- elasticsearch/_sync/client/graph.py +13 -11
- elasticsearch/_sync/client/ilm.py +33 -27
- elasticsearch/_sync/client/indices.py +326 -227
- elasticsearch/_sync/client/inference.py +212 -0
- elasticsearch/_sync/client/ingest.py +28 -24
- elasticsearch/_sync/client/license.py +15 -13
- elasticsearch/_sync/client/logstash.py +13 -10
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +758 -538
- elasticsearch/_sync/client/monitoring.py +10 -5
- elasticsearch/_sync/client/nodes.py +13 -11
- elasticsearch/_sync/client/query_ruleset.py +12 -10
- elasticsearch/_sync/client/rollup.py +59 -46
- elasticsearch/_sync/client/search_application.py +23 -16
- elasticsearch/_sync/client/searchable_snapshots.py +23 -16
- elasticsearch/_sync/client/security.py +391 -289
- elasticsearch/_sync/client/shutdown.py +18 -14
- elasticsearch/_sync/client/slm.py +23 -21
- elasticsearch/_sync/client/snapshot.py +91 -65
- elasticsearch/_sync/client/sql.py +81 -58
- elasticsearch/_sync/client/ssl.py +1 -1
- elasticsearch/_sync/client/synonyms.py +23 -19
- elasticsearch/_sync/client/tasks.py +3 -3
- elasticsearch/_sync/client/text_structure.py +10 -5
- elasticsearch/_sync/client/transform.py +111 -75
- elasticsearch/_sync/client/utils.py +34 -10
- elasticsearch/_sync/client/watcher.py +77 -55
- elasticsearch/_sync/client/xpack.py +2 -2
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- elasticsearch/helpers/actions.py +1 -1
- {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/METADATA +2 -3
- elasticsearch-8.12.0.dist-info/RECORD +103 -0
- elasticsearch-8.11.1.dist-info/RECORD +0 -99
- {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/LICENSE +0 -0
- {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/NOTICE +0 -0
- {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,212 @@
|
|
|
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 InferenceClient(NamespacedClient):
|
|
27
|
+
@_rewrite_parameters()
|
|
28
|
+
def delete_model(
|
|
29
|
+
self,
|
|
30
|
+
*,
|
|
31
|
+
task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str],
|
|
32
|
+
model_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
|
+
Delete model in the Inference API
|
|
40
|
+
|
|
41
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-inference-api.html>`_
|
|
42
|
+
|
|
43
|
+
:param task_type: The model task type
|
|
44
|
+
:param model_id: The unique identifier of the inference model.
|
|
45
|
+
"""
|
|
46
|
+
if task_type in SKIP_IN_PATH:
|
|
47
|
+
raise ValueError("Empty value passed for parameter 'task_type'")
|
|
48
|
+
if model_id in SKIP_IN_PATH:
|
|
49
|
+
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
50
|
+
__path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}"
|
|
51
|
+
__query: t.Dict[str, t.Any] = {}
|
|
52
|
+
if error_trace is not None:
|
|
53
|
+
__query["error_trace"] = error_trace
|
|
54
|
+
if filter_path is not None:
|
|
55
|
+
__query["filter_path"] = filter_path
|
|
56
|
+
if human is not None:
|
|
57
|
+
__query["human"] = human
|
|
58
|
+
if pretty is not None:
|
|
59
|
+
__query["pretty"] = pretty
|
|
60
|
+
__headers = {"accept": "application/json"}
|
|
61
|
+
return self.perform_request( # type: ignore[return-value]
|
|
62
|
+
"DELETE", __path, params=__query, headers=__headers
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
@_rewrite_parameters()
|
|
66
|
+
def get_model(
|
|
67
|
+
self,
|
|
68
|
+
*,
|
|
69
|
+
task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str],
|
|
70
|
+
model_id: str,
|
|
71
|
+
error_trace: t.Optional[bool] = None,
|
|
72
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
73
|
+
human: t.Optional[bool] = None,
|
|
74
|
+
pretty: t.Optional[bool] = None,
|
|
75
|
+
) -> ObjectApiResponse[t.Any]:
|
|
76
|
+
"""
|
|
77
|
+
Get a model in the Inference API
|
|
78
|
+
|
|
79
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-inference-api.html>`_
|
|
80
|
+
|
|
81
|
+
:param task_type: The model task type
|
|
82
|
+
:param model_id: The unique identifier of the inference model.
|
|
83
|
+
"""
|
|
84
|
+
if task_type in SKIP_IN_PATH:
|
|
85
|
+
raise ValueError("Empty value passed for parameter 'task_type'")
|
|
86
|
+
if model_id in SKIP_IN_PATH:
|
|
87
|
+
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
88
|
+
__path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}"
|
|
89
|
+
__query: t.Dict[str, t.Any] = {}
|
|
90
|
+
if error_trace is not None:
|
|
91
|
+
__query["error_trace"] = error_trace
|
|
92
|
+
if filter_path is not None:
|
|
93
|
+
__query["filter_path"] = filter_path
|
|
94
|
+
if human is not None:
|
|
95
|
+
__query["human"] = human
|
|
96
|
+
if pretty is not None:
|
|
97
|
+
__query["pretty"] = pretty
|
|
98
|
+
__headers = {"accept": "application/json"}
|
|
99
|
+
return self.perform_request( # type: ignore[return-value]
|
|
100
|
+
"GET", __path, params=__query, headers=__headers
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
@_rewrite_parameters(
|
|
104
|
+
body_fields=("input", "task_settings"),
|
|
105
|
+
)
|
|
106
|
+
def inference(
|
|
107
|
+
self,
|
|
108
|
+
*,
|
|
109
|
+
task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str],
|
|
110
|
+
model_id: str,
|
|
111
|
+
input: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
112
|
+
error_trace: t.Optional[bool] = None,
|
|
113
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
114
|
+
human: t.Optional[bool] = None,
|
|
115
|
+
pretty: t.Optional[bool] = None,
|
|
116
|
+
task_settings: t.Optional[t.Any] = None,
|
|
117
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
118
|
+
) -> ObjectApiResponse[t.Any]:
|
|
119
|
+
"""
|
|
120
|
+
Perform inference on a model
|
|
121
|
+
|
|
122
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/post-inference-api.html>`_
|
|
123
|
+
|
|
124
|
+
:param task_type: The model task type
|
|
125
|
+
:param model_id: The unique identifier of the inference model.
|
|
126
|
+
:param input: Text input to the model. Either a string or an array of strings.
|
|
127
|
+
:param task_settings: Optional task settings
|
|
128
|
+
"""
|
|
129
|
+
if task_type in SKIP_IN_PATH:
|
|
130
|
+
raise ValueError("Empty value passed for parameter 'task_type'")
|
|
131
|
+
if model_id in SKIP_IN_PATH:
|
|
132
|
+
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
133
|
+
if input is None and body is None:
|
|
134
|
+
raise ValueError("Empty value passed for parameter 'input'")
|
|
135
|
+
__path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}"
|
|
136
|
+
__query: t.Dict[str, t.Any] = {}
|
|
137
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
138
|
+
if error_trace is not None:
|
|
139
|
+
__query["error_trace"] = error_trace
|
|
140
|
+
if filter_path is not None:
|
|
141
|
+
__query["filter_path"] = filter_path
|
|
142
|
+
if human is not None:
|
|
143
|
+
__query["human"] = human
|
|
144
|
+
if pretty is not None:
|
|
145
|
+
__query["pretty"] = pretty
|
|
146
|
+
if not __body:
|
|
147
|
+
if input is not None:
|
|
148
|
+
__body["input"] = input
|
|
149
|
+
if task_settings is not None:
|
|
150
|
+
__body["task_settings"] = task_settings
|
|
151
|
+
if not __body:
|
|
152
|
+
__body = None # type: ignore[assignment]
|
|
153
|
+
__headers = {"accept": "application/json"}
|
|
154
|
+
if __body is not None:
|
|
155
|
+
__headers["content-type"] = "application/json"
|
|
156
|
+
return self.perform_request( # type: ignore[return-value]
|
|
157
|
+
"POST", __path, params=__query, headers=__headers, body=__body
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
@_rewrite_parameters(
|
|
161
|
+
body_name="model_config",
|
|
162
|
+
)
|
|
163
|
+
def put_model(
|
|
164
|
+
self,
|
|
165
|
+
*,
|
|
166
|
+
task_type: t.Union["t.Literal['sparse_embedding', 'text_embedding']", str],
|
|
167
|
+
model_id: str,
|
|
168
|
+
error_trace: t.Optional[bool] = None,
|
|
169
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
170
|
+
human: t.Optional[bool] = None,
|
|
171
|
+
model_config: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
172
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
173
|
+
pretty: t.Optional[bool] = None,
|
|
174
|
+
) -> ObjectApiResponse[t.Any]:
|
|
175
|
+
"""
|
|
176
|
+
Configure a model for use in the Inference API
|
|
177
|
+
|
|
178
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-inference-api.html>`_
|
|
179
|
+
|
|
180
|
+
:param task_type: The model task type
|
|
181
|
+
:param model_id: The unique identifier of the inference model.
|
|
182
|
+
:param model_config:
|
|
183
|
+
"""
|
|
184
|
+
if task_type in SKIP_IN_PATH:
|
|
185
|
+
raise ValueError("Empty value passed for parameter 'task_type'")
|
|
186
|
+
if model_id in SKIP_IN_PATH:
|
|
187
|
+
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
188
|
+
if model_config is None and body is None:
|
|
189
|
+
raise ValueError(
|
|
190
|
+
"Empty value passed for parameters 'model_config' and 'body', one of them should be set."
|
|
191
|
+
)
|
|
192
|
+
elif model_config is not None and body is not None:
|
|
193
|
+
raise ValueError("Cannot set both 'model_config' and 'body'")
|
|
194
|
+
__path = f"/_inference/{_quote(task_type)}/{_quote(model_id)}"
|
|
195
|
+
__query: t.Dict[str, t.Any] = {}
|
|
196
|
+
if error_trace is not None:
|
|
197
|
+
__query["error_trace"] = error_trace
|
|
198
|
+
if filter_path is not None:
|
|
199
|
+
__query["filter_path"] = filter_path
|
|
200
|
+
if human is not None:
|
|
201
|
+
__query["human"] = human
|
|
202
|
+
if pretty is not None:
|
|
203
|
+
__query["pretty"] = pretty
|
|
204
|
+
__body = model_config if model_config is not None else body
|
|
205
|
+
if not __body:
|
|
206
|
+
__body = None
|
|
207
|
+
__headers = {"accept": "application/json"}
|
|
208
|
+
if __body is not None:
|
|
209
|
+
__headers["content-type"] = "application/json"
|
|
210
|
+
return self.perform_request( # type: ignore[return-value]
|
|
211
|
+
"PUT", __path, params=__query, headers=__headers, body=__body
|
|
212
|
+
)
|
|
@@ -41,7 +41,7 @@ class IngestClient(NamespacedClient):
|
|
|
41
41
|
"""
|
|
42
42
|
Deletes a pipeline.
|
|
43
43
|
|
|
44
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
44
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-pipeline-api.html>`_
|
|
45
45
|
|
|
46
46
|
:param id: Pipeline ID or wildcard expression of pipeline IDs used to limit the
|
|
47
47
|
request. To delete all ingest pipelines in a cluster, use a value of `*`.
|
|
@@ -84,7 +84,7 @@ class IngestClient(NamespacedClient):
|
|
|
84
84
|
"""
|
|
85
85
|
Returns statistical information about geoip databases
|
|
86
86
|
|
|
87
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
87
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/geoip-processor.html>`_
|
|
88
88
|
"""
|
|
89
89
|
__path = "/_ingest/geoip/stats"
|
|
90
90
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -118,7 +118,7 @@ class IngestClient(NamespacedClient):
|
|
|
118
118
|
"""
|
|
119
119
|
Returns a pipeline.
|
|
120
120
|
|
|
121
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
121
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-pipeline-api.html>`_
|
|
122
122
|
|
|
123
123
|
:param id: Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions
|
|
124
124
|
are supported. To get all ingest pipelines, omit this parameter or use `*`.
|
|
@@ -161,7 +161,7 @@ class IngestClient(NamespacedClient):
|
|
|
161
161
|
"""
|
|
162
162
|
Returns a list of the built-in patterns.
|
|
163
163
|
|
|
164
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
164
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/grok-processor.html>`_
|
|
165
165
|
"""
|
|
166
166
|
__path = "/_ingest/processor/grok"
|
|
167
167
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -179,7 +179,7 @@ class IngestClient(NamespacedClient):
|
|
|
179
179
|
)
|
|
180
180
|
|
|
181
181
|
@_rewrite_parameters(
|
|
182
|
-
body_fields=
|
|
182
|
+
body_fields=("description", "meta", "on_failure", "processors", "version"),
|
|
183
183
|
parameter_aliases={"_meta": "meta"},
|
|
184
184
|
)
|
|
185
185
|
def put_pipeline(
|
|
@@ -200,11 +200,12 @@ class IngestClient(NamespacedClient):
|
|
|
200
200
|
processors: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
201
201
|
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
|
|
202
202
|
version: t.Optional[int] = None,
|
|
203
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
203
204
|
) -> ObjectApiResponse[t.Any]:
|
|
204
205
|
"""
|
|
205
206
|
Creates or updates a pipeline.
|
|
206
207
|
|
|
207
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
208
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/ingest.html>`_
|
|
208
209
|
|
|
209
210
|
:param id: ID of the ingest pipeline to create or update.
|
|
210
211
|
:param description: Description of the ingest pipeline.
|
|
@@ -232,10 +233,8 @@ class IngestClient(NamespacedClient):
|
|
|
232
233
|
if id in SKIP_IN_PATH:
|
|
233
234
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
234
235
|
__path = f"/_ingest/pipeline/{_quote(id)}"
|
|
235
|
-
__body: t.Dict[str, t.Any] = {}
|
|
236
236
|
__query: t.Dict[str, t.Any] = {}
|
|
237
|
-
if
|
|
238
|
-
__body["description"] = description
|
|
237
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
239
238
|
if error_trace is not None:
|
|
240
239
|
__query["error_trace"] = error_trace
|
|
241
240
|
if filter_path is not None:
|
|
@@ -246,25 +245,28 @@ class IngestClient(NamespacedClient):
|
|
|
246
245
|
__query["if_version"] = if_version
|
|
247
246
|
if master_timeout is not None:
|
|
248
247
|
__query["master_timeout"] = master_timeout
|
|
249
|
-
if meta is not None:
|
|
250
|
-
__body["_meta"] = meta
|
|
251
|
-
if on_failure is not None:
|
|
252
|
-
__body["on_failure"] = on_failure
|
|
253
248
|
if pretty is not None:
|
|
254
249
|
__query["pretty"] = pretty
|
|
255
|
-
if processors is not None:
|
|
256
|
-
__body["processors"] = processors
|
|
257
250
|
if timeout is not None:
|
|
258
251
|
__query["timeout"] = timeout
|
|
259
|
-
if
|
|
260
|
-
|
|
252
|
+
if not __body:
|
|
253
|
+
if description is not None:
|
|
254
|
+
__body["description"] = description
|
|
255
|
+
if meta is not None:
|
|
256
|
+
__body["_meta"] = meta
|
|
257
|
+
if on_failure is not None:
|
|
258
|
+
__body["on_failure"] = on_failure
|
|
259
|
+
if processors is not None:
|
|
260
|
+
__body["processors"] = processors
|
|
261
|
+
if version is not None:
|
|
262
|
+
__body["version"] = version
|
|
261
263
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
262
264
|
return self.perform_request( # type: ignore[return-value]
|
|
263
265
|
"PUT", __path, params=__query, headers=__headers, body=__body
|
|
264
266
|
)
|
|
265
267
|
|
|
266
268
|
@_rewrite_parameters(
|
|
267
|
-
body_fields=
|
|
269
|
+
body_fields=("docs", "pipeline"),
|
|
268
270
|
)
|
|
269
271
|
def simulate(
|
|
270
272
|
self,
|
|
@@ -277,11 +279,12 @@ class IngestClient(NamespacedClient):
|
|
|
277
279
|
pipeline: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
278
280
|
pretty: t.Optional[bool] = None,
|
|
279
281
|
verbose: t.Optional[bool] = None,
|
|
282
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
280
283
|
) -> ObjectApiResponse[t.Any]:
|
|
281
284
|
"""
|
|
282
285
|
Allows to simulate a pipeline with example documents.
|
|
283
286
|
|
|
284
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
287
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/simulate-pipeline-api.html>`_
|
|
285
288
|
|
|
286
289
|
:param id: Pipeline to test. If you don’t specify a `pipeline` in the request
|
|
287
290
|
body, this parameter is required.
|
|
@@ -296,22 +299,23 @@ class IngestClient(NamespacedClient):
|
|
|
296
299
|
__path = f"/_ingest/pipeline/{_quote(id)}/_simulate"
|
|
297
300
|
else:
|
|
298
301
|
__path = "/_ingest/pipeline/_simulate"
|
|
299
|
-
__body: t.Dict[str, t.Any] = {}
|
|
300
302
|
__query: t.Dict[str, t.Any] = {}
|
|
301
|
-
if
|
|
302
|
-
__body["docs"] = docs
|
|
303
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
303
304
|
if error_trace is not None:
|
|
304
305
|
__query["error_trace"] = error_trace
|
|
305
306
|
if filter_path is not None:
|
|
306
307
|
__query["filter_path"] = filter_path
|
|
307
308
|
if human is not None:
|
|
308
309
|
__query["human"] = human
|
|
309
|
-
if pipeline is not None:
|
|
310
|
-
__body["pipeline"] = pipeline
|
|
311
310
|
if pretty is not None:
|
|
312
311
|
__query["pretty"] = pretty
|
|
313
312
|
if verbose is not None:
|
|
314
313
|
__query["verbose"] = verbose
|
|
314
|
+
if not __body:
|
|
315
|
+
if docs is not None:
|
|
316
|
+
__body["docs"] = docs
|
|
317
|
+
if pipeline is not None:
|
|
318
|
+
__body["pipeline"] = pipeline
|
|
315
319
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
316
320
|
return self.perform_request( # type: ignore[return-value]
|
|
317
321
|
"POST", __path, params=__query, headers=__headers, body=__body
|
|
@@ -36,7 +36,7 @@ class LicenseClient(NamespacedClient):
|
|
|
36
36
|
"""
|
|
37
37
|
Deletes licensing information for the cluster
|
|
38
38
|
|
|
39
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
39
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-license.html>`_
|
|
40
40
|
"""
|
|
41
41
|
__path = "/_license"
|
|
42
42
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -67,7 +67,7 @@ class LicenseClient(NamespacedClient):
|
|
|
67
67
|
"""
|
|
68
68
|
Retrieves licensing information for the cluster
|
|
69
69
|
|
|
70
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
70
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-license.html>`_
|
|
71
71
|
|
|
72
72
|
:param accept_enterprise: If `true`, this parameter returns enterprise for Enterprise
|
|
73
73
|
license types. If `false`, this parameter returns platinum for both platinum
|
|
@@ -107,7 +107,7 @@ class LicenseClient(NamespacedClient):
|
|
|
107
107
|
"""
|
|
108
108
|
Retrieves information about the status of the basic license.
|
|
109
109
|
|
|
110
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
110
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-basic-status.html>`_
|
|
111
111
|
"""
|
|
112
112
|
__path = "/_license/basic_status"
|
|
113
113
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -136,7 +136,7 @@ class LicenseClient(NamespacedClient):
|
|
|
136
136
|
"""
|
|
137
137
|
Retrieves information about the status of the trial license.
|
|
138
138
|
|
|
139
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
139
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-trial-status.html>`_
|
|
140
140
|
"""
|
|
141
141
|
__path = "/_license/trial_status"
|
|
142
142
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -154,7 +154,7 @@ class LicenseClient(NamespacedClient):
|
|
|
154
154
|
)
|
|
155
155
|
|
|
156
156
|
@_rewrite_parameters(
|
|
157
|
-
body_fields=
|
|
157
|
+
body_fields=("license", "licenses"),
|
|
158
158
|
)
|
|
159
159
|
def post(
|
|
160
160
|
self,
|
|
@@ -166,11 +166,12 @@ class LicenseClient(NamespacedClient):
|
|
|
166
166
|
license: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
167
167
|
licenses: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
|
|
168
168
|
pretty: t.Optional[bool] = None,
|
|
169
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
169
170
|
) -> ObjectApiResponse[t.Any]:
|
|
170
171
|
"""
|
|
171
172
|
Updates the license for the cluster.
|
|
172
173
|
|
|
173
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
174
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-license.html>`_
|
|
174
175
|
|
|
175
176
|
:param acknowledge: Specifies whether you acknowledge the license changes.
|
|
176
177
|
:param license:
|
|
@@ -179,7 +180,7 @@ class LicenseClient(NamespacedClient):
|
|
|
179
180
|
"""
|
|
180
181
|
__path = "/_license"
|
|
181
182
|
__query: t.Dict[str, t.Any] = {}
|
|
182
|
-
__body: t.Dict[str, t.Any] = {}
|
|
183
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
183
184
|
if acknowledge is not None:
|
|
184
185
|
__query["acknowledge"] = acknowledge
|
|
185
186
|
if error_trace is not None:
|
|
@@ -188,12 +189,13 @@ class LicenseClient(NamespacedClient):
|
|
|
188
189
|
__query["filter_path"] = filter_path
|
|
189
190
|
if human is not None:
|
|
190
191
|
__query["human"] = human
|
|
191
|
-
if license is not None:
|
|
192
|
-
__body["license"] = license
|
|
193
|
-
if licenses is not None:
|
|
194
|
-
__body["licenses"] = licenses
|
|
195
192
|
if pretty is not None:
|
|
196
193
|
__query["pretty"] = pretty
|
|
194
|
+
if not __body:
|
|
195
|
+
if license is not None:
|
|
196
|
+
__body["license"] = license
|
|
197
|
+
if licenses is not None:
|
|
198
|
+
__body["licenses"] = licenses
|
|
197
199
|
if not __body:
|
|
198
200
|
__body = None # type: ignore[assignment]
|
|
199
201
|
__headers = {"accept": "application/json"}
|
|
@@ -216,7 +218,7 @@ class LicenseClient(NamespacedClient):
|
|
|
216
218
|
"""
|
|
217
219
|
Starts an indefinite basic license.
|
|
218
220
|
|
|
219
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
221
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/start-basic.html>`_
|
|
220
222
|
|
|
221
223
|
:param acknowledge: whether the user has acknowledged acknowledge messages (default:
|
|
222
224
|
false)
|
|
@@ -252,7 +254,7 @@ class LicenseClient(NamespacedClient):
|
|
|
252
254
|
"""
|
|
253
255
|
starts a limited time trial license.
|
|
254
256
|
|
|
255
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
257
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/start-trial.html>`_
|
|
256
258
|
|
|
257
259
|
:param acknowledge: whether the user has acknowledged acknowledge messages (default:
|
|
258
260
|
false)
|
|
@@ -37,7 +37,7 @@ class LogstashClient(NamespacedClient):
|
|
|
37
37
|
"""
|
|
38
38
|
Deletes Logstash Pipelines used by Central Management
|
|
39
39
|
|
|
40
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
40
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/logstash-api-delete-pipeline.html>`_
|
|
41
41
|
|
|
42
42
|
:param id: Identifier for the pipeline.
|
|
43
43
|
"""
|
|
@@ -62,7 +62,7 @@ class LogstashClient(NamespacedClient):
|
|
|
62
62
|
def get_pipeline(
|
|
63
63
|
self,
|
|
64
64
|
*,
|
|
65
|
-
id: t.Union[str, t.Sequence[str]],
|
|
65
|
+
id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
66
66
|
error_trace: t.Optional[bool] = None,
|
|
67
67
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
68
68
|
human: t.Optional[bool] = None,
|
|
@@ -71,12 +71,10 @@ class LogstashClient(NamespacedClient):
|
|
|
71
71
|
"""
|
|
72
72
|
Retrieves Logstash Pipelines used by Central Management
|
|
73
73
|
|
|
74
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
74
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/logstash-api-get-pipeline.html>`_
|
|
75
75
|
|
|
76
76
|
:param id: Comma-separated list of pipeline identifiers.
|
|
77
77
|
"""
|
|
78
|
-
if id in SKIP_IN_PATH:
|
|
79
|
-
raise ValueError("Empty value passed for parameter 'id'")
|
|
80
78
|
if id not in SKIP_IN_PATH:
|
|
81
79
|
__path = f"/_logstash/pipeline/{_quote(id)}"
|
|
82
80
|
else:
|
|
@@ -102,7 +100,8 @@ class LogstashClient(NamespacedClient):
|
|
|
102
100
|
self,
|
|
103
101
|
*,
|
|
104
102
|
id: str,
|
|
105
|
-
pipeline: t.Mapping[str, t.Any],
|
|
103
|
+
pipeline: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
104
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
106
105
|
error_trace: t.Optional[bool] = None,
|
|
107
106
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
108
107
|
human: t.Optional[bool] = None,
|
|
@@ -111,15 +110,19 @@ class LogstashClient(NamespacedClient):
|
|
|
111
110
|
"""
|
|
112
111
|
Adds and updates Logstash Pipelines used for Central Management
|
|
113
112
|
|
|
114
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
113
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/logstash-api-put-pipeline.html>`_
|
|
115
114
|
|
|
116
115
|
:param id: Identifier for the pipeline.
|
|
117
116
|
:param pipeline:
|
|
118
117
|
"""
|
|
119
118
|
if id in SKIP_IN_PATH:
|
|
120
119
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
121
|
-
if pipeline is None:
|
|
122
|
-
raise ValueError(
|
|
120
|
+
if pipeline is None and body is None:
|
|
121
|
+
raise ValueError(
|
|
122
|
+
"Empty value passed for parameters 'pipeline' and 'body', one of them should be set."
|
|
123
|
+
)
|
|
124
|
+
elif pipeline is not None and body is not None:
|
|
125
|
+
raise ValueError("Cannot set both 'pipeline' and 'body'")
|
|
123
126
|
__path = f"/_logstash/pipeline/{_quote(id)}"
|
|
124
127
|
__query: t.Dict[str, t.Any] = {}
|
|
125
128
|
if error_trace is not None:
|
|
@@ -130,7 +133,7 @@ class LogstashClient(NamespacedClient):
|
|
|
130
133
|
__query["human"] = human
|
|
131
134
|
if pretty is not None:
|
|
132
135
|
__query["pretty"] = pretty
|
|
133
|
-
__body = pipeline
|
|
136
|
+
__body = pipeline if pipeline is not None else body
|
|
134
137
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
135
138
|
return self.perform_request( # type: ignore[return-value]
|
|
136
139
|
"PUT", __path, params=__query, headers=__headers, body=__body
|
|
@@ -39,7 +39,7 @@ class MigrationClient(NamespacedClient):
|
|
|
39
39
|
that use deprecated features that will be removed or changed in the next major
|
|
40
40
|
version.
|
|
41
41
|
|
|
42
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
42
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/migration-api-deprecation.html>`_
|
|
43
43
|
|
|
44
44
|
:param index: Comma-separate list of data streams or indices to check. Wildcard
|
|
45
45
|
(*) expressions are supported.
|
|
@@ -74,7 +74,7 @@ class MigrationClient(NamespacedClient):
|
|
|
74
74
|
"""
|
|
75
75
|
Find out whether system features need to be upgraded or not
|
|
76
76
|
|
|
77
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
77
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/migration-api-feature-upgrade.html>`_
|
|
78
78
|
"""
|
|
79
79
|
__path = "/_migration/system_features"
|
|
80
80
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -103,7 +103,7 @@ class MigrationClient(NamespacedClient):
|
|
|
103
103
|
"""
|
|
104
104
|
Begin upgrades for system features
|
|
105
105
|
|
|
106
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
106
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/migration-api-feature-upgrade.html>`_
|
|
107
107
|
"""
|
|
108
108
|
__path = "/_migration/system_features"
|
|
109
109
|
__query: t.Dict[str, t.Any] = {}
|