elasticsearch 8.12.1__py3-none-any.whl → 8.13.1__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 +7 -0
- elasticsearch/_async/client/__init__.py +477 -128
- elasticsearch/_async/client/_base.py +41 -1
- elasticsearch/_async/client/async_search.py +40 -12
- elasticsearch/_async/client/autoscaling.py +37 -11
- elasticsearch/_async/client/cat.py +260 -69
- elasticsearch/_async/client/ccr.py +123 -38
- elasticsearch/_async/client/cluster.py +153 -42
- elasticsearch/_async/client/dangling_indices.py +27 -8
- elasticsearch/_async/client/enrich.py +48 -14
- elasticsearch/_async/client/eql.py +38 -12
- elasticsearch/_async/client/esql.py +10 -2
- elasticsearch/_async/client/features.py +17 -4
- elasticsearch/_async/client/fleet.py +30 -7
- elasticsearch/_async/client/graph.py +11 -3
- elasticsearch/_async/client/ilm.py +101 -29
- elasticsearch/_async/client/indices.py +688 -181
- elasticsearch/_async/client/inference.py +111 -44
- elasticsearch/_async/client/ingest.py +59 -16
- elasticsearch/_async/client/license.py +58 -14
- elasticsearch/_async/client/logstash.py +31 -9
- elasticsearch/_async/client/migration.py +28 -7
- elasticsearch/_async/client/ml.py +781 -214
- elasticsearch/_async/client/monitoring.py +10 -2
- elasticsearch/_async/client/nodes.py +103 -29
- elasticsearch/_async/client/query_ruleset.py +37 -11
- elasticsearch/_async/client/rollup.py +79 -24
- elasticsearch/_async/client/search_application.py +76 -23
- elasticsearch/_async/client/searchable_snapshots.py +49 -12
- elasticsearch/_async/client/security.py +544 -143
- elasticsearch/_async/client/shutdown.py +28 -6
- elasticsearch/_async/client/slm.py +80 -22
- elasticsearch/_async/client/snapshot.py +140 -54
- elasticsearch/_async/client/sql.py +55 -15
- elasticsearch/_async/client/ssl.py +9 -2
- elasticsearch/_async/client/synonyms.py +75 -21
- elasticsearch/_async/client/tasks.py +29 -8
- elasticsearch/_async/client/text_structure.py +74 -2
- elasticsearch/_async/client/transform.py +106 -32
- elasticsearch/_async/client/watcher.py +110 -31
- elasticsearch/_async/client/xpack.py +16 -4
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_otel.py +92 -0
- elasticsearch/_sync/client/__init__.py +477 -128
- elasticsearch/_sync/client/_base.py +41 -1
- elasticsearch/_sync/client/async_search.py +40 -12
- elasticsearch/_sync/client/autoscaling.py +37 -11
- elasticsearch/_sync/client/cat.py +260 -69
- elasticsearch/_sync/client/ccr.py +123 -38
- elasticsearch/_sync/client/cluster.py +153 -42
- elasticsearch/_sync/client/dangling_indices.py +27 -8
- elasticsearch/_sync/client/enrich.py +48 -14
- elasticsearch/_sync/client/eql.py +38 -12
- elasticsearch/_sync/client/esql.py +10 -2
- elasticsearch/_sync/client/features.py +17 -4
- elasticsearch/_sync/client/fleet.py +30 -7
- elasticsearch/_sync/client/graph.py +11 -3
- elasticsearch/_sync/client/ilm.py +101 -29
- elasticsearch/_sync/client/indices.py +688 -181
- elasticsearch/_sync/client/inference.py +111 -44
- elasticsearch/_sync/client/ingest.py +59 -16
- elasticsearch/_sync/client/license.py +58 -14
- elasticsearch/_sync/client/logstash.py +31 -9
- elasticsearch/_sync/client/migration.py +28 -7
- elasticsearch/_sync/client/ml.py +781 -214
- elasticsearch/_sync/client/monitoring.py +10 -2
- elasticsearch/_sync/client/nodes.py +103 -29
- elasticsearch/_sync/client/query_ruleset.py +37 -11
- elasticsearch/_sync/client/rollup.py +79 -24
- elasticsearch/_sync/client/search_application.py +76 -23
- elasticsearch/_sync/client/searchable_snapshots.py +49 -12
- elasticsearch/_sync/client/security.py +544 -143
- elasticsearch/_sync/client/shutdown.py +28 -6
- elasticsearch/_sync/client/slm.py +80 -22
- elasticsearch/_sync/client/snapshot.py +140 -54
- elasticsearch/_sync/client/sql.py +55 -15
- elasticsearch/_sync/client/ssl.py +9 -2
- elasticsearch/_sync/client/synonyms.py +75 -21
- elasticsearch/_sync/client/tasks.py +29 -8
- elasticsearch/_sync/client/text_structure.py +74 -2
- elasticsearch/_sync/client/transform.py +106 -32
- elasticsearch/_sync/client/watcher.py +110 -31
- elasticsearch/_sync/client/xpack.py +16 -4
- elasticsearch/_version.py +1 -1
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/__init__.py +62 -0
- elasticsearch/helpers/vectorstore/_async/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_async/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_async/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_async/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +391 -0
- elasticsearch/helpers/vectorstore/_sync/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_sync/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_sync/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_sync/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +388 -0
- elasticsearch/helpers/vectorstore/_utils.py +116 -0
- elasticsearch/serializer.py +14 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/METADATA +28 -8
- elasticsearch-8.13.1.dist-info/RECORD +116 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/WHEEL +1 -1
- elasticsearch-8.12.1.dist-info/RECORD +0 -103
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/LICENSE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/NOTICE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/top_level.txt +0 -0
|
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class MlClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters()
|
|
28
29
|
async def clear_trained_model_deployment_cache(
|
|
29
30
|
self,
|
|
@@ -37,13 +38,16 @@ class MlClient(NamespacedClient):
|
|
|
37
38
|
"""
|
|
38
39
|
Clear the cached results from a trained model deployment
|
|
39
40
|
|
|
40
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
41
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/clear-trained-model-deployment-cache.html>`_
|
|
41
42
|
|
|
42
43
|
:param model_id: The unique identifier of the trained model.
|
|
43
44
|
"""
|
|
44
45
|
if model_id in SKIP_IN_PATH:
|
|
45
46
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
46
|
-
|
|
47
|
+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
48
|
+
__path = (
|
|
49
|
+
f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/cache/_clear'
|
|
50
|
+
)
|
|
47
51
|
__query: t.Dict[str, t.Any] = {}
|
|
48
52
|
if error_trace is not None:
|
|
49
53
|
__query["error_trace"] = error_trace
|
|
@@ -55,7 +59,12 @@ class MlClient(NamespacedClient):
|
|
|
55
59
|
__query["pretty"] = pretty
|
|
56
60
|
__headers = {"accept": "application/json"}
|
|
57
61
|
return await self.perform_request( # type: ignore[return-value]
|
|
58
|
-
"POST",
|
|
62
|
+
"POST",
|
|
63
|
+
__path,
|
|
64
|
+
params=__query,
|
|
65
|
+
headers=__headers,
|
|
66
|
+
endpoint_id="ml.clear_trained_model_deployment_cache",
|
|
67
|
+
path_parts=__path_parts,
|
|
59
68
|
)
|
|
60
69
|
|
|
61
70
|
@_rewrite_parameters(
|
|
@@ -78,7 +87,7 @@ class MlClient(NamespacedClient):
|
|
|
78
87
|
Closes one or more anomaly detection jobs. A job can be opened and closed multiple
|
|
79
88
|
times throughout its lifecycle.
|
|
80
89
|
|
|
81
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
90
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-close-job.html>`_
|
|
82
91
|
|
|
83
92
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
84
93
|
a group name, or a wildcard expression. You can close multiple anomaly detection
|
|
@@ -92,7 +101,8 @@ class MlClient(NamespacedClient):
|
|
|
92
101
|
"""
|
|
93
102
|
if job_id in SKIP_IN_PATH:
|
|
94
103
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
95
|
-
|
|
104
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
105
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_close'
|
|
96
106
|
__query: t.Dict[str, t.Any] = {}
|
|
97
107
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
98
108
|
if error_trace is not None:
|
|
@@ -116,7 +126,13 @@ class MlClient(NamespacedClient):
|
|
|
116
126
|
if __body is not None:
|
|
117
127
|
__headers["content-type"] = "application/json"
|
|
118
128
|
return await self.perform_request( # type: ignore[return-value]
|
|
119
|
-
"POST",
|
|
129
|
+
"POST",
|
|
130
|
+
__path,
|
|
131
|
+
params=__query,
|
|
132
|
+
headers=__headers,
|
|
133
|
+
body=__body,
|
|
134
|
+
endpoint_id="ml.close_job",
|
|
135
|
+
path_parts=__path_parts,
|
|
120
136
|
)
|
|
121
137
|
|
|
122
138
|
@_rewrite_parameters()
|
|
@@ -132,13 +148,14 @@ class MlClient(NamespacedClient):
|
|
|
132
148
|
"""
|
|
133
149
|
Deletes a calendar.
|
|
134
150
|
|
|
135
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
151
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-calendar.html>`_
|
|
136
152
|
|
|
137
153
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
138
154
|
"""
|
|
139
155
|
if calendar_id in SKIP_IN_PATH:
|
|
140
156
|
raise ValueError("Empty value passed for parameter 'calendar_id'")
|
|
141
|
-
|
|
157
|
+
__path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)}
|
|
158
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}'
|
|
142
159
|
__query: t.Dict[str, t.Any] = {}
|
|
143
160
|
if error_trace is not None:
|
|
144
161
|
__query["error_trace"] = error_trace
|
|
@@ -150,7 +167,12 @@ class MlClient(NamespacedClient):
|
|
|
150
167
|
__query["pretty"] = pretty
|
|
151
168
|
__headers = {"accept": "application/json"}
|
|
152
169
|
return await self.perform_request( # type: ignore[return-value]
|
|
153
|
-
"DELETE",
|
|
170
|
+
"DELETE",
|
|
171
|
+
__path,
|
|
172
|
+
params=__query,
|
|
173
|
+
headers=__headers,
|
|
174
|
+
endpoint_id="ml.delete_calendar",
|
|
175
|
+
path_parts=__path_parts,
|
|
154
176
|
)
|
|
155
177
|
|
|
156
178
|
@_rewrite_parameters()
|
|
@@ -167,7 +189,7 @@ class MlClient(NamespacedClient):
|
|
|
167
189
|
"""
|
|
168
190
|
Deletes scheduled events from a calendar.
|
|
169
191
|
|
|
170
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
192
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-calendar-event.html>`_
|
|
171
193
|
|
|
172
194
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
173
195
|
:param event_id: Identifier for the scheduled event. You can obtain this identifier
|
|
@@ -177,7 +199,11 @@ class MlClient(NamespacedClient):
|
|
|
177
199
|
raise ValueError("Empty value passed for parameter 'calendar_id'")
|
|
178
200
|
if event_id in SKIP_IN_PATH:
|
|
179
201
|
raise ValueError("Empty value passed for parameter 'event_id'")
|
|
180
|
-
|
|
202
|
+
__path_parts: t.Dict[str, str] = {
|
|
203
|
+
"calendar_id": _quote(calendar_id),
|
|
204
|
+
"event_id": _quote(event_id),
|
|
205
|
+
}
|
|
206
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}/events/{__path_parts["event_id"]}'
|
|
181
207
|
__query: t.Dict[str, t.Any] = {}
|
|
182
208
|
if error_trace is not None:
|
|
183
209
|
__query["error_trace"] = error_trace
|
|
@@ -189,7 +215,12 @@ class MlClient(NamespacedClient):
|
|
|
189
215
|
__query["pretty"] = pretty
|
|
190
216
|
__headers = {"accept": "application/json"}
|
|
191
217
|
return await self.perform_request( # type: ignore[return-value]
|
|
192
|
-
"DELETE",
|
|
218
|
+
"DELETE",
|
|
219
|
+
__path,
|
|
220
|
+
params=__query,
|
|
221
|
+
headers=__headers,
|
|
222
|
+
endpoint_id="ml.delete_calendar_event",
|
|
223
|
+
path_parts=__path_parts,
|
|
193
224
|
)
|
|
194
225
|
|
|
195
226
|
@_rewrite_parameters()
|
|
@@ -206,7 +237,7 @@ class MlClient(NamespacedClient):
|
|
|
206
237
|
"""
|
|
207
238
|
Deletes anomaly detection jobs from a calendar.
|
|
208
239
|
|
|
209
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
240
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-calendar-job.html>`_
|
|
210
241
|
|
|
211
242
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
212
243
|
:param job_id: An identifier for the anomaly detection jobs. It can be a job
|
|
@@ -216,7 +247,11 @@ class MlClient(NamespacedClient):
|
|
|
216
247
|
raise ValueError("Empty value passed for parameter 'calendar_id'")
|
|
217
248
|
if job_id in SKIP_IN_PATH:
|
|
218
249
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
219
|
-
|
|
250
|
+
__path_parts: t.Dict[str, str] = {
|
|
251
|
+
"calendar_id": _quote(calendar_id),
|
|
252
|
+
"job_id": _quote(job_id),
|
|
253
|
+
}
|
|
254
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}/jobs/{__path_parts["job_id"]}'
|
|
220
255
|
__query: t.Dict[str, t.Any] = {}
|
|
221
256
|
if error_trace is not None:
|
|
222
257
|
__query["error_trace"] = error_trace
|
|
@@ -228,7 +263,12 @@ class MlClient(NamespacedClient):
|
|
|
228
263
|
__query["pretty"] = pretty
|
|
229
264
|
__headers = {"accept": "application/json"}
|
|
230
265
|
return await self.perform_request( # type: ignore[return-value]
|
|
231
|
-
"DELETE",
|
|
266
|
+
"DELETE",
|
|
267
|
+
__path,
|
|
268
|
+
params=__query,
|
|
269
|
+
headers=__headers,
|
|
270
|
+
endpoint_id="ml.delete_calendar_job",
|
|
271
|
+
path_parts=__path_parts,
|
|
232
272
|
)
|
|
233
273
|
|
|
234
274
|
@_rewrite_parameters()
|
|
@@ -246,7 +286,7 @@ class MlClient(NamespacedClient):
|
|
|
246
286
|
"""
|
|
247
287
|
Deletes an existing data frame analytics job.
|
|
248
288
|
|
|
249
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
289
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-dfanalytics.html>`_
|
|
250
290
|
|
|
251
291
|
:param id: Identifier for the data frame analytics job.
|
|
252
292
|
:param force: If `true`, it deletes a job that is not stopped; this method is
|
|
@@ -255,7 +295,8 @@ class MlClient(NamespacedClient):
|
|
|
255
295
|
"""
|
|
256
296
|
if id in SKIP_IN_PATH:
|
|
257
297
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
258
|
-
|
|
298
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
299
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}'
|
|
259
300
|
__query: t.Dict[str, t.Any] = {}
|
|
260
301
|
if error_trace is not None:
|
|
261
302
|
__query["error_trace"] = error_trace
|
|
@@ -271,7 +312,12 @@ class MlClient(NamespacedClient):
|
|
|
271
312
|
__query["timeout"] = timeout
|
|
272
313
|
__headers = {"accept": "application/json"}
|
|
273
314
|
return await self.perform_request( # type: ignore[return-value]
|
|
274
|
-
"DELETE",
|
|
315
|
+
"DELETE",
|
|
316
|
+
__path,
|
|
317
|
+
params=__query,
|
|
318
|
+
headers=__headers,
|
|
319
|
+
endpoint_id="ml.delete_data_frame_analytics",
|
|
320
|
+
path_parts=__path_parts,
|
|
275
321
|
)
|
|
276
322
|
|
|
277
323
|
@_rewrite_parameters()
|
|
@@ -288,7 +334,7 @@ class MlClient(NamespacedClient):
|
|
|
288
334
|
"""
|
|
289
335
|
Deletes an existing datafeed.
|
|
290
336
|
|
|
291
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
337
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-datafeed.html>`_
|
|
292
338
|
|
|
293
339
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
294
340
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -299,7 +345,8 @@ class MlClient(NamespacedClient):
|
|
|
299
345
|
"""
|
|
300
346
|
if datafeed_id in SKIP_IN_PATH:
|
|
301
347
|
raise ValueError("Empty value passed for parameter 'datafeed_id'")
|
|
302
|
-
|
|
348
|
+
__path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)}
|
|
349
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}'
|
|
303
350
|
__query: t.Dict[str, t.Any] = {}
|
|
304
351
|
if error_trace is not None:
|
|
305
352
|
__query["error_trace"] = error_trace
|
|
@@ -313,7 +360,12 @@ class MlClient(NamespacedClient):
|
|
|
313
360
|
__query["pretty"] = pretty
|
|
314
361
|
__headers = {"accept": "application/json"}
|
|
315
362
|
return await self.perform_request( # type: ignore[return-value]
|
|
316
|
-
"DELETE",
|
|
363
|
+
"DELETE",
|
|
364
|
+
__path,
|
|
365
|
+
params=__query,
|
|
366
|
+
headers=__headers,
|
|
367
|
+
endpoint_id="ml.delete_datafeed",
|
|
368
|
+
path_parts=__path_parts,
|
|
317
369
|
)
|
|
318
370
|
|
|
319
371
|
@_rewrite_parameters(
|
|
@@ -334,7 +386,7 @@ class MlClient(NamespacedClient):
|
|
|
334
386
|
"""
|
|
335
387
|
Deletes expired and unused machine learning data.
|
|
336
388
|
|
|
337
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
389
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-expired-data.html>`_
|
|
338
390
|
|
|
339
391
|
:param job_id: Identifier for an anomaly detection job. It can be a job identifier,
|
|
340
392
|
a group name, or a wildcard expression.
|
|
@@ -343,9 +395,12 @@ class MlClient(NamespacedClient):
|
|
|
343
395
|
:param timeout: How long can the underlying delete processes run until they are
|
|
344
396
|
canceled.
|
|
345
397
|
"""
|
|
398
|
+
__path_parts: t.Dict[str, str]
|
|
346
399
|
if job_id not in SKIP_IN_PATH:
|
|
347
|
-
|
|
400
|
+
__path_parts = {"job_id": _quote(job_id)}
|
|
401
|
+
__path = f'/_ml/_delete_expired_data/{__path_parts["job_id"]}'
|
|
348
402
|
else:
|
|
403
|
+
__path_parts = {}
|
|
349
404
|
__path = "/_ml/_delete_expired_data"
|
|
350
405
|
__query: t.Dict[str, t.Any] = {}
|
|
351
406
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -368,7 +423,13 @@ class MlClient(NamespacedClient):
|
|
|
368
423
|
if __body is not None:
|
|
369
424
|
__headers["content-type"] = "application/json"
|
|
370
425
|
return await self.perform_request( # type: ignore[return-value]
|
|
371
|
-
"DELETE",
|
|
426
|
+
"DELETE",
|
|
427
|
+
__path,
|
|
428
|
+
params=__query,
|
|
429
|
+
headers=__headers,
|
|
430
|
+
body=__body,
|
|
431
|
+
endpoint_id="ml.delete_expired_data",
|
|
432
|
+
path_parts=__path_parts,
|
|
372
433
|
)
|
|
373
434
|
|
|
374
435
|
@_rewrite_parameters()
|
|
@@ -384,13 +445,14 @@ class MlClient(NamespacedClient):
|
|
|
384
445
|
"""
|
|
385
446
|
Deletes a filter.
|
|
386
447
|
|
|
387
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
448
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-filter.html>`_
|
|
388
449
|
|
|
389
450
|
:param filter_id: A string that uniquely identifies a filter.
|
|
390
451
|
"""
|
|
391
452
|
if filter_id in SKIP_IN_PATH:
|
|
392
453
|
raise ValueError("Empty value passed for parameter 'filter_id'")
|
|
393
|
-
|
|
454
|
+
__path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)}
|
|
455
|
+
__path = f'/_ml/filters/{__path_parts["filter_id"]}'
|
|
394
456
|
__query: t.Dict[str, t.Any] = {}
|
|
395
457
|
if error_trace is not None:
|
|
396
458
|
__query["error_trace"] = error_trace
|
|
@@ -402,7 +464,12 @@ class MlClient(NamespacedClient):
|
|
|
402
464
|
__query["pretty"] = pretty
|
|
403
465
|
__headers = {"accept": "application/json"}
|
|
404
466
|
return await self.perform_request( # type: ignore[return-value]
|
|
405
|
-
"DELETE",
|
|
467
|
+
"DELETE",
|
|
468
|
+
__path,
|
|
469
|
+
params=__query,
|
|
470
|
+
headers=__headers,
|
|
471
|
+
endpoint_id="ml.delete_filter",
|
|
472
|
+
path_parts=__path_parts,
|
|
406
473
|
)
|
|
407
474
|
|
|
408
475
|
@_rewrite_parameters()
|
|
@@ -421,7 +488,7 @@ class MlClient(NamespacedClient):
|
|
|
421
488
|
"""
|
|
422
489
|
Deletes forecasts from a machine learning job.
|
|
423
490
|
|
|
424
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
491
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-forecast.html>`_
|
|
425
492
|
|
|
426
493
|
:param job_id: Identifier for the anomaly detection job.
|
|
427
494
|
:param forecast_id: A comma-separated list of forecast identifiers. If you do
|
|
@@ -437,10 +504,16 @@ class MlClient(NamespacedClient):
|
|
|
437
504
|
"""
|
|
438
505
|
if job_id in SKIP_IN_PATH:
|
|
439
506
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
507
|
+
__path_parts: t.Dict[str, str]
|
|
440
508
|
if job_id not in SKIP_IN_PATH and forecast_id not in SKIP_IN_PATH:
|
|
441
|
-
|
|
509
|
+
__path_parts = {
|
|
510
|
+
"job_id": _quote(job_id),
|
|
511
|
+
"forecast_id": _quote(forecast_id),
|
|
512
|
+
}
|
|
513
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_forecast/{__path_parts["forecast_id"]}'
|
|
442
514
|
elif job_id not in SKIP_IN_PATH:
|
|
443
|
-
|
|
515
|
+
__path_parts = {"job_id": _quote(job_id)}
|
|
516
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_forecast'
|
|
444
517
|
else:
|
|
445
518
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
446
519
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -458,7 +531,12 @@ class MlClient(NamespacedClient):
|
|
|
458
531
|
__query["timeout"] = timeout
|
|
459
532
|
__headers = {"accept": "application/json"}
|
|
460
533
|
return await self.perform_request( # type: ignore[return-value]
|
|
461
|
-
"DELETE",
|
|
534
|
+
"DELETE",
|
|
535
|
+
__path,
|
|
536
|
+
params=__query,
|
|
537
|
+
headers=__headers,
|
|
538
|
+
endpoint_id="ml.delete_forecast",
|
|
539
|
+
path_parts=__path_parts,
|
|
462
540
|
)
|
|
463
541
|
|
|
464
542
|
@_rewrite_parameters()
|
|
@@ -477,7 +555,7 @@ class MlClient(NamespacedClient):
|
|
|
477
555
|
"""
|
|
478
556
|
Deletes an existing anomaly detection job.
|
|
479
557
|
|
|
480
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
558
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-job.html>`_
|
|
481
559
|
|
|
482
560
|
:param job_id: Identifier for the anomaly detection job.
|
|
483
561
|
:param delete_user_annotations: Specifies whether annotations that have been
|
|
@@ -490,7 +568,8 @@ class MlClient(NamespacedClient):
|
|
|
490
568
|
"""
|
|
491
569
|
if job_id in SKIP_IN_PATH:
|
|
492
570
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
493
|
-
|
|
571
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
572
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}'
|
|
494
573
|
__query: t.Dict[str, t.Any] = {}
|
|
495
574
|
if delete_user_annotations is not None:
|
|
496
575
|
__query["delete_user_annotations"] = delete_user_annotations
|
|
@@ -508,7 +587,12 @@ class MlClient(NamespacedClient):
|
|
|
508
587
|
__query["wait_for_completion"] = wait_for_completion
|
|
509
588
|
__headers = {"accept": "application/json"}
|
|
510
589
|
return await self.perform_request( # type: ignore[return-value]
|
|
511
|
-
"DELETE",
|
|
590
|
+
"DELETE",
|
|
591
|
+
__path,
|
|
592
|
+
params=__query,
|
|
593
|
+
headers=__headers,
|
|
594
|
+
endpoint_id="ml.delete_job",
|
|
595
|
+
path_parts=__path_parts,
|
|
512
596
|
)
|
|
513
597
|
|
|
514
598
|
@_rewrite_parameters()
|
|
@@ -525,7 +609,7 @@ class MlClient(NamespacedClient):
|
|
|
525
609
|
"""
|
|
526
610
|
Deletes an existing model snapshot.
|
|
527
611
|
|
|
528
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
612
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-delete-snapshot.html>`_
|
|
529
613
|
|
|
530
614
|
:param job_id: Identifier for the anomaly detection job.
|
|
531
615
|
:param snapshot_id: Identifier for the model snapshot.
|
|
@@ -534,7 +618,11 @@ class MlClient(NamespacedClient):
|
|
|
534
618
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
535
619
|
if snapshot_id in SKIP_IN_PATH:
|
|
536
620
|
raise ValueError("Empty value passed for parameter 'snapshot_id'")
|
|
537
|
-
|
|
621
|
+
__path_parts: t.Dict[str, str] = {
|
|
622
|
+
"job_id": _quote(job_id),
|
|
623
|
+
"snapshot_id": _quote(snapshot_id),
|
|
624
|
+
}
|
|
625
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}'
|
|
538
626
|
__query: t.Dict[str, t.Any] = {}
|
|
539
627
|
if error_trace is not None:
|
|
540
628
|
__query["error_trace"] = error_trace
|
|
@@ -546,7 +634,12 @@ class MlClient(NamespacedClient):
|
|
|
546
634
|
__query["pretty"] = pretty
|
|
547
635
|
__headers = {"accept": "application/json"}
|
|
548
636
|
return await self.perform_request( # type: ignore[return-value]
|
|
549
|
-
"DELETE",
|
|
637
|
+
"DELETE",
|
|
638
|
+
__path,
|
|
639
|
+
params=__query,
|
|
640
|
+
headers=__headers,
|
|
641
|
+
endpoint_id="ml.delete_model_snapshot",
|
|
642
|
+
path_parts=__path_parts,
|
|
550
643
|
)
|
|
551
644
|
|
|
552
645
|
@_rewrite_parameters()
|
|
@@ -564,7 +657,7 @@ class MlClient(NamespacedClient):
|
|
|
564
657
|
Deletes an existing trained inference model that is currently not referenced
|
|
565
658
|
by an ingest pipeline.
|
|
566
659
|
|
|
567
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
660
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-trained-models.html>`_
|
|
568
661
|
|
|
569
662
|
:param model_id: The unique identifier of the trained model.
|
|
570
663
|
:param force: Forcefully deletes a trained model that is referenced by ingest
|
|
@@ -572,7 +665,8 @@ class MlClient(NamespacedClient):
|
|
|
572
665
|
"""
|
|
573
666
|
if model_id in SKIP_IN_PATH:
|
|
574
667
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
575
|
-
|
|
668
|
+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
669
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}'
|
|
576
670
|
__query: t.Dict[str, t.Any] = {}
|
|
577
671
|
if error_trace is not None:
|
|
578
672
|
__query["error_trace"] = error_trace
|
|
@@ -586,7 +680,12 @@ class MlClient(NamespacedClient):
|
|
|
586
680
|
__query["pretty"] = pretty
|
|
587
681
|
__headers = {"accept": "application/json"}
|
|
588
682
|
return await self.perform_request( # type: ignore[return-value]
|
|
589
|
-
"DELETE",
|
|
683
|
+
"DELETE",
|
|
684
|
+
__path,
|
|
685
|
+
params=__query,
|
|
686
|
+
headers=__headers,
|
|
687
|
+
endpoint_id="ml.delete_trained_model",
|
|
688
|
+
path_parts=__path_parts,
|
|
590
689
|
)
|
|
591
690
|
|
|
592
691
|
@_rewrite_parameters()
|
|
@@ -603,7 +702,7 @@ class MlClient(NamespacedClient):
|
|
|
603
702
|
"""
|
|
604
703
|
Deletes a model alias that refers to the trained model
|
|
605
704
|
|
|
606
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
705
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-trained-models-aliases.html>`_
|
|
607
706
|
|
|
608
707
|
:param model_id: The trained model ID to which the model alias refers.
|
|
609
708
|
:param model_alias: The model alias to delete.
|
|
@@ -612,7 +711,11 @@ class MlClient(NamespacedClient):
|
|
|
612
711
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
613
712
|
if model_alias in SKIP_IN_PATH:
|
|
614
713
|
raise ValueError("Empty value passed for parameter 'model_alias'")
|
|
615
|
-
|
|
714
|
+
__path_parts: t.Dict[str, str] = {
|
|
715
|
+
"model_id": _quote(model_id),
|
|
716
|
+
"model_alias": _quote(model_alias),
|
|
717
|
+
}
|
|
718
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/model_aliases/{__path_parts["model_alias"]}'
|
|
616
719
|
__query: t.Dict[str, t.Any] = {}
|
|
617
720
|
if error_trace is not None:
|
|
618
721
|
__query["error_trace"] = error_trace
|
|
@@ -624,7 +727,12 @@ class MlClient(NamespacedClient):
|
|
|
624
727
|
__query["pretty"] = pretty
|
|
625
728
|
__headers = {"accept": "application/json"}
|
|
626
729
|
return await self.perform_request( # type: ignore[return-value]
|
|
627
|
-
"DELETE",
|
|
730
|
+
"DELETE",
|
|
731
|
+
__path,
|
|
732
|
+
params=__query,
|
|
733
|
+
headers=__headers,
|
|
734
|
+
endpoint_id="ml.delete_trained_model_alias",
|
|
735
|
+
path_parts=__path_parts,
|
|
628
736
|
)
|
|
629
737
|
|
|
630
738
|
@_rewrite_parameters(
|
|
@@ -649,7 +757,7 @@ class MlClient(NamespacedClient):
|
|
|
649
757
|
"""
|
|
650
758
|
Estimates the model memory
|
|
651
759
|
|
|
652
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
760
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-apis.html>`_
|
|
653
761
|
|
|
654
762
|
:param analysis_config: For a list of the properties that you can specify in
|
|
655
763
|
the `analysis_config` component of the body of this API.
|
|
@@ -666,6 +774,7 @@ class MlClient(NamespacedClient):
|
|
|
666
774
|
from the request if no detectors have a `by_field_name`, `over_field_name`
|
|
667
775
|
or `partition_field_name`.
|
|
668
776
|
"""
|
|
777
|
+
__path_parts: t.Dict[str, str] = {}
|
|
669
778
|
__path = "/_ml/anomaly_detectors/_estimate_model_memory"
|
|
670
779
|
__query: t.Dict[str, t.Any] = {}
|
|
671
780
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -686,7 +795,13 @@ class MlClient(NamespacedClient):
|
|
|
686
795
|
__body["overall_cardinality"] = overall_cardinality
|
|
687
796
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
688
797
|
return await self.perform_request( # type: ignore[return-value]
|
|
689
|
-
"POST",
|
|
798
|
+
"POST",
|
|
799
|
+
__path,
|
|
800
|
+
params=__query,
|
|
801
|
+
headers=__headers,
|
|
802
|
+
body=__body,
|
|
803
|
+
endpoint_id="ml.estimate_model_memory",
|
|
804
|
+
path_parts=__path_parts,
|
|
690
805
|
)
|
|
691
806
|
|
|
692
807
|
@_rewrite_parameters(
|
|
@@ -707,7 +822,7 @@ class MlClient(NamespacedClient):
|
|
|
707
822
|
"""
|
|
708
823
|
Evaluates the data frame analytics for an annotated index.
|
|
709
824
|
|
|
710
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
825
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/evaluate-dfanalytics.html>`_
|
|
711
826
|
|
|
712
827
|
:param evaluation: Defines the type of evaluation you want to perform.
|
|
713
828
|
:param index: Defines the `index` in which the evaluation will be performed.
|
|
@@ -718,6 +833,7 @@ class MlClient(NamespacedClient):
|
|
|
718
833
|
raise ValueError("Empty value passed for parameter 'evaluation'")
|
|
719
834
|
if index is None and body is None:
|
|
720
835
|
raise ValueError("Empty value passed for parameter 'index'")
|
|
836
|
+
__path_parts: t.Dict[str, str] = {}
|
|
721
837
|
__path = "/_ml/data_frame/_evaluate"
|
|
722
838
|
__query: t.Dict[str, t.Any] = {}
|
|
723
839
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -738,7 +854,13 @@ class MlClient(NamespacedClient):
|
|
|
738
854
|
__body["query"] = query
|
|
739
855
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
740
856
|
return await self.perform_request( # type: ignore[return-value]
|
|
741
|
-
"POST",
|
|
857
|
+
"POST",
|
|
858
|
+
__path,
|
|
859
|
+
params=__query,
|
|
860
|
+
headers=__headers,
|
|
861
|
+
body=__body,
|
|
862
|
+
endpoint_id="ml.evaluate_data_frame",
|
|
863
|
+
path_parts=__path_parts,
|
|
742
864
|
)
|
|
743
865
|
|
|
744
866
|
@_rewrite_parameters(
|
|
@@ -774,7 +896,7 @@ class MlClient(NamespacedClient):
|
|
|
774
896
|
"""
|
|
775
897
|
Explains a data frame analytics config.
|
|
776
898
|
|
|
777
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
899
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/explain-dfanalytics.html>`_
|
|
778
900
|
|
|
779
901
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
780
902
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -804,9 +926,12 @@ class MlClient(NamespacedClient):
|
|
|
804
926
|
:param source: The configuration of how to source the analysis data. It requires
|
|
805
927
|
an index. Optionally, query and _source may be specified.
|
|
806
928
|
"""
|
|
929
|
+
__path_parts: t.Dict[str, str]
|
|
807
930
|
if id not in SKIP_IN_PATH:
|
|
808
|
-
|
|
931
|
+
__path_parts = {"id": _quote(id)}
|
|
932
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_explain'
|
|
809
933
|
else:
|
|
934
|
+
__path_parts = {}
|
|
810
935
|
__path = "/_ml/data_frame/analytics/_explain"
|
|
811
936
|
__query: t.Dict[str, t.Any] = {}
|
|
812
937
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -841,7 +966,13 @@ class MlClient(NamespacedClient):
|
|
|
841
966
|
if __body is not None:
|
|
842
967
|
__headers["content-type"] = "application/json"
|
|
843
968
|
return await self.perform_request( # type: ignore[return-value]
|
|
844
|
-
"POST",
|
|
969
|
+
"POST",
|
|
970
|
+
__path,
|
|
971
|
+
params=__query,
|
|
972
|
+
headers=__headers,
|
|
973
|
+
body=__body,
|
|
974
|
+
endpoint_id="ml.explain_data_frame_analytics",
|
|
975
|
+
path_parts=__path_parts,
|
|
845
976
|
)
|
|
846
977
|
|
|
847
978
|
@_rewrite_parameters(
|
|
@@ -865,7 +996,7 @@ class MlClient(NamespacedClient):
|
|
|
865
996
|
"""
|
|
866
997
|
Forces any buffered data to be processed by the job.
|
|
867
998
|
|
|
868
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
999
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-flush-job.html>`_
|
|
869
1000
|
|
|
870
1001
|
:param job_id: Identifier for the anomaly detection job.
|
|
871
1002
|
:param advance_time: Refer to the description for the `advance_time` query parameter.
|
|
@@ -876,7 +1007,8 @@ class MlClient(NamespacedClient):
|
|
|
876
1007
|
"""
|
|
877
1008
|
if job_id in SKIP_IN_PATH:
|
|
878
1009
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
879
|
-
|
|
1010
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
1011
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_flush'
|
|
880
1012
|
__query: t.Dict[str, t.Any] = {}
|
|
881
1013
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
882
1014
|
if error_trace is not None:
|
|
@@ -904,7 +1036,13 @@ class MlClient(NamespacedClient):
|
|
|
904
1036
|
if __body is not None:
|
|
905
1037
|
__headers["content-type"] = "application/json"
|
|
906
1038
|
return await self.perform_request( # type: ignore[return-value]
|
|
907
|
-
"POST",
|
|
1039
|
+
"POST",
|
|
1040
|
+
__path,
|
|
1041
|
+
params=__query,
|
|
1042
|
+
headers=__headers,
|
|
1043
|
+
body=__body,
|
|
1044
|
+
endpoint_id="ml.flush_job",
|
|
1045
|
+
path_parts=__path_parts,
|
|
908
1046
|
)
|
|
909
1047
|
|
|
910
1048
|
@_rewrite_parameters(
|
|
@@ -926,7 +1064,7 @@ class MlClient(NamespacedClient):
|
|
|
926
1064
|
"""
|
|
927
1065
|
Predicts the future behavior of a time series by using its historical behavior.
|
|
928
1066
|
|
|
929
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1067
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-forecast.html>`_
|
|
930
1068
|
|
|
931
1069
|
:param job_id: Identifier for the anomaly detection job. The job must be open
|
|
932
1070
|
when you create a forecast; otherwise, an error occurs.
|
|
@@ -937,7 +1075,8 @@ class MlClient(NamespacedClient):
|
|
|
937
1075
|
"""
|
|
938
1076
|
if job_id in SKIP_IN_PATH:
|
|
939
1077
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
940
|
-
|
|
1078
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
1079
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_forecast'
|
|
941
1080
|
__query: t.Dict[str, t.Any] = {}
|
|
942
1081
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
943
1082
|
if error_trace is not None:
|
|
@@ -961,7 +1100,13 @@ class MlClient(NamespacedClient):
|
|
|
961
1100
|
if __body is not None:
|
|
962
1101
|
__headers["content-type"] = "application/json"
|
|
963
1102
|
return await self.perform_request( # type: ignore[return-value]
|
|
964
|
-
"POST",
|
|
1103
|
+
"POST",
|
|
1104
|
+
__path,
|
|
1105
|
+
params=__query,
|
|
1106
|
+
headers=__headers,
|
|
1107
|
+
body=__body,
|
|
1108
|
+
endpoint_id="ml.forecast",
|
|
1109
|
+
path_parts=__path_parts,
|
|
965
1110
|
)
|
|
966
1111
|
|
|
967
1112
|
@_rewrite_parameters(
|
|
@@ -1001,7 +1146,7 @@ class MlClient(NamespacedClient):
|
|
|
1001
1146
|
"""
|
|
1002
1147
|
Retrieves anomaly detection job results for one or more buckets.
|
|
1003
1148
|
|
|
1004
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1149
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-bucket.html>`_
|
|
1005
1150
|
|
|
1006
1151
|
:param job_id: Identifier for the anomaly detection job.
|
|
1007
1152
|
:param timestamp: The timestamp of a single bucket result. If you do not specify
|
|
@@ -1021,10 +1166,13 @@ class MlClient(NamespacedClient):
|
|
|
1021
1166
|
"""
|
|
1022
1167
|
if job_id in SKIP_IN_PATH:
|
|
1023
1168
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
1169
|
+
__path_parts: t.Dict[str, str]
|
|
1024
1170
|
if job_id not in SKIP_IN_PATH and timestamp not in SKIP_IN_PATH:
|
|
1025
|
-
|
|
1171
|
+
__path_parts = {"job_id": _quote(job_id), "timestamp": _quote(timestamp)}
|
|
1172
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/buckets/{__path_parts["timestamp"]}'
|
|
1026
1173
|
elif job_id not in SKIP_IN_PATH:
|
|
1027
|
-
|
|
1174
|
+
__path_parts = {"job_id": _quote(job_id)}
|
|
1175
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/buckets'
|
|
1028
1176
|
else:
|
|
1029
1177
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
1030
1178
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -1064,7 +1212,13 @@ class MlClient(NamespacedClient):
|
|
|
1064
1212
|
if __body is not None:
|
|
1065
1213
|
__headers["content-type"] = "application/json"
|
|
1066
1214
|
return await self.perform_request( # type: ignore[return-value]
|
|
1067
|
-
"POST",
|
|
1215
|
+
"POST",
|
|
1216
|
+
__path,
|
|
1217
|
+
params=__query,
|
|
1218
|
+
headers=__headers,
|
|
1219
|
+
body=__body,
|
|
1220
|
+
endpoint_id="ml.get_buckets",
|
|
1221
|
+
path_parts=__path_parts,
|
|
1068
1222
|
)
|
|
1069
1223
|
|
|
1070
1224
|
@_rewrite_parameters(
|
|
@@ -1087,7 +1241,7 @@ class MlClient(NamespacedClient):
|
|
|
1087
1241
|
"""
|
|
1088
1242
|
Retrieves information about the scheduled events in calendars.
|
|
1089
1243
|
|
|
1090
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1244
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-calendar-event.html>`_
|
|
1091
1245
|
|
|
1092
1246
|
:param calendar_id: A string that uniquely identifies a calendar. You can get
|
|
1093
1247
|
information for multiple calendars by using a comma-separated list of ids
|
|
@@ -1102,7 +1256,8 @@ class MlClient(NamespacedClient):
|
|
|
1102
1256
|
"""
|
|
1103
1257
|
if calendar_id in SKIP_IN_PATH:
|
|
1104
1258
|
raise ValueError("Empty value passed for parameter 'calendar_id'")
|
|
1105
|
-
|
|
1259
|
+
__path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)}
|
|
1260
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}/events'
|
|
1106
1261
|
__query: t.Dict[str, t.Any] = {}
|
|
1107
1262
|
if end is not None:
|
|
1108
1263
|
__query["end"] = end
|
|
@@ -1124,7 +1279,12 @@ class MlClient(NamespacedClient):
|
|
|
1124
1279
|
__query["start"] = start
|
|
1125
1280
|
__headers = {"accept": "application/json"}
|
|
1126
1281
|
return await self.perform_request( # type: ignore[return-value]
|
|
1127
|
-
"GET",
|
|
1282
|
+
"GET",
|
|
1283
|
+
__path,
|
|
1284
|
+
params=__query,
|
|
1285
|
+
headers=__headers,
|
|
1286
|
+
endpoint_id="ml.get_calendar_events",
|
|
1287
|
+
path_parts=__path_parts,
|
|
1128
1288
|
)
|
|
1129
1289
|
|
|
1130
1290
|
@_rewrite_parameters(
|
|
@@ -1147,7 +1307,7 @@ class MlClient(NamespacedClient):
|
|
|
1147
1307
|
"""
|
|
1148
1308
|
Retrieves configuration information for calendars.
|
|
1149
1309
|
|
|
1150
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1310
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-calendar.html>`_
|
|
1151
1311
|
|
|
1152
1312
|
:param calendar_id: A string that uniquely identifies a calendar. You can get
|
|
1153
1313
|
information for multiple calendars by using a comma-separated list of ids
|
|
@@ -1159,9 +1319,12 @@ class MlClient(NamespacedClient):
|
|
|
1159
1319
|
:param size: Specifies the maximum number of calendars to obtain. This parameter
|
|
1160
1320
|
is supported only when you omit the calendar identifier.
|
|
1161
1321
|
"""
|
|
1322
|
+
__path_parts: t.Dict[str, str]
|
|
1162
1323
|
if calendar_id not in SKIP_IN_PATH:
|
|
1163
|
-
|
|
1324
|
+
__path_parts = {"calendar_id": _quote(calendar_id)}
|
|
1325
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}'
|
|
1164
1326
|
else:
|
|
1327
|
+
__path_parts = {}
|
|
1165
1328
|
__path = "/_ml/calendars"
|
|
1166
1329
|
__query: t.Dict[str, t.Any] = {}
|
|
1167
1330
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -1186,7 +1349,13 @@ class MlClient(NamespacedClient):
|
|
|
1186
1349
|
if __body is not None:
|
|
1187
1350
|
__headers["content-type"] = "application/json"
|
|
1188
1351
|
return await self.perform_request( # type: ignore[return-value]
|
|
1189
|
-
"POST",
|
|
1352
|
+
"POST",
|
|
1353
|
+
__path,
|
|
1354
|
+
params=__query,
|
|
1355
|
+
headers=__headers,
|
|
1356
|
+
body=__body,
|
|
1357
|
+
endpoint_id="ml.get_calendars",
|
|
1358
|
+
path_parts=__path_parts,
|
|
1190
1359
|
)
|
|
1191
1360
|
|
|
1192
1361
|
@_rewrite_parameters(
|
|
@@ -1211,7 +1380,7 @@ class MlClient(NamespacedClient):
|
|
|
1211
1380
|
"""
|
|
1212
1381
|
Retrieves anomaly detection job results for one or more categories.
|
|
1213
1382
|
|
|
1214
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1383
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-category.html>`_
|
|
1215
1384
|
|
|
1216
1385
|
:param job_id: Identifier for the anomaly detection job.
|
|
1217
1386
|
:param category_id: Identifier for the category, which is unique in the job.
|
|
@@ -1226,10 +1395,18 @@ class MlClient(NamespacedClient):
|
|
|
1226
1395
|
"""
|
|
1227
1396
|
if job_id in SKIP_IN_PATH:
|
|
1228
1397
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
1398
|
+
__path_parts: t.Dict[str, str]
|
|
1229
1399
|
if job_id not in SKIP_IN_PATH and category_id not in SKIP_IN_PATH:
|
|
1230
|
-
|
|
1400
|
+
__path_parts = {
|
|
1401
|
+
"job_id": _quote(job_id),
|
|
1402
|
+
"category_id": _quote(category_id),
|
|
1403
|
+
}
|
|
1404
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/categories/{__path_parts["category_id"]}'
|
|
1231
1405
|
elif job_id not in SKIP_IN_PATH:
|
|
1232
|
-
|
|
1406
|
+
__path_parts = {"job_id": _quote(job_id)}
|
|
1407
|
+
__path = (
|
|
1408
|
+
f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/categories'
|
|
1409
|
+
)
|
|
1233
1410
|
else:
|
|
1234
1411
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
1235
1412
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -1257,7 +1434,13 @@ class MlClient(NamespacedClient):
|
|
|
1257
1434
|
if __body is not None:
|
|
1258
1435
|
__headers["content-type"] = "application/json"
|
|
1259
1436
|
return await self.perform_request( # type: ignore[return-value]
|
|
1260
|
-
"POST",
|
|
1437
|
+
"POST",
|
|
1438
|
+
__path,
|
|
1439
|
+
params=__query,
|
|
1440
|
+
headers=__headers,
|
|
1441
|
+
body=__body,
|
|
1442
|
+
endpoint_id="ml.get_categories",
|
|
1443
|
+
path_parts=__path_parts,
|
|
1261
1444
|
)
|
|
1262
1445
|
|
|
1263
1446
|
@_rewrite_parameters(
|
|
@@ -1279,7 +1462,7 @@ class MlClient(NamespacedClient):
|
|
|
1279
1462
|
"""
|
|
1280
1463
|
Retrieves configuration information for data frame analytics jobs.
|
|
1281
1464
|
|
|
1282
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1465
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-dfanalytics.html>`_
|
|
1283
1466
|
|
|
1284
1467
|
:param id: Identifier for the data frame analytics job. If you do not specify
|
|
1285
1468
|
this option, the API returns information for the first hundred data frame
|
|
@@ -1298,9 +1481,12 @@ class MlClient(NamespacedClient):
|
|
|
1298
1481
|
:param from_: Skips the specified number of data frame analytics jobs.
|
|
1299
1482
|
:param size: Specifies the maximum number of data frame analytics jobs to obtain.
|
|
1300
1483
|
"""
|
|
1484
|
+
__path_parts: t.Dict[str, str]
|
|
1301
1485
|
if id not in SKIP_IN_PATH:
|
|
1302
|
-
|
|
1486
|
+
__path_parts = {"id": _quote(id)}
|
|
1487
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}'
|
|
1303
1488
|
else:
|
|
1489
|
+
__path_parts = {}
|
|
1304
1490
|
__path = "/_ml/data_frame/analytics"
|
|
1305
1491
|
__query: t.Dict[str, t.Any] = {}
|
|
1306
1492
|
if allow_no_match is not None:
|
|
@@ -1321,7 +1507,12 @@ class MlClient(NamespacedClient):
|
|
|
1321
1507
|
__query["size"] = size
|
|
1322
1508
|
__headers = {"accept": "application/json"}
|
|
1323
1509
|
return await self.perform_request( # type: ignore[return-value]
|
|
1324
|
-
"GET",
|
|
1510
|
+
"GET",
|
|
1511
|
+
__path,
|
|
1512
|
+
params=__query,
|
|
1513
|
+
headers=__headers,
|
|
1514
|
+
endpoint_id="ml.get_data_frame_analytics",
|
|
1515
|
+
path_parts=__path_parts,
|
|
1325
1516
|
)
|
|
1326
1517
|
|
|
1327
1518
|
@_rewrite_parameters(
|
|
@@ -1343,7 +1534,7 @@ class MlClient(NamespacedClient):
|
|
|
1343
1534
|
"""
|
|
1344
1535
|
Retrieves usage information for data frame analytics jobs.
|
|
1345
1536
|
|
|
1346
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1537
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-dfanalytics-stats.html>`_
|
|
1347
1538
|
|
|
1348
1539
|
:param id: Identifier for the data frame analytics job. If you do not specify
|
|
1349
1540
|
this option, the API returns information for the first hundred data frame
|
|
@@ -1360,9 +1551,12 @@ class MlClient(NamespacedClient):
|
|
|
1360
1551
|
:param size: Specifies the maximum number of data frame analytics jobs to obtain.
|
|
1361
1552
|
:param verbose: Defines whether the stats response should be verbose.
|
|
1362
1553
|
"""
|
|
1554
|
+
__path_parts: t.Dict[str, str]
|
|
1363
1555
|
if id not in SKIP_IN_PATH:
|
|
1364
|
-
|
|
1556
|
+
__path_parts = {"id": _quote(id)}
|
|
1557
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_stats'
|
|
1365
1558
|
else:
|
|
1559
|
+
__path_parts = {}
|
|
1366
1560
|
__path = "/_ml/data_frame/analytics/_stats"
|
|
1367
1561
|
__query: t.Dict[str, t.Any] = {}
|
|
1368
1562
|
if allow_no_match is not None:
|
|
@@ -1383,7 +1577,12 @@ class MlClient(NamespacedClient):
|
|
|
1383
1577
|
__query["verbose"] = verbose
|
|
1384
1578
|
__headers = {"accept": "application/json"}
|
|
1385
1579
|
return await self.perform_request( # type: ignore[return-value]
|
|
1386
|
-
"GET",
|
|
1580
|
+
"GET",
|
|
1581
|
+
__path,
|
|
1582
|
+
params=__query,
|
|
1583
|
+
headers=__headers,
|
|
1584
|
+
endpoint_id="ml.get_data_frame_analytics_stats",
|
|
1585
|
+
path_parts=__path_parts,
|
|
1387
1586
|
)
|
|
1388
1587
|
|
|
1389
1588
|
@_rewrite_parameters()
|
|
@@ -1400,7 +1599,7 @@ class MlClient(NamespacedClient):
|
|
|
1400
1599
|
"""
|
|
1401
1600
|
Retrieves usage information for datafeeds.
|
|
1402
1601
|
|
|
1403
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1602
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-datafeed-stats.html>`_
|
|
1404
1603
|
|
|
1405
1604
|
:param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier
|
|
1406
1605
|
or a wildcard expression. If you do not specify one of these options, the
|
|
@@ -1413,9 +1612,12 @@ class MlClient(NamespacedClient):
|
|
|
1413
1612
|
when there are partial matches. If this parameter is `false`, the request
|
|
1414
1613
|
returns a `404` status code when there are no matches or only partial matches.
|
|
1415
1614
|
"""
|
|
1615
|
+
__path_parts: t.Dict[str, str]
|
|
1416
1616
|
if datafeed_id not in SKIP_IN_PATH:
|
|
1417
|
-
|
|
1617
|
+
__path_parts = {"datafeed_id": _quote(datafeed_id)}
|
|
1618
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_stats'
|
|
1418
1619
|
else:
|
|
1620
|
+
__path_parts = {}
|
|
1419
1621
|
__path = "/_ml/datafeeds/_stats"
|
|
1420
1622
|
__query: t.Dict[str, t.Any] = {}
|
|
1421
1623
|
if allow_no_match is not None:
|
|
@@ -1430,7 +1632,12 @@ class MlClient(NamespacedClient):
|
|
|
1430
1632
|
__query["pretty"] = pretty
|
|
1431
1633
|
__headers = {"accept": "application/json"}
|
|
1432
1634
|
return await self.perform_request( # type: ignore[return-value]
|
|
1433
|
-
"GET",
|
|
1635
|
+
"GET",
|
|
1636
|
+
__path,
|
|
1637
|
+
params=__query,
|
|
1638
|
+
headers=__headers,
|
|
1639
|
+
endpoint_id="ml.get_datafeed_stats",
|
|
1640
|
+
path_parts=__path_parts,
|
|
1434
1641
|
)
|
|
1435
1642
|
|
|
1436
1643
|
@_rewrite_parameters()
|
|
@@ -1448,7 +1655,7 @@ class MlClient(NamespacedClient):
|
|
|
1448
1655
|
"""
|
|
1449
1656
|
Retrieves configuration information for datafeeds.
|
|
1450
1657
|
|
|
1451
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1658
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-datafeed.html>`_
|
|
1452
1659
|
|
|
1453
1660
|
:param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier
|
|
1454
1661
|
or a wildcard expression. If you do not specify one of these options, the
|
|
@@ -1464,9 +1671,12 @@ class MlClient(NamespacedClient):
|
|
|
1464
1671
|
the configuration on retrieval. This allows the configuration to be in an
|
|
1465
1672
|
acceptable format to be retrieved and then added to another cluster.
|
|
1466
1673
|
"""
|
|
1674
|
+
__path_parts: t.Dict[str, str]
|
|
1467
1675
|
if datafeed_id not in SKIP_IN_PATH:
|
|
1468
|
-
|
|
1676
|
+
__path_parts = {"datafeed_id": _quote(datafeed_id)}
|
|
1677
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}'
|
|
1469
1678
|
else:
|
|
1679
|
+
__path_parts = {}
|
|
1470
1680
|
__path = "/_ml/datafeeds"
|
|
1471
1681
|
__query: t.Dict[str, t.Any] = {}
|
|
1472
1682
|
if allow_no_match is not None:
|
|
@@ -1483,7 +1693,12 @@ class MlClient(NamespacedClient):
|
|
|
1483
1693
|
__query["pretty"] = pretty
|
|
1484
1694
|
__headers = {"accept": "application/json"}
|
|
1485
1695
|
return await self.perform_request( # type: ignore[return-value]
|
|
1486
|
-
"GET",
|
|
1696
|
+
"GET",
|
|
1697
|
+
__path,
|
|
1698
|
+
params=__query,
|
|
1699
|
+
headers=__headers,
|
|
1700
|
+
endpoint_id="ml.get_datafeeds",
|
|
1701
|
+
path_parts=__path_parts,
|
|
1487
1702
|
)
|
|
1488
1703
|
|
|
1489
1704
|
@_rewrite_parameters(
|
|
@@ -1503,15 +1718,18 @@ class MlClient(NamespacedClient):
|
|
|
1503
1718
|
"""
|
|
1504
1719
|
Retrieves filters.
|
|
1505
1720
|
|
|
1506
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1721
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-filter.html>`_
|
|
1507
1722
|
|
|
1508
1723
|
:param filter_id: A string that uniquely identifies a filter.
|
|
1509
1724
|
:param from_: Skips the specified number of filters.
|
|
1510
1725
|
:param size: Specifies the maximum number of filters to obtain.
|
|
1511
1726
|
"""
|
|
1727
|
+
__path_parts: t.Dict[str, str]
|
|
1512
1728
|
if filter_id not in SKIP_IN_PATH:
|
|
1513
|
-
|
|
1729
|
+
__path_parts = {"filter_id": _quote(filter_id)}
|
|
1730
|
+
__path = f'/_ml/filters/{__path_parts["filter_id"]}'
|
|
1514
1731
|
else:
|
|
1732
|
+
__path_parts = {}
|
|
1515
1733
|
__path = "/_ml/filters"
|
|
1516
1734
|
__query: t.Dict[str, t.Any] = {}
|
|
1517
1735
|
if error_trace is not None:
|
|
@@ -1528,7 +1746,12 @@ class MlClient(NamespacedClient):
|
|
|
1528
1746
|
__query["size"] = size
|
|
1529
1747
|
__headers = {"accept": "application/json"}
|
|
1530
1748
|
return await self.perform_request( # type: ignore[return-value]
|
|
1531
|
-
"GET",
|
|
1749
|
+
"GET",
|
|
1750
|
+
__path,
|
|
1751
|
+
params=__query,
|
|
1752
|
+
headers=__headers,
|
|
1753
|
+
endpoint_id="ml.get_filters",
|
|
1754
|
+
path_parts=__path_parts,
|
|
1532
1755
|
)
|
|
1533
1756
|
|
|
1534
1757
|
@_rewrite_parameters(
|
|
@@ -1557,7 +1780,7 @@ class MlClient(NamespacedClient):
|
|
|
1557
1780
|
"""
|
|
1558
1781
|
Retrieves anomaly detection job results for one or more influencers.
|
|
1559
1782
|
|
|
1560
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1783
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-influencer.html>`_
|
|
1561
1784
|
|
|
1562
1785
|
:param job_id: Identifier for the anomaly detection job.
|
|
1563
1786
|
:param desc: If true, the results are sorted in descending order.
|
|
@@ -1578,7 +1801,8 @@ class MlClient(NamespacedClient):
|
|
|
1578
1801
|
"""
|
|
1579
1802
|
if job_id in SKIP_IN_PATH:
|
|
1580
1803
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
1581
|
-
|
|
1804
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
1805
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/influencers'
|
|
1582
1806
|
__query: t.Dict[str, t.Any] = {}
|
|
1583
1807
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
1584
1808
|
if desc is not None:
|
|
@@ -1614,7 +1838,13 @@ class MlClient(NamespacedClient):
|
|
|
1614
1838
|
if __body is not None:
|
|
1615
1839
|
__headers["content-type"] = "application/json"
|
|
1616
1840
|
return await self.perform_request( # type: ignore[return-value]
|
|
1617
|
-
"POST",
|
|
1841
|
+
"POST",
|
|
1842
|
+
__path,
|
|
1843
|
+
params=__query,
|
|
1844
|
+
headers=__headers,
|
|
1845
|
+
body=__body,
|
|
1846
|
+
endpoint_id="ml.get_influencers",
|
|
1847
|
+
path_parts=__path_parts,
|
|
1618
1848
|
)
|
|
1619
1849
|
|
|
1620
1850
|
@_rewrite_parameters()
|
|
@@ -1631,7 +1861,7 @@ class MlClient(NamespacedClient):
|
|
|
1631
1861
|
"""
|
|
1632
1862
|
Retrieves usage information for anomaly detection jobs.
|
|
1633
1863
|
|
|
1634
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1864
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-job-stats.html>`_
|
|
1635
1865
|
|
|
1636
1866
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
1637
1867
|
a group name, a comma-separated list of jobs, or a wildcard expression. If
|
|
@@ -1645,9 +1875,12 @@ class MlClient(NamespacedClient):
|
|
|
1645
1875
|
partial matches. If `false`, the API returns a `404` status code when there
|
|
1646
1876
|
are no matches or only partial matches.
|
|
1647
1877
|
"""
|
|
1878
|
+
__path_parts: t.Dict[str, str]
|
|
1648
1879
|
if job_id not in SKIP_IN_PATH:
|
|
1649
|
-
|
|
1880
|
+
__path_parts = {"job_id": _quote(job_id)}
|
|
1881
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_stats'
|
|
1650
1882
|
else:
|
|
1883
|
+
__path_parts = {}
|
|
1651
1884
|
__path = "/_ml/anomaly_detectors/_stats"
|
|
1652
1885
|
__query: t.Dict[str, t.Any] = {}
|
|
1653
1886
|
if allow_no_match is not None:
|
|
@@ -1662,7 +1895,12 @@ class MlClient(NamespacedClient):
|
|
|
1662
1895
|
__query["pretty"] = pretty
|
|
1663
1896
|
__headers = {"accept": "application/json"}
|
|
1664
1897
|
return await self.perform_request( # type: ignore[return-value]
|
|
1665
|
-
"GET",
|
|
1898
|
+
"GET",
|
|
1899
|
+
__path,
|
|
1900
|
+
params=__query,
|
|
1901
|
+
headers=__headers,
|
|
1902
|
+
endpoint_id="ml.get_job_stats",
|
|
1903
|
+
path_parts=__path_parts,
|
|
1666
1904
|
)
|
|
1667
1905
|
|
|
1668
1906
|
@_rewrite_parameters()
|
|
@@ -1680,7 +1918,7 @@ class MlClient(NamespacedClient):
|
|
|
1680
1918
|
"""
|
|
1681
1919
|
Retrieves configuration information for anomaly detection jobs.
|
|
1682
1920
|
|
|
1683
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1921
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-job.html>`_
|
|
1684
1922
|
|
|
1685
1923
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
1686
1924
|
a group name, or a wildcard expression. If you do not specify one of these
|
|
@@ -1696,9 +1934,12 @@ class MlClient(NamespacedClient):
|
|
|
1696
1934
|
the configuration on retrieval. This allows the configuration to be in an
|
|
1697
1935
|
acceptable format to be retrieved and then added to another cluster.
|
|
1698
1936
|
"""
|
|
1937
|
+
__path_parts: t.Dict[str, str]
|
|
1699
1938
|
if job_id not in SKIP_IN_PATH:
|
|
1700
|
-
|
|
1939
|
+
__path_parts = {"job_id": _quote(job_id)}
|
|
1940
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}'
|
|
1701
1941
|
else:
|
|
1942
|
+
__path_parts = {}
|
|
1702
1943
|
__path = "/_ml/anomaly_detectors"
|
|
1703
1944
|
__query: t.Dict[str, t.Any] = {}
|
|
1704
1945
|
if allow_no_match is not None:
|
|
@@ -1715,7 +1956,12 @@ class MlClient(NamespacedClient):
|
|
|
1715
1956
|
__query["pretty"] = pretty
|
|
1716
1957
|
__headers = {"accept": "application/json"}
|
|
1717
1958
|
return await self.perform_request( # type: ignore[return-value]
|
|
1718
|
-
"GET",
|
|
1959
|
+
"GET",
|
|
1960
|
+
__path,
|
|
1961
|
+
params=__query,
|
|
1962
|
+
headers=__headers,
|
|
1963
|
+
endpoint_id="ml.get_jobs",
|
|
1964
|
+
path_parts=__path_parts,
|
|
1719
1965
|
)
|
|
1720
1966
|
|
|
1721
1967
|
@_rewrite_parameters()
|
|
@@ -1735,7 +1981,7 @@ class MlClient(NamespacedClient):
|
|
|
1735
1981
|
"""
|
|
1736
1982
|
Returns information on how ML is using memory.
|
|
1737
1983
|
|
|
1738
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1984
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-ml-memory.html>`_
|
|
1739
1985
|
|
|
1740
1986
|
:param node_id: The names of particular nodes in the cluster to target. For example,
|
|
1741
1987
|
`nodeId1,nodeId2` or `ml:true`
|
|
@@ -1745,9 +1991,12 @@ class MlClient(NamespacedClient):
|
|
|
1745
1991
|
:param timeout: Period to wait for a response. If no response is received before
|
|
1746
1992
|
the timeout expires, the request fails and returns an error.
|
|
1747
1993
|
"""
|
|
1994
|
+
__path_parts: t.Dict[str, str]
|
|
1748
1995
|
if node_id not in SKIP_IN_PATH:
|
|
1749
|
-
|
|
1996
|
+
__path_parts = {"node_id": _quote(node_id)}
|
|
1997
|
+
__path = f'/_ml/memory/{__path_parts["node_id"]}/_stats'
|
|
1750
1998
|
else:
|
|
1999
|
+
__path_parts = {}
|
|
1751
2000
|
__path = "/_ml/memory/_stats"
|
|
1752
2001
|
__query: t.Dict[str, t.Any] = {}
|
|
1753
2002
|
if error_trace is not None:
|
|
@@ -1764,7 +2013,12 @@ class MlClient(NamespacedClient):
|
|
|
1764
2013
|
__query["timeout"] = timeout
|
|
1765
2014
|
__headers = {"accept": "application/json"}
|
|
1766
2015
|
return await self.perform_request( # type: ignore[return-value]
|
|
1767
|
-
"GET",
|
|
2016
|
+
"GET",
|
|
2017
|
+
__path,
|
|
2018
|
+
params=__query,
|
|
2019
|
+
headers=__headers,
|
|
2020
|
+
endpoint_id="ml.get_memory_stats",
|
|
2021
|
+
path_parts=__path_parts,
|
|
1768
2022
|
)
|
|
1769
2023
|
|
|
1770
2024
|
@_rewrite_parameters()
|
|
@@ -1782,7 +2036,7 @@ class MlClient(NamespacedClient):
|
|
|
1782
2036
|
"""
|
|
1783
2037
|
Gets stats for anomaly detection job model snapshot upgrades that are in progress.
|
|
1784
2038
|
|
|
1785
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2039
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-job-model-snapshot-upgrade-stats.html>`_
|
|
1786
2040
|
|
|
1787
2041
|
:param job_id: Identifier for the anomaly detection job.
|
|
1788
2042
|
:param snapshot_id: A numerical character string that uniquely identifies the
|
|
@@ -1802,7 +2056,11 @@ class MlClient(NamespacedClient):
|
|
|
1802
2056
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
1803
2057
|
if snapshot_id in SKIP_IN_PATH:
|
|
1804
2058
|
raise ValueError("Empty value passed for parameter 'snapshot_id'")
|
|
1805
|
-
|
|
2059
|
+
__path_parts: t.Dict[str, str] = {
|
|
2060
|
+
"job_id": _quote(job_id),
|
|
2061
|
+
"snapshot_id": _quote(snapshot_id),
|
|
2062
|
+
}
|
|
2063
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_upgrade/_stats'
|
|
1806
2064
|
__query: t.Dict[str, t.Any] = {}
|
|
1807
2065
|
if allow_no_match is not None:
|
|
1808
2066
|
__query["allow_no_match"] = allow_no_match
|
|
@@ -1816,7 +2074,12 @@ class MlClient(NamespacedClient):
|
|
|
1816
2074
|
__query["pretty"] = pretty
|
|
1817
2075
|
__headers = {"accept": "application/json"}
|
|
1818
2076
|
return await self.perform_request( # type: ignore[return-value]
|
|
1819
|
-
"GET",
|
|
2077
|
+
"GET",
|
|
2078
|
+
__path,
|
|
2079
|
+
params=__query,
|
|
2080
|
+
headers=__headers,
|
|
2081
|
+
endpoint_id="ml.get_model_snapshot_upgrade_stats",
|
|
2082
|
+
path_parts=__path_parts,
|
|
1820
2083
|
)
|
|
1821
2084
|
|
|
1822
2085
|
@_rewrite_parameters(
|
|
@@ -1844,7 +2107,7 @@ class MlClient(NamespacedClient):
|
|
|
1844
2107
|
"""
|
|
1845
2108
|
Retrieves information about model snapshots.
|
|
1846
2109
|
|
|
1847
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2110
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-snapshot.html>`_
|
|
1848
2111
|
|
|
1849
2112
|
:param job_id: Identifier for the anomaly detection job.
|
|
1850
2113
|
:param snapshot_id: A numerical character string that uniquely identifies the
|
|
@@ -1862,10 +2125,16 @@ class MlClient(NamespacedClient):
|
|
|
1862
2125
|
"""
|
|
1863
2126
|
if job_id in SKIP_IN_PATH:
|
|
1864
2127
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
2128
|
+
__path_parts: t.Dict[str, str]
|
|
1865
2129
|
if job_id not in SKIP_IN_PATH and snapshot_id not in SKIP_IN_PATH:
|
|
1866
|
-
|
|
2130
|
+
__path_parts = {
|
|
2131
|
+
"job_id": _quote(job_id),
|
|
2132
|
+
"snapshot_id": _quote(snapshot_id),
|
|
2133
|
+
}
|
|
2134
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}'
|
|
1867
2135
|
elif job_id not in SKIP_IN_PATH:
|
|
1868
|
-
|
|
2136
|
+
__path_parts = {"job_id": _quote(job_id)}
|
|
2137
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots'
|
|
1869
2138
|
else:
|
|
1870
2139
|
raise ValueError("Couldn't find a path for the given parameters")
|
|
1871
2140
|
__query: t.Dict[str, t.Any] = {}
|
|
@@ -1899,7 +2168,13 @@ class MlClient(NamespacedClient):
|
|
|
1899
2168
|
if __body is not None:
|
|
1900
2169
|
__headers["content-type"] = "application/json"
|
|
1901
2170
|
return await self.perform_request( # type: ignore[return-value]
|
|
1902
|
-
"POST",
|
|
2171
|
+
"POST",
|
|
2172
|
+
__path,
|
|
2173
|
+
params=__query,
|
|
2174
|
+
headers=__headers,
|
|
2175
|
+
body=__body,
|
|
2176
|
+
endpoint_id="ml.get_model_snapshots",
|
|
2177
|
+
path_parts=__path_parts,
|
|
1903
2178
|
)
|
|
1904
2179
|
|
|
1905
2180
|
@_rewrite_parameters(
|
|
@@ -1934,7 +2209,7 @@ class MlClient(NamespacedClient):
|
|
|
1934
2209
|
Retrieves overall bucket results that summarize the bucket results of multiple
|
|
1935
2210
|
anomaly detection jobs.
|
|
1936
2211
|
|
|
1937
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2212
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-overall-buckets.html>`_
|
|
1938
2213
|
|
|
1939
2214
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
1940
2215
|
a group name, a comma-separated list of jobs or groups, or a wildcard expression.
|
|
@@ -1953,7 +2228,10 @@ class MlClient(NamespacedClient):
|
|
|
1953
2228
|
"""
|
|
1954
2229
|
if job_id in SKIP_IN_PATH:
|
|
1955
2230
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
1956
|
-
|
|
2231
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
2232
|
+
__path = (
|
|
2233
|
+
f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/overall_buckets'
|
|
2234
|
+
)
|
|
1957
2235
|
__query: t.Dict[str, t.Any] = {}
|
|
1958
2236
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
1959
2237
|
if error_trace is not None:
|
|
@@ -1985,7 +2263,13 @@ class MlClient(NamespacedClient):
|
|
|
1985
2263
|
if __body is not None:
|
|
1986
2264
|
__headers["content-type"] = "application/json"
|
|
1987
2265
|
return await self.perform_request( # type: ignore[return-value]
|
|
1988
|
-
"POST",
|
|
2266
|
+
"POST",
|
|
2267
|
+
__path,
|
|
2268
|
+
params=__query,
|
|
2269
|
+
headers=__headers,
|
|
2270
|
+
body=__body,
|
|
2271
|
+
endpoint_id="ml.get_overall_buckets",
|
|
2272
|
+
path_parts=__path_parts,
|
|
1989
2273
|
)
|
|
1990
2274
|
|
|
1991
2275
|
@_rewrite_parameters(
|
|
@@ -2022,7 +2306,7 @@ class MlClient(NamespacedClient):
|
|
|
2022
2306
|
"""
|
|
2023
2307
|
Retrieves anomaly records for an anomaly detection job.
|
|
2024
2308
|
|
|
2025
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2309
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-get-record.html>`_
|
|
2026
2310
|
|
|
2027
2311
|
:param job_id: Identifier for the anomaly detection job.
|
|
2028
2312
|
:param desc: Refer to the description for the `desc` query parameter.
|
|
@@ -2038,7 +2322,8 @@ class MlClient(NamespacedClient):
|
|
|
2038
2322
|
"""
|
|
2039
2323
|
if job_id in SKIP_IN_PATH:
|
|
2040
2324
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
2041
|
-
|
|
2325
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
2326
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/results/records'
|
|
2042
2327
|
__query: t.Dict[str, t.Any] = {}
|
|
2043
2328
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2044
2329
|
if error_trace is not None:
|
|
@@ -2074,7 +2359,13 @@ class MlClient(NamespacedClient):
|
|
|
2074
2359
|
if __body is not None:
|
|
2075
2360
|
__headers["content-type"] = "application/json"
|
|
2076
2361
|
return await self.perform_request( # type: ignore[return-value]
|
|
2077
|
-
"POST",
|
|
2362
|
+
"POST",
|
|
2363
|
+
__path,
|
|
2364
|
+
params=__query,
|
|
2365
|
+
headers=__headers,
|
|
2366
|
+
body=__body,
|
|
2367
|
+
endpoint_id="ml.get_records",
|
|
2368
|
+
path_parts=__path_parts,
|
|
2078
2369
|
)
|
|
2079
2370
|
|
|
2080
2371
|
@_rewrite_parameters(
|
|
@@ -2104,7 +2395,7 @@ class MlClient(NamespacedClient):
|
|
|
2104
2395
|
"""
|
|
2105
2396
|
Retrieves configuration information for a trained inference model.
|
|
2106
2397
|
|
|
2107
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2398
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-trained-models.html>`_
|
|
2108
2399
|
|
|
2109
2400
|
:param model_id: The unique identifier of the trained model.
|
|
2110
2401
|
:param allow_no_match: Specifies what to do when the request: - Contains wildcard
|
|
@@ -2126,9 +2417,12 @@ class MlClient(NamespacedClient):
|
|
|
2126
2417
|
tags, or none. When supplied, only trained models that contain all the supplied
|
|
2127
2418
|
tags are returned.
|
|
2128
2419
|
"""
|
|
2420
|
+
__path_parts: t.Dict[str, str]
|
|
2129
2421
|
if model_id not in SKIP_IN_PATH:
|
|
2130
|
-
|
|
2422
|
+
__path_parts = {"model_id": _quote(model_id)}
|
|
2423
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}'
|
|
2131
2424
|
else:
|
|
2425
|
+
__path_parts = {}
|
|
2132
2426
|
__path = "/_ml/trained_models"
|
|
2133
2427
|
__query: t.Dict[str, t.Any] = {}
|
|
2134
2428
|
if allow_no_match is not None:
|
|
@@ -2155,7 +2449,12 @@ class MlClient(NamespacedClient):
|
|
|
2155
2449
|
__query["tags"] = tags
|
|
2156
2450
|
__headers = {"accept": "application/json"}
|
|
2157
2451
|
return await self.perform_request( # type: ignore[return-value]
|
|
2158
|
-
"GET",
|
|
2452
|
+
"GET",
|
|
2453
|
+
__path,
|
|
2454
|
+
params=__query,
|
|
2455
|
+
headers=__headers,
|
|
2456
|
+
endpoint_id="ml.get_trained_models",
|
|
2457
|
+
path_parts=__path_parts,
|
|
2159
2458
|
)
|
|
2160
2459
|
|
|
2161
2460
|
@_rewrite_parameters(
|
|
@@ -2176,7 +2475,7 @@ class MlClient(NamespacedClient):
|
|
|
2176
2475
|
"""
|
|
2177
2476
|
Retrieves usage information for trained inference models.
|
|
2178
2477
|
|
|
2179
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2478
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-trained-models-stats.html>`_
|
|
2180
2479
|
|
|
2181
2480
|
:param model_id: The unique identifier of the trained model or a model alias.
|
|
2182
2481
|
It can be a comma-separated list or a wildcard expression.
|
|
@@ -2188,9 +2487,12 @@ class MlClient(NamespacedClient):
|
|
|
2188
2487
|
:param from_: Skips the specified number of models.
|
|
2189
2488
|
:param size: Specifies the maximum number of models to obtain.
|
|
2190
2489
|
"""
|
|
2490
|
+
__path_parts: t.Dict[str, str]
|
|
2191
2491
|
if model_id not in SKIP_IN_PATH:
|
|
2192
|
-
|
|
2492
|
+
__path_parts = {"model_id": _quote(model_id)}
|
|
2493
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/_stats'
|
|
2193
2494
|
else:
|
|
2495
|
+
__path_parts = {}
|
|
2194
2496
|
__path = "/_ml/trained_models/_stats"
|
|
2195
2497
|
__query: t.Dict[str, t.Any] = {}
|
|
2196
2498
|
if allow_no_match is not None:
|
|
@@ -2209,7 +2511,12 @@ class MlClient(NamespacedClient):
|
|
|
2209
2511
|
__query["size"] = size
|
|
2210
2512
|
__headers = {"accept": "application/json"}
|
|
2211
2513
|
return await self.perform_request( # type: ignore[return-value]
|
|
2212
|
-
"GET",
|
|
2514
|
+
"GET",
|
|
2515
|
+
__path,
|
|
2516
|
+
params=__query,
|
|
2517
|
+
headers=__headers,
|
|
2518
|
+
endpoint_id="ml.get_trained_models_stats",
|
|
2519
|
+
path_parts=__path_parts,
|
|
2213
2520
|
)
|
|
2214
2521
|
|
|
2215
2522
|
@_rewrite_parameters(
|
|
@@ -2231,7 +2538,7 @@ class MlClient(NamespacedClient):
|
|
|
2231
2538
|
"""
|
|
2232
2539
|
Evaluate a trained model.
|
|
2233
2540
|
|
|
2234
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2541
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/infer-trained-model.html>`_
|
|
2235
2542
|
|
|
2236
2543
|
:param model_id: The unique identifier of the trained model.
|
|
2237
2544
|
:param docs: An array of objects to pass to the model for inference. The objects
|
|
@@ -2246,7 +2553,8 @@ class MlClient(NamespacedClient):
|
|
|
2246
2553
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
2247
2554
|
if docs is None and body is None:
|
|
2248
2555
|
raise ValueError("Empty value passed for parameter 'docs'")
|
|
2249
|
-
|
|
2556
|
+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
2557
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/_infer'
|
|
2250
2558
|
__query: t.Dict[str, t.Any] = {}
|
|
2251
2559
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2252
2560
|
if error_trace is not None:
|
|
@@ -2266,7 +2574,13 @@ class MlClient(NamespacedClient):
|
|
|
2266
2574
|
__body["inference_config"] = inference_config
|
|
2267
2575
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2268
2576
|
return await self.perform_request( # type: ignore[return-value]
|
|
2269
|
-
"POST",
|
|
2577
|
+
"POST",
|
|
2578
|
+
__path,
|
|
2579
|
+
params=__query,
|
|
2580
|
+
headers=__headers,
|
|
2581
|
+
body=__body,
|
|
2582
|
+
endpoint_id="ml.infer_trained_model",
|
|
2583
|
+
path_parts=__path_parts,
|
|
2270
2584
|
)
|
|
2271
2585
|
|
|
2272
2586
|
@_rewrite_parameters()
|
|
@@ -2281,8 +2595,9 @@ class MlClient(NamespacedClient):
|
|
|
2281
2595
|
"""
|
|
2282
2596
|
Returns defaults and limits used by machine learning.
|
|
2283
2597
|
|
|
2284
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2598
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-ml-info.html>`_
|
|
2285
2599
|
"""
|
|
2600
|
+
__path_parts: t.Dict[str, str] = {}
|
|
2286
2601
|
__path = "/_ml/info"
|
|
2287
2602
|
__query: t.Dict[str, t.Any] = {}
|
|
2288
2603
|
if error_trace is not None:
|
|
@@ -2295,7 +2610,12 @@ class MlClient(NamespacedClient):
|
|
|
2295
2610
|
__query["pretty"] = pretty
|
|
2296
2611
|
__headers = {"accept": "application/json"}
|
|
2297
2612
|
return await self.perform_request( # type: ignore[return-value]
|
|
2298
|
-
"GET",
|
|
2613
|
+
"GET",
|
|
2614
|
+
__path,
|
|
2615
|
+
params=__query,
|
|
2616
|
+
headers=__headers,
|
|
2617
|
+
endpoint_id="ml.info",
|
|
2618
|
+
path_parts=__path_parts,
|
|
2299
2619
|
)
|
|
2300
2620
|
|
|
2301
2621
|
@_rewrite_parameters(
|
|
@@ -2315,14 +2635,15 @@ class MlClient(NamespacedClient):
|
|
|
2315
2635
|
"""
|
|
2316
2636
|
Opens one or more anomaly detection jobs.
|
|
2317
2637
|
|
|
2318
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2638
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-open-job.html>`_
|
|
2319
2639
|
|
|
2320
2640
|
:param job_id: Identifier for the anomaly detection job.
|
|
2321
2641
|
:param timeout: Refer to the description for the `timeout` query parameter.
|
|
2322
2642
|
"""
|
|
2323
2643
|
if job_id in SKIP_IN_PATH:
|
|
2324
2644
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
2325
|
-
|
|
2645
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
2646
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_open'
|
|
2326
2647
|
__query: t.Dict[str, t.Any] = {}
|
|
2327
2648
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2328
2649
|
if error_trace is not None:
|
|
@@ -2342,7 +2663,13 @@ class MlClient(NamespacedClient):
|
|
|
2342
2663
|
if __body is not None:
|
|
2343
2664
|
__headers["content-type"] = "application/json"
|
|
2344
2665
|
return await self.perform_request( # type: ignore[return-value]
|
|
2345
|
-
"POST",
|
|
2666
|
+
"POST",
|
|
2667
|
+
__path,
|
|
2668
|
+
params=__query,
|
|
2669
|
+
headers=__headers,
|
|
2670
|
+
body=__body,
|
|
2671
|
+
endpoint_id="ml.open_job",
|
|
2672
|
+
path_parts=__path_parts,
|
|
2346
2673
|
)
|
|
2347
2674
|
|
|
2348
2675
|
@_rewrite_parameters(
|
|
@@ -2362,7 +2689,7 @@ class MlClient(NamespacedClient):
|
|
|
2362
2689
|
"""
|
|
2363
2690
|
Posts scheduled events in a calendar.
|
|
2364
2691
|
|
|
2365
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2692
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-post-calendar-event.html>`_
|
|
2366
2693
|
|
|
2367
2694
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
2368
2695
|
:param events: A list of one of more scheduled events. The event’s start and
|
|
@@ -2373,7 +2700,8 @@ class MlClient(NamespacedClient):
|
|
|
2373
2700
|
raise ValueError("Empty value passed for parameter 'calendar_id'")
|
|
2374
2701
|
if events is None and body is None:
|
|
2375
2702
|
raise ValueError("Empty value passed for parameter 'events'")
|
|
2376
|
-
|
|
2703
|
+
__path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)}
|
|
2704
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}/events'
|
|
2377
2705
|
__query: t.Dict[str, t.Any] = {}
|
|
2378
2706
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2379
2707
|
if error_trace is not None:
|
|
@@ -2389,7 +2717,13 @@ class MlClient(NamespacedClient):
|
|
|
2389
2717
|
__body["events"] = events
|
|
2390
2718
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2391
2719
|
return await self.perform_request( # type: ignore[return-value]
|
|
2392
|
-
"POST",
|
|
2720
|
+
"POST",
|
|
2721
|
+
__path,
|
|
2722
|
+
params=__query,
|
|
2723
|
+
headers=__headers,
|
|
2724
|
+
body=__body,
|
|
2725
|
+
endpoint_id="ml.post_calendar_events",
|
|
2726
|
+
path_parts=__path_parts,
|
|
2393
2727
|
)
|
|
2394
2728
|
|
|
2395
2729
|
@_rewrite_parameters(
|
|
@@ -2411,7 +2745,7 @@ class MlClient(NamespacedClient):
|
|
|
2411
2745
|
"""
|
|
2412
2746
|
Sends data to an anomaly detection job for analysis.
|
|
2413
2747
|
|
|
2414
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2748
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-post-data.html>`_
|
|
2415
2749
|
|
|
2416
2750
|
:param job_id: Identifier for the anomaly detection job. The job must have a
|
|
2417
2751
|
state of open to receive and process the data.
|
|
@@ -2427,7 +2761,8 @@ class MlClient(NamespacedClient):
|
|
|
2427
2761
|
)
|
|
2428
2762
|
elif data is not None and body is not None:
|
|
2429
2763
|
raise ValueError("Cannot set both 'data' and 'body'")
|
|
2430
|
-
|
|
2764
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
2765
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_data'
|
|
2431
2766
|
__query: t.Dict[str, t.Any] = {}
|
|
2432
2767
|
if error_trace is not None:
|
|
2433
2768
|
__query["error_trace"] = error_trace
|
|
@@ -2447,7 +2782,13 @@ class MlClient(NamespacedClient):
|
|
|
2447
2782
|
"content-type": "application/x-ndjson",
|
|
2448
2783
|
}
|
|
2449
2784
|
return await self.perform_request( # type: ignore[return-value]
|
|
2450
|
-
"POST",
|
|
2785
|
+
"POST",
|
|
2786
|
+
__path,
|
|
2787
|
+
params=__query,
|
|
2788
|
+
headers=__headers,
|
|
2789
|
+
body=__body,
|
|
2790
|
+
endpoint_id="ml.post_data",
|
|
2791
|
+
path_parts=__path_parts,
|
|
2451
2792
|
)
|
|
2452
2793
|
|
|
2453
2794
|
@_rewrite_parameters(
|
|
@@ -2467,16 +2808,19 @@ class MlClient(NamespacedClient):
|
|
|
2467
2808
|
"""
|
|
2468
2809
|
Previews that will be analyzed given a data frame analytics config.
|
|
2469
2810
|
|
|
2470
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2811
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/preview-dfanalytics.html>`_
|
|
2471
2812
|
|
|
2472
2813
|
:param id: Identifier for the data frame analytics job.
|
|
2473
2814
|
:param config: A data frame analytics config as described in create data frame
|
|
2474
2815
|
analytics jobs. Note that `id` and `dest` don’t need to be provided in the
|
|
2475
2816
|
context of this API.
|
|
2476
2817
|
"""
|
|
2818
|
+
__path_parts: t.Dict[str, str]
|
|
2477
2819
|
if id not in SKIP_IN_PATH:
|
|
2478
|
-
|
|
2820
|
+
__path_parts = {"id": _quote(id)}
|
|
2821
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_preview'
|
|
2479
2822
|
else:
|
|
2823
|
+
__path_parts = {}
|
|
2480
2824
|
__path = "/_ml/data_frame/analytics/_preview"
|
|
2481
2825
|
__query: t.Dict[str, t.Any] = {}
|
|
2482
2826
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2497,7 +2841,13 @@ class MlClient(NamespacedClient):
|
|
|
2497
2841
|
if __body is not None:
|
|
2498
2842
|
__headers["content-type"] = "application/json"
|
|
2499
2843
|
return await self.perform_request( # type: ignore[return-value]
|
|
2500
|
-
"POST",
|
|
2844
|
+
"POST",
|
|
2845
|
+
__path,
|
|
2846
|
+
params=__query,
|
|
2847
|
+
headers=__headers,
|
|
2848
|
+
body=__body,
|
|
2849
|
+
endpoint_id="ml.preview_data_frame_analytics",
|
|
2850
|
+
path_parts=__path_parts,
|
|
2501
2851
|
)
|
|
2502
2852
|
|
|
2503
2853
|
@_rewrite_parameters(
|
|
@@ -2520,7 +2870,7 @@ class MlClient(NamespacedClient):
|
|
|
2520
2870
|
"""
|
|
2521
2871
|
Previews a datafeed.
|
|
2522
2872
|
|
|
2523
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2873
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-preview-datafeed.html>`_
|
|
2524
2874
|
|
|
2525
2875
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
2526
2876
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -2537,9 +2887,12 @@ class MlClient(NamespacedClient):
|
|
|
2537
2887
|
object unless you also supply a `datafeed_config` object.
|
|
2538
2888
|
:param start: The start time from where the datafeed preview should begin
|
|
2539
2889
|
"""
|
|
2890
|
+
__path_parts: t.Dict[str, str]
|
|
2540
2891
|
if datafeed_id not in SKIP_IN_PATH:
|
|
2541
|
-
|
|
2892
|
+
__path_parts = {"datafeed_id": _quote(datafeed_id)}
|
|
2893
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_preview'
|
|
2542
2894
|
else:
|
|
2895
|
+
__path_parts = {}
|
|
2543
2896
|
__path = "/_ml/datafeeds/_preview"
|
|
2544
2897
|
__query: t.Dict[str, t.Any] = {}
|
|
2545
2898
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -2566,7 +2919,13 @@ class MlClient(NamespacedClient):
|
|
|
2566
2919
|
if __body is not None:
|
|
2567
2920
|
__headers["content-type"] = "application/json"
|
|
2568
2921
|
return await self.perform_request( # type: ignore[return-value]
|
|
2569
|
-
"POST",
|
|
2922
|
+
"POST",
|
|
2923
|
+
__path,
|
|
2924
|
+
params=__query,
|
|
2925
|
+
headers=__headers,
|
|
2926
|
+
body=__body,
|
|
2927
|
+
endpoint_id="ml.preview_datafeed",
|
|
2928
|
+
path_parts=__path_parts,
|
|
2570
2929
|
)
|
|
2571
2930
|
|
|
2572
2931
|
@_rewrite_parameters(
|
|
@@ -2587,7 +2946,7 @@ class MlClient(NamespacedClient):
|
|
|
2587
2946
|
"""
|
|
2588
2947
|
Instantiates a calendar.
|
|
2589
2948
|
|
|
2590
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2949
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-put-calendar.html>`_
|
|
2591
2950
|
|
|
2592
2951
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
2593
2952
|
:param description: A description of the calendar.
|
|
@@ -2595,7 +2954,8 @@ class MlClient(NamespacedClient):
|
|
|
2595
2954
|
"""
|
|
2596
2955
|
if calendar_id in SKIP_IN_PATH:
|
|
2597
2956
|
raise ValueError("Empty value passed for parameter 'calendar_id'")
|
|
2598
|
-
|
|
2957
|
+
__path_parts: t.Dict[str, str] = {"calendar_id": _quote(calendar_id)}
|
|
2958
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}'
|
|
2599
2959
|
__query: t.Dict[str, t.Any] = {}
|
|
2600
2960
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2601
2961
|
if error_trace is not None:
|
|
@@ -2617,7 +2977,13 @@ class MlClient(NamespacedClient):
|
|
|
2617
2977
|
if __body is not None:
|
|
2618
2978
|
__headers["content-type"] = "application/json"
|
|
2619
2979
|
return await self.perform_request( # type: ignore[return-value]
|
|
2620
|
-
"PUT",
|
|
2980
|
+
"PUT",
|
|
2981
|
+
__path,
|
|
2982
|
+
params=__query,
|
|
2983
|
+
headers=__headers,
|
|
2984
|
+
body=__body,
|
|
2985
|
+
endpoint_id="ml.put_calendar",
|
|
2986
|
+
path_parts=__path_parts,
|
|
2621
2987
|
)
|
|
2622
2988
|
|
|
2623
2989
|
@_rewrite_parameters()
|
|
@@ -2634,7 +3000,7 @@ class MlClient(NamespacedClient):
|
|
|
2634
3000
|
"""
|
|
2635
3001
|
Adds an anomaly detection job to a calendar.
|
|
2636
3002
|
|
|
2637
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3003
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-put-calendar-job.html>`_
|
|
2638
3004
|
|
|
2639
3005
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
2640
3006
|
:param job_id: An identifier for the anomaly detection jobs. It can be a job
|
|
@@ -2644,7 +3010,11 @@ class MlClient(NamespacedClient):
|
|
|
2644
3010
|
raise ValueError("Empty value passed for parameter 'calendar_id'")
|
|
2645
3011
|
if job_id in SKIP_IN_PATH:
|
|
2646
3012
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
2647
|
-
|
|
3013
|
+
__path_parts: t.Dict[str, str] = {
|
|
3014
|
+
"calendar_id": _quote(calendar_id),
|
|
3015
|
+
"job_id": _quote(job_id),
|
|
3016
|
+
}
|
|
3017
|
+
__path = f'/_ml/calendars/{__path_parts["calendar_id"]}/jobs/{__path_parts["job_id"]}'
|
|
2648
3018
|
__query: t.Dict[str, t.Any] = {}
|
|
2649
3019
|
if error_trace is not None:
|
|
2650
3020
|
__query["error_trace"] = error_trace
|
|
@@ -2656,7 +3026,12 @@ class MlClient(NamespacedClient):
|
|
|
2656
3026
|
__query["pretty"] = pretty
|
|
2657
3027
|
__headers = {"accept": "application/json"}
|
|
2658
3028
|
return await self.perform_request( # type: ignore[return-value]
|
|
2659
|
-
"PUT",
|
|
3029
|
+
"PUT",
|
|
3030
|
+
__path,
|
|
3031
|
+
params=__query,
|
|
3032
|
+
headers=__headers,
|
|
3033
|
+
endpoint_id="ml.put_calendar_job",
|
|
3034
|
+
path_parts=__path_parts,
|
|
2660
3035
|
)
|
|
2661
3036
|
|
|
2662
3037
|
@_rewrite_parameters(
|
|
@@ -2697,7 +3072,7 @@ class MlClient(NamespacedClient):
|
|
|
2697
3072
|
"""
|
|
2698
3073
|
Instantiates a data frame analytics job.
|
|
2699
3074
|
|
|
2700
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3075
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-dfanalytics.html>`_
|
|
2701
3076
|
|
|
2702
3077
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
2703
3078
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -2762,7 +3137,8 @@ class MlClient(NamespacedClient):
|
|
|
2762
3137
|
raise ValueError("Empty value passed for parameter 'dest'")
|
|
2763
3138
|
if source is None and body is None:
|
|
2764
3139
|
raise ValueError("Empty value passed for parameter 'source'")
|
|
2765
|
-
|
|
3140
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
3141
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}'
|
|
2766
3142
|
__query: t.Dict[str, t.Any] = {}
|
|
2767
3143
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2768
3144
|
if error_trace is not None:
|
|
@@ -2796,7 +3172,13 @@ class MlClient(NamespacedClient):
|
|
|
2796
3172
|
__body["version"] = version
|
|
2797
3173
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2798
3174
|
return await self.perform_request( # type: ignore[return-value]
|
|
2799
|
-
"PUT",
|
|
3175
|
+
"PUT",
|
|
3176
|
+
__path,
|
|
3177
|
+
params=__query,
|
|
3178
|
+
headers=__headers,
|
|
3179
|
+
body=__body,
|
|
3180
|
+
endpoint_id="ml.put_data_frame_analytics",
|
|
3181
|
+
path_parts=__path_parts,
|
|
2800
3182
|
)
|
|
2801
3183
|
|
|
2802
3184
|
@_rewrite_parameters(
|
|
@@ -2858,7 +3240,7 @@ class MlClient(NamespacedClient):
|
|
|
2858
3240
|
"""
|
|
2859
3241
|
Instantiates a datafeed.
|
|
2860
3242
|
|
|
2861
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3243
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-put-datafeed.html>`_
|
|
2862
3244
|
|
|
2863
3245
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
2864
3246
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -2931,7 +3313,8 @@ class MlClient(NamespacedClient):
|
|
|
2931
3313
|
"""
|
|
2932
3314
|
if datafeed_id in SKIP_IN_PATH:
|
|
2933
3315
|
raise ValueError("Empty value passed for parameter 'datafeed_id'")
|
|
2934
|
-
|
|
3316
|
+
__path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)}
|
|
3317
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}'
|
|
2935
3318
|
__query: t.Dict[str, t.Any] = {}
|
|
2936
3319
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
2937
3320
|
if allow_no_indices is not None:
|
|
@@ -2983,7 +3366,13 @@ class MlClient(NamespacedClient):
|
|
|
2983
3366
|
__body["scroll_size"] = scroll_size
|
|
2984
3367
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
2985
3368
|
return await self.perform_request( # type: ignore[return-value]
|
|
2986
|
-
"PUT",
|
|
3369
|
+
"PUT",
|
|
3370
|
+
__path,
|
|
3371
|
+
params=__query,
|
|
3372
|
+
headers=__headers,
|
|
3373
|
+
body=__body,
|
|
3374
|
+
endpoint_id="ml.put_datafeed",
|
|
3375
|
+
path_parts=__path_parts,
|
|
2987
3376
|
)
|
|
2988
3377
|
|
|
2989
3378
|
@_rewrite_parameters(
|
|
@@ -3004,7 +3393,7 @@ class MlClient(NamespacedClient):
|
|
|
3004
3393
|
"""
|
|
3005
3394
|
Instantiates a filter.
|
|
3006
3395
|
|
|
3007
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3396
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-put-filter.html>`_
|
|
3008
3397
|
|
|
3009
3398
|
:param filter_id: A string that uniquely identifies a filter.
|
|
3010
3399
|
:param description: A description of the filter.
|
|
@@ -3013,7 +3402,8 @@ class MlClient(NamespacedClient):
|
|
|
3013
3402
|
"""
|
|
3014
3403
|
if filter_id in SKIP_IN_PATH:
|
|
3015
3404
|
raise ValueError("Empty value passed for parameter 'filter_id'")
|
|
3016
|
-
|
|
3405
|
+
__path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)}
|
|
3406
|
+
__path = f'/_ml/filters/{__path_parts["filter_id"]}'
|
|
3017
3407
|
__query: t.Dict[str, t.Any] = {}
|
|
3018
3408
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3019
3409
|
if error_trace is not None:
|
|
@@ -3031,7 +3421,13 @@ class MlClient(NamespacedClient):
|
|
|
3031
3421
|
__body["items"] = items
|
|
3032
3422
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3033
3423
|
return await self.perform_request( # type: ignore[return-value]
|
|
3034
|
-
"PUT",
|
|
3424
|
+
"PUT",
|
|
3425
|
+
__path,
|
|
3426
|
+
params=__query,
|
|
3427
|
+
headers=__headers,
|
|
3428
|
+
body=__body,
|
|
3429
|
+
endpoint_id="ml.put_filter",
|
|
3430
|
+
path_parts=__path_parts,
|
|
3035
3431
|
)
|
|
3036
3432
|
|
|
3037
3433
|
@_rewrite_parameters(
|
|
@@ -3083,7 +3479,7 @@ class MlClient(NamespacedClient):
|
|
|
3083
3479
|
"""
|
|
3084
3480
|
Instantiates an anomaly detection job.
|
|
3085
3481
|
|
|
3086
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3482
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-put-job.html>`_
|
|
3087
3483
|
|
|
3088
3484
|
:param job_id: The identifier for the anomaly detection job. This identifier
|
|
3089
3485
|
can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and
|
|
@@ -3164,7 +3560,8 @@ class MlClient(NamespacedClient):
|
|
|
3164
3560
|
raise ValueError("Empty value passed for parameter 'analysis_config'")
|
|
3165
3561
|
if data_description is None and body is None:
|
|
3166
3562
|
raise ValueError("Empty value passed for parameter 'data_description'")
|
|
3167
|
-
|
|
3563
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
3564
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}'
|
|
3168
3565
|
__query: t.Dict[str, t.Any] = {}
|
|
3169
3566
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3170
3567
|
if error_trace is not None:
|
|
@@ -3210,7 +3607,13 @@ class MlClient(NamespacedClient):
|
|
|
3210
3607
|
__body["results_retention_days"] = results_retention_days
|
|
3211
3608
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3212
3609
|
return await self.perform_request( # type: ignore[return-value]
|
|
3213
|
-
"PUT",
|
|
3610
|
+
"PUT",
|
|
3611
|
+
__path,
|
|
3612
|
+
params=__query,
|
|
3613
|
+
headers=__headers,
|
|
3614
|
+
body=__body,
|
|
3615
|
+
endpoint_id="ml.put_job",
|
|
3616
|
+
path_parts=__path_parts,
|
|
3214
3617
|
)
|
|
3215
3618
|
|
|
3216
3619
|
@_rewrite_parameters(
|
|
@@ -3224,6 +3627,7 @@ class MlClient(NamespacedClient):
|
|
|
3224
3627
|
"model_size_bytes",
|
|
3225
3628
|
"model_type",
|
|
3226
3629
|
"platform_architecture",
|
|
3630
|
+
"prefix_strings",
|
|
3227
3631
|
"tags",
|
|
3228
3632
|
),
|
|
3229
3633
|
)
|
|
@@ -3246,14 +3650,16 @@ class MlClient(NamespacedClient):
|
|
|
3246
3650
|
t.Union["t.Literal['lang_ident', 'pytorch', 'tree_ensemble']", str]
|
|
3247
3651
|
] = None,
|
|
3248
3652
|
platform_architecture: t.Optional[str] = None,
|
|
3653
|
+
prefix_strings: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
3249
3654
|
pretty: t.Optional[bool] = None,
|
|
3250
3655
|
tags: t.Optional[t.Sequence[str]] = None,
|
|
3656
|
+
wait_for_completion: t.Optional[bool] = None,
|
|
3251
3657
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3252
3658
|
) -> ObjectApiResponse[t.Any]:
|
|
3253
3659
|
"""
|
|
3254
3660
|
Creates an inference trained model.
|
|
3255
3661
|
|
|
3256
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3662
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-trained-models.html>`_
|
|
3257
3663
|
|
|
3258
3664
|
:param model_id: The unique identifier of the trained model.
|
|
3259
3665
|
:param compressed_definition: The compressed (GZipped and Base64 encoded) inference
|
|
@@ -3283,11 +3689,15 @@ class MlClient(NamespacedClient):
|
|
|
3283
3689
|
`darwin-x86_64`, `darwin-aarch64`, or `windows-x86_64`. For portable models
|
|
3284
3690
|
(those that work independent of processor architecture or OS features), leave
|
|
3285
3691
|
this field unset.
|
|
3692
|
+
:param prefix_strings: Optional prefix strings applied at inference
|
|
3286
3693
|
:param tags: An array of tags to organize the model.
|
|
3694
|
+
:param wait_for_completion: Whether to wait for all child operations (e.g. model
|
|
3695
|
+
download) to complete.
|
|
3287
3696
|
"""
|
|
3288
3697
|
if model_id in SKIP_IN_PATH:
|
|
3289
3698
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
3290
|
-
|
|
3699
|
+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
3700
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}'
|
|
3291
3701
|
__query: t.Dict[str, t.Any] = {}
|
|
3292
3702
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3293
3703
|
if defer_definition_decompression is not None:
|
|
@@ -3300,6 +3710,8 @@ class MlClient(NamespacedClient):
|
|
|
3300
3710
|
__query["human"] = human
|
|
3301
3711
|
if pretty is not None:
|
|
3302
3712
|
__query["pretty"] = pretty
|
|
3713
|
+
if wait_for_completion is not None:
|
|
3714
|
+
__query["wait_for_completion"] = wait_for_completion
|
|
3303
3715
|
if not __body:
|
|
3304
3716
|
if compressed_definition is not None:
|
|
3305
3717
|
__body["compressed_definition"] = compressed_definition
|
|
@@ -3319,11 +3731,19 @@ class MlClient(NamespacedClient):
|
|
|
3319
3731
|
__body["model_type"] = model_type
|
|
3320
3732
|
if platform_architecture is not None:
|
|
3321
3733
|
__body["platform_architecture"] = platform_architecture
|
|
3734
|
+
if prefix_strings is not None:
|
|
3735
|
+
__body["prefix_strings"] = prefix_strings
|
|
3322
3736
|
if tags is not None:
|
|
3323
3737
|
__body["tags"] = tags
|
|
3324
3738
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3325
3739
|
return await self.perform_request( # type: ignore[return-value]
|
|
3326
|
-
"PUT",
|
|
3740
|
+
"PUT",
|
|
3741
|
+
__path,
|
|
3742
|
+
params=__query,
|
|
3743
|
+
headers=__headers,
|
|
3744
|
+
body=__body,
|
|
3745
|
+
endpoint_id="ml.put_trained_model",
|
|
3746
|
+
path_parts=__path_parts,
|
|
3327
3747
|
)
|
|
3328
3748
|
|
|
3329
3749
|
@_rewrite_parameters()
|
|
@@ -3342,7 +3762,7 @@ class MlClient(NamespacedClient):
|
|
|
3342
3762
|
Creates a new model alias (or reassigns an existing one) to refer to the trained
|
|
3343
3763
|
model
|
|
3344
3764
|
|
|
3345
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3765
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-trained-models-aliases.html>`_
|
|
3346
3766
|
|
|
3347
3767
|
:param model_id: The identifier for the trained model that the alias refers to.
|
|
3348
3768
|
:param model_alias: The alias to create or update. This value cannot end in numbers.
|
|
@@ -3354,7 +3774,11 @@ class MlClient(NamespacedClient):
|
|
|
3354
3774
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
3355
3775
|
if model_alias in SKIP_IN_PATH:
|
|
3356
3776
|
raise ValueError("Empty value passed for parameter 'model_alias'")
|
|
3357
|
-
|
|
3777
|
+
__path_parts: t.Dict[str, str] = {
|
|
3778
|
+
"model_id": _quote(model_id),
|
|
3779
|
+
"model_alias": _quote(model_alias),
|
|
3780
|
+
}
|
|
3781
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/model_aliases/{__path_parts["model_alias"]}'
|
|
3358
3782
|
__query: t.Dict[str, t.Any] = {}
|
|
3359
3783
|
if error_trace is not None:
|
|
3360
3784
|
__query["error_trace"] = error_trace
|
|
@@ -3368,7 +3792,12 @@ class MlClient(NamespacedClient):
|
|
|
3368
3792
|
__query["reassign"] = reassign
|
|
3369
3793
|
__headers = {"accept": "application/json"}
|
|
3370
3794
|
return await self.perform_request( # type: ignore[return-value]
|
|
3371
|
-
"PUT",
|
|
3795
|
+
"PUT",
|
|
3796
|
+
__path,
|
|
3797
|
+
params=__query,
|
|
3798
|
+
headers=__headers,
|
|
3799
|
+
endpoint_id="ml.put_trained_model_alias",
|
|
3800
|
+
path_parts=__path_parts,
|
|
3372
3801
|
)
|
|
3373
3802
|
|
|
3374
3803
|
@_rewrite_parameters(
|
|
@@ -3391,7 +3820,7 @@ class MlClient(NamespacedClient):
|
|
|
3391
3820
|
"""
|
|
3392
3821
|
Creates part of a trained model definition
|
|
3393
3822
|
|
|
3394
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3823
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-trained-model-definition-part.html>`_
|
|
3395
3824
|
|
|
3396
3825
|
:param model_id: The unique identifier of the trained model.
|
|
3397
3826
|
:param part: The definition part number. When the definition is loaded for inference
|
|
@@ -3416,7 +3845,11 @@ class MlClient(NamespacedClient):
|
|
|
3416
3845
|
)
|
|
3417
3846
|
if total_parts is None and body is None:
|
|
3418
3847
|
raise ValueError("Empty value passed for parameter 'total_parts'")
|
|
3419
|
-
|
|
3848
|
+
__path_parts: t.Dict[str, str] = {
|
|
3849
|
+
"model_id": _quote(model_id),
|
|
3850
|
+
"part": _quote(part),
|
|
3851
|
+
}
|
|
3852
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/definition/{__path_parts["part"]}'
|
|
3420
3853
|
__query: t.Dict[str, t.Any] = {}
|
|
3421
3854
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3422
3855
|
if error_trace is not None:
|
|
@@ -3436,7 +3869,13 @@ class MlClient(NamespacedClient):
|
|
|
3436
3869
|
__body["total_parts"] = total_parts
|
|
3437
3870
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3438
3871
|
return await self.perform_request( # type: ignore[return-value]
|
|
3439
|
-
"PUT",
|
|
3872
|
+
"PUT",
|
|
3873
|
+
__path,
|
|
3874
|
+
params=__query,
|
|
3875
|
+
headers=__headers,
|
|
3876
|
+
body=__body,
|
|
3877
|
+
endpoint_id="ml.put_trained_model_definition_part",
|
|
3878
|
+
path_parts=__path_parts,
|
|
3440
3879
|
)
|
|
3441
3880
|
|
|
3442
3881
|
@_rewrite_parameters(
|
|
@@ -3458,7 +3897,7 @@ class MlClient(NamespacedClient):
|
|
|
3458
3897
|
"""
|
|
3459
3898
|
Creates a trained model vocabulary
|
|
3460
3899
|
|
|
3461
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3900
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-trained-model-vocabulary.html>`_
|
|
3462
3901
|
|
|
3463
3902
|
:param model_id: The unique identifier of the trained model.
|
|
3464
3903
|
:param vocabulary: The model vocabulary, which must not be empty.
|
|
@@ -3469,7 +3908,8 @@ class MlClient(NamespacedClient):
|
|
|
3469
3908
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
3470
3909
|
if vocabulary is None and body is None:
|
|
3471
3910
|
raise ValueError("Empty value passed for parameter 'vocabulary'")
|
|
3472
|
-
|
|
3911
|
+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
3912
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/vocabulary'
|
|
3473
3913
|
__query: t.Dict[str, t.Any] = {}
|
|
3474
3914
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3475
3915
|
if error_trace is not None:
|
|
@@ -3489,7 +3929,13 @@ class MlClient(NamespacedClient):
|
|
|
3489
3929
|
__body["scores"] = scores
|
|
3490
3930
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
3491
3931
|
return await self.perform_request( # type: ignore[return-value]
|
|
3492
|
-
"PUT",
|
|
3932
|
+
"PUT",
|
|
3933
|
+
__path,
|
|
3934
|
+
params=__query,
|
|
3935
|
+
headers=__headers,
|
|
3936
|
+
body=__body,
|
|
3937
|
+
endpoint_id="ml.put_trained_model_vocabulary",
|
|
3938
|
+
path_parts=__path_parts,
|
|
3493
3939
|
)
|
|
3494
3940
|
|
|
3495
3941
|
@_rewrite_parameters()
|
|
@@ -3507,7 +3953,7 @@ class MlClient(NamespacedClient):
|
|
|
3507
3953
|
"""
|
|
3508
3954
|
Resets an existing anomaly detection job.
|
|
3509
3955
|
|
|
3510
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3956
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-reset-job.html>`_
|
|
3511
3957
|
|
|
3512
3958
|
:param job_id: The ID of the job to reset.
|
|
3513
3959
|
:param delete_user_annotations: Specifies whether annotations that have been
|
|
@@ -3518,7 +3964,8 @@ class MlClient(NamespacedClient):
|
|
|
3518
3964
|
"""
|
|
3519
3965
|
if job_id in SKIP_IN_PATH:
|
|
3520
3966
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
3521
|
-
|
|
3967
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
3968
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_reset'
|
|
3522
3969
|
__query: t.Dict[str, t.Any] = {}
|
|
3523
3970
|
if delete_user_annotations is not None:
|
|
3524
3971
|
__query["delete_user_annotations"] = delete_user_annotations
|
|
@@ -3534,7 +3981,12 @@ class MlClient(NamespacedClient):
|
|
|
3534
3981
|
__query["wait_for_completion"] = wait_for_completion
|
|
3535
3982
|
__headers = {"accept": "application/json"}
|
|
3536
3983
|
return await self.perform_request( # type: ignore[return-value]
|
|
3537
|
-
"POST",
|
|
3984
|
+
"POST",
|
|
3985
|
+
__path,
|
|
3986
|
+
params=__query,
|
|
3987
|
+
headers=__headers,
|
|
3988
|
+
endpoint_id="ml.reset_job",
|
|
3989
|
+
path_parts=__path_parts,
|
|
3538
3990
|
)
|
|
3539
3991
|
|
|
3540
3992
|
@_rewrite_parameters(
|
|
@@ -3555,7 +4007,7 @@ class MlClient(NamespacedClient):
|
|
|
3555
4007
|
"""
|
|
3556
4008
|
Reverts to a specific snapshot.
|
|
3557
4009
|
|
|
3558
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4010
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-revert-snapshot.html>`_
|
|
3559
4011
|
|
|
3560
4012
|
:param job_id: Identifier for the anomaly detection job.
|
|
3561
4013
|
:param snapshot_id: You can specify `empty` as the <snapshot_id>. Reverting to
|
|
@@ -3568,7 +4020,11 @@ class MlClient(NamespacedClient):
|
|
|
3568
4020
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
3569
4021
|
if snapshot_id in SKIP_IN_PATH:
|
|
3570
4022
|
raise ValueError("Empty value passed for parameter 'snapshot_id'")
|
|
3571
|
-
|
|
4023
|
+
__path_parts: t.Dict[str, str] = {
|
|
4024
|
+
"job_id": _quote(job_id),
|
|
4025
|
+
"snapshot_id": _quote(snapshot_id),
|
|
4026
|
+
}
|
|
4027
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_revert'
|
|
3572
4028
|
__query: t.Dict[str, t.Any] = {}
|
|
3573
4029
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3574
4030
|
if error_trace is not None:
|
|
@@ -3588,7 +4044,13 @@ class MlClient(NamespacedClient):
|
|
|
3588
4044
|
if __body is not None:
|
|
3589
4045
|
__headers["content-type"] = "application/json"
|
|
3590
4046
|
return await self.perform_request( # type: ignore[return-value]
|
|
3591
|
-
"POST",
|
|
4047
|
+
"POST",
|
|
4048
|
+
__path,
|
|
4049
|
+
params=__query,
|
|
4050
|
+
headers=__headers,
|
|
4051
|
+
body=__body,
|
|
4052
|
+
endpoint_id="ml.revert_model_snapshot",
|
|
4053
|
+
path_parts=__path_parts,
|
|
3592
4054
|
)
|
|
3593
4055
|
|
|
3594
4056
|
@_rewrite_parameters()
|
|
@@ -3606,13 +4068,14 @@ class MlClient(NamespacedClient):
|
|
|
3606
4068
|
Sets a cluster wide upgrade_mode setting that prepares machine learning indices
|
|
3607
4069
|
for an upgrade.
|
|
3608
4070
|
|
|
3609
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4071
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-set-upgrade-mode.html>`_
|
|
3610
4072
|
|
|
3611
4073
|
:param enabled: When `true`, it enables `upgrade_mode` which temporarily halts
|
|
3612
4074
|
all job and datafeed tasks and prohibits new job and datafeed tasks from
|
|
3613
4075
|
starting.
|
|
3614
4076
|
:param timeout: The time to wait for the request to be completed.
|
|
3615
4077
|
"""
|
|
4078
|
+
__path_parts: t.Dict[str, str] = {}
|
|
3616
4079
|
__path = "/_ml/set_upgrade_mode"
|
|
3617
4080
|
__query: t.Dict[str, t.Any] = {}
|
|
3618
4081
|
if enabled is not None:
|
|
@@ -3629,7 +4092,12 @@ class MlClient(NamespacedClient):
|
|
|
3629
4092
|
__query["timeout"] = timeout
|
|
3630
4093
|
__headers = {"accept": "application/json"}
|
|
3631
4094
|
return await self.perform_request( # type: ignore[return-value]
|
|
3632
|
-
"POST",
|
|
4095
|
+
"POST",
|
|
4096
|
+
__path,
|
|
4097
|
+
params=__query,
|
|
4098
|
+
headers=__headers,
|
|
4099
|
+
endpoint_id="ml.set_upgrade_mode",
|
|
4100
|
+
path_parts=__path_parts,
|
|
3633
4101
|
)
|
|
3634
4102
|
|
|
3635
4103
|
@_rewrite_parameters()
|
|
@@ -3646,7 +4114,7 @@ class MlClient(NamespacedClient):
|
|
|
3646
4114
|
"""
|
|
3647
4115
|
Starts a data frame analytics job.
|
|
3648
4116
|
|
|
3649
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4117
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/start-dfanalytics.html>`_
|
|
3650
4118
|
|
|
3651
4119
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
3652
4120
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -3656,7 +4124,8 @@ class MlClient(NamespacedClient):
|
|
|
3656
4124
|
"""
|
|
3657
4125
|
if id in SKIP_IN_PATH:
|
|
3658
4126
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
3659
|
-
|
|
4127
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
4128
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_start'
|
|
3660
4129
|
__query: t.Dict[str, t.Any] = {}
|
|
3661
4130
|
if error_trace is not None:
|
|
3662
4131
|
__query["error_trace"] = error_trace
|
|
@@ -3670,7 +4139,12 @@ class MlClient(NamespacedClient):
|
|
|
3670
4139
|
__query["timeout"] = timeout
|
|
3671
4140
|
__headers = {"accept": "application/json"}
|
|
3672
4141
|
return await self.perform_request( # type: ignore[return-value]
|
|
3673
|
-
"POST",
|
|
4142
|
+
"POST",
|
|
4143
|
+
__path,
|
|
4144
|
+
params=__query,
|
|
4145
|
+
headers=__headers,
|
|
4146
|
+
endpoint_id="ml.start_data_frame_analytics",
|
|
4147
|
+
path_parts=__path_parts,
|
|
3674
4148
|
)
|
|
3675
4149
|
|
|
3676
4150
|
@_rewrite_parameters(
|
|
@@ -3692,7 +4166,7 @@ class MlClient(NamespacedClient):
|
|
|
3692
4166
|
"""
|
|
3693
4167
|
Starts one or more datafeeds.
|
|
3694
4168
|
|
|
3695
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4169
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-start-datafeed.html>`_
|
|
3696
4170
|
|
|
3697
4171
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
3698
4172
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -3704,7 +4178,8 @@ class MlClient(NamespacedClient):
|
|
|
3704
4178
|
"""
|
|
3705
4179
|
if datafeed_id in SKIP_IN_PATH:
|
|
3706
4180
|
raise ValueError("Empty value passed for parameter 'datafeed_id'")
|
|
3707
|
-
|
|
4181
|
+
__path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)}
|
|
4182
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_start'
|
|
3708
4183
|
__query: t.Dict[str, t.Any] = {}
|
|
3709
4184
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3710
4185
|
if error_trace is not None:
|
|
@@ -3728,7 +4203,13 @@ class MlClient(NamespacedClient):
|
|
|
3728
4203
|
if __body is not None:
|
|
3729
4204
|
__headers["content-type"] = "application/json"
|
|
3730
4205
|
return await self.perform_request( # type: ignore[return-value]
|
|
3731
|
-
"POST",
|
|
4206
|
+
"POST",
|
|
4207
|
+
__path,
|
|
4208
|
+
params=__query,
|
|
4209
|
+
headers=__headers,
|
|
4210
|
+
body=__body,
|
|
4211
|
+
endpoint_id="ml.start_datafeed",
|
|
4212
|
+
path_parts=__path_parts,
|
|
3732
4213
|
)
|
|
3733
4214
|
|
|
3734
4215
|
@_rewrite_parameters()
|
|
@@ -3754,7 +4235,7 @@ class MlClient(NamespacedClient):
|
|
|
3754
4235
|
"""
|
|
3755
4236
|
Start a trained model deployment.
|
|
3756
4237
|
|
|
3757
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4238
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/start-trained-model-deployment.html>`_
|
|
3758
4239
|
|
|
3759
4240
|
:param model_id: The unique identifier of the trained model. Currently, only
|
|
3760
4241
|
PyTorch models are supported.
|
|
@@ -3784,7 +4265,8 @@ class MlClient(NamespacedClient):
|
|
|
3784
4265
|
"""
|
|
3785
4266
|
if model_id in SKIP_IN_PATH:
|
|
3786
4267
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
3787
|
-
|
|
4268
|
+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
4269
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_start'
|
|
3788
4270
|
__query: t.Dict[str, t.Any] = {}
|
|
3789
4271
|
if cache_size is not None:
|
|
3790
4272
|
__query["cache_size"] = cache_size
|
|
@@ -3812,7 +4294,12 @@ class MlClient(NamespacedClient):
|
|
|
3812
4294
|
__query["wait_for"] = wait_for
|
|
3813
4295
|
__headers = {"accept": "application/json"}
|
|
3814
4296
|
return await self.perform_request( # type: ignore[return-value]
|
|
3815
|
-
"POST",
|
|
4297
|
+
"POST",
|
|
4298
|
+
__path,
|
|
4299
|
+
params=__query,
|
|
4300
|
+
headers=__headers,
|
|
4301
|
+
endpoint_id="ml.start_trained_model_deployment",
|
|
4302
|
+
path_parts=__path_parts,
|
|
3816
4303
|
)
|
|
3817
4304
|
|
|
3818
4305
|
@_rewrite_parameters()
|
|
@@ -3831,7 +4318,7 @@ class MlClient(NamespacedClient):
|
|
|
3831
4318
|
"""
|
|
3832
4319
|
Stops one or more data frame analytics jobs.
|
|
3833
4320
|
|
|
3834
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4321
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/stop-dfanalytics.html>`_
|
|
3835
4322
|
|
|
3836
4323
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
3837
4324
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -3850,7 +4337,8 @@ class MlClient(NamespacedClient):
|
|
|
3850
4337
|
"""
|
|
3851
4338
|
if id in SKIP_IN_PATH:
|
|
3852
4339
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
3853
|
-
|
|
4340
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
4341
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_stop'
|
|
3854
4342
|
__query: t.Dict[str, t.Any] = {}
|
|
3855
4343
|
if allow_no_match is not None:
|
|
3856
4344
|
__query["allow_no_match"] = allow_no_match
|
|
@@ -3868,7 +4356,12 @@ class MlClient(NamespacedClient):
|
|
|
3868
4356
|
__query["timeout"] = timeout
|
|
3869
4357
|
__headers = {"accept": "application/json"}
|
|
3870
4358
|
return await self.perform_request( # type: ignore[return-value]
|
|
3871
|
-
"POST",
|
|
4359
|
+
"POST",
|
|
4360
|
+
__path,
|
|
4361
|
+
params=__query,
|
|
4362
|
+
headers=__headers,
|
|
4363
|
+
endpoint_id="ml.stop_data_frame_analytics",
|
|
4364
|
+
path_parts=__path_parts,
|
|
3872
4365
|
)
|
|
3873
4366
|
|
|
3874
4367
|
@_rewrite_parameters(
|
|
@@ -3890,7 +4383,7 @@ class MlClient(NamespacedClient):
|
|
|
3890
4383
|
"""
|
|
3891
4384
|
Stops one or more datafeeds.
|
|
3892
4385
|
|
|
3893
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4386
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-stop-datafeed.html>`_
|
|
3894
4387
|
|
|
3895
4388
|
:param datafeed_id: Identifier for the datafeed. You can stop multiple datafeeds
|
|
3896
4389
|
in a single API request by using a comma-separated list of datafeeds or a
|
|
@@ -3903,7 +4396,8 @@ class MlClient(NamespacedClient):
|
|
|
3903
4396
|
"""
|
|
3904
4397
|
if datafeed_id in SKIP_IN_PATH:
|
|
3905
4398
|
raise ValueError("Empty value passed for parameter 'datafeed_id'")
|
|
3906
|
-
|
|
4399
|
+
__path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)}
|
|
4400
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_stop'
|
|
3907
4401
|
__query: t.Dict[str, t.Any] = {}
|
|
3908
4402
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
3909
4403
|
if error_trace is not None:
|
|
@@ -3927,7 +4421,13 @@ class MlClient(NamespacedClient):
|
|
|
3927
4421
|
if __body is not None:
|
|
3928
4422
|
__headers["content-type"] = "application/json"
|
|
3929
4423
|
return await self.perform_request( # type: ignore[return-value]
|
|
3930
|
-
"POST",
|
|
4424
|
+
"POST",
|
|
4425
|
+
__path,
|
|
4426
|
+
params=__query,
|
|
4427
|
+
headers=__headers,
|
|
4428
|
+
body=__body,
|
|
4429
|
+
endpoint_id="ml.stop_datafeed",
|
|
4430
|
+
path_parts=__path_parts,
|
|
3931
4431
|
)
|
|
3932
4432
|
|
|
3933
4433
|
@_rewrite_parameters()
|
|
@@ -3945,7 +4445,7 @@ class MlClient(NamespacedClient):
|
|
|
3945
4445
|
"""
|
|
3946
4446
|
Stop a trained model deployment.
|
|
3947
4447
|
|
|
3948
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4448
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/stop-trained-model-deployment.html>`_
|
|
3949
4449
|
|
|
3950
4450
|
:param model_id: The unique identifier of the trained model.
|
|
3951
4451
|
:param allow_no_match: Specifies what to do when the request: contains wildcard
|
|
@@ -3960,7 +4460,8 @@ class MlClient(NamespacedClient):
|
|
|
3960
4460
|
"""
|
|
3961
4461
|
if model_id in SKIP_IN_PATH:
|
|
3962
4462
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
3963
|
-
|
|
4463
|
+
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
4464
|
+
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_stop'
|
|
3964
4465
|
__query: t.Dict[str, t.Any] = {}
|
|
3965
4466
|
if allow_no_match is not None:
|
|
3966
4467
|
__query["allow_no_match"] = allow_no_match
|
|
@@ -3976,7 +4477,12 @@ class MlClient(NamespacedClient):
|
|
|
3976
4477
|
__query["pretty"] = pretty
|
|
3977
4478
|
__headers = {"accept": "application/json"}
|
|
3978
4479
|
return await self.perform_request( # type: ignore[return-value]
|
|
3979
|
-
"POST",
|
|
4480
|
+
"POST",
|
|
4481
|
+
__path,
|
|
4482
|
+
params=__query,
|
|
4483
|
+
headers=__headers,
|
|
4484
|
+
endpoint_id="ml.stop_trained_model_deployment",
|
|
4485
|
+
path_parts=__path_parts,
|
|
3980
4486
|
)
|
|
3981
4487
|
|
|
3982
4488
|
@_rewrite_parameters(
|
|
@@ -4004,7 +4510,7 @@ class MlClient(NamespacedClient):
|
|
|
4004
4510
|
"""
|
|
4005
4511
|
Updates certain properties of a data frame analytics job.
|
|
4006
4512
|
|
|
4007
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4513
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/update-dfanalytics.html>`_
|
|
4008
4514
|
|
|
4009
4515
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
4010
4516
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -4024,7 +4530,8 @@ class MlClient(NamespacedClient):
|
|
|
4024
4530
|
"""
|
|
4025
4531
|
if id in SKIP_IN_PATH:
|
|
4026
4532
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
4027
|
-
|
|
4533
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
4534
|
+
__path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_update'
|
|
4028
4535
|
__query: t.Dict[str, t.Any] = {}
|
|
4029
4536
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4030
4537
|
if error_trace is not None:
|
|
@@ -4046,7 +4553,13 @@ class MlClient(NamespacedClient):
|
|
|
4046
4553
|
__body["model_memory_limit"] = model_memory_limit
|
|
4047
4554
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4048
4555
|
return await self.perform_request( # type: ignore[return-value]
|
|
4049
|
-
"POST",
|
|
4556
|
+
"POST",
|
|
4557
|
+
__path,
|
|
4558
|
+
params=__query,
|
|
4559
|
+
headers=__headers,
|
|
4560
|
+
body=__body,
|
|
4561
|
+
endpoint_id="ml.update_data_frame_analytics",
|
|
4562
|
+
path_parts=__path_parts,
|
|
4050
4563
|
)
|
|
4051
4564
|
|
|
4052
4565
|
@_rewrite_parameters(
|
|
@@ -4105,7 +4618,7 @@ class MlClient(NamespacedClient):
|
|
|
4105
4618
|
"""
|
|
4106
4619
|
Updates certain properties of a datafeed.
|
|
4107
4620
|
|
|
4108
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4621
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-update-datafeed.html>`_
|
|
4109
4622
|
|
|
4110
4623
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
4111
4624
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -4189,7 +4702,8 @@ class MlClient(NamespacedClient):
|
|
|
4189
4702
|
"""
|
|
4190
4703
|
if datafeed_id in SKIP_IN_PATH:
|
|
4191
4704
|
raise ValueError("Empty value passed for parameter 'datafeed_id'")
|
|
4192
|
-
|
|
4705
|
+
__path_parts: t.Dict[str, str] = {"datafeed_id": _quote(datafeed_id)}
|
|
4706
|
+
__path = f'/_ml/datafeeds/{__path_parts["datafeed_id"]}/_update'
|
|
4193
4707
|
__query: t.Dict[str, t.Any] = {}
|
|
4194
4708
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4195
4709
|
if allow_no_indices is not None:
|
|
@@ -4239,7 +4753,13 @@ class MlClient(NamespacedClient):
|
|
|
4239
4753
|
__body["scroll_size"] = scroll_size
|
|
4240
4754
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4241
4755
|
return await self.perform_request( # type: ignore[return-value]
|
|
4242
|
-
"POST",
|
|
4756
|
+
"POST",
|
|
4757
|
+
__path,
|
|
4758
|
+
params=__query,
|
|
4759
|
+
headers=__headers,
|
|
4760
|
+
body=__body,
|
|
4761
|
+
endpoint_id="ml.update_datafeed",
|
|
4762
|
+
path_parts=__path_parts,
|
|
4243
4763
|
)
|
|
4244
4764
|
|
|
4245
4765
|
@_rewrite_parameters(
|
|
@@ -4261,7 +4781,7 @@ class MlClient(NamespacedClient):
|
|
|
4261
4781
|
"""
|
|
4262
4782
|
Updates the description of a filter, adds items, or removes items.
|
|
4263
4783
|
|
|
4264
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4784
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-update-filter.html>`_
|
|
4265
4785
|
|
|
4266
4786
|
:param filter_id: A string that uniquely identifies a filter.
|
|
4267
4787
|
:param add_items: The items to add to the filter.
|
|
@@ -4270,7 +4790,8 @@ class MlClient(NamespacedClient):
|
|
|
4270
4790
|
"""
|
|
4271
4791
|
if filter_id in SKIP_IN_PATH:
|
|
4272
4792
|
raise ValueError("Empty value passed for parameter 'filter_id'")
|
|
4273
|
-
|
|
4793
|
+
__path_parts: t.Dict[str, str] = {"filter_id": _quote(filter_id)}
|
|
4794
|
+
__path = f'/_ml/filters/{__path_parts["filter_id"]}/_update'
|
|
4274
4795
|
__query: t.Dict[str, t.Any] = {}
|
|
4275
4796
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4276
4797
|
if error_trace is not None:
|
|
@@ -4290,7 +4811,13 @@ class MlClient(NamespacedClient):
|
|
|
4290
4811
|
__body["remove_items"] = remove_items
|
|
4291
4812
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4292
4813
|
return await self.perform_request( # type: ignore[return-value]
|
|
4293
|
-
"POST",
|
|
4814
|
+
"POST",
|
|
4815
|
+
__path,
|
|
4816
|
+
params=__query,
|
|
4817
|
+
headers=__headers,
|
|
4818
|
+
body=__body,
|
|
4819
|
+
endpoint_id="ml.update_filter",
|
|
4820
|
+
path_parts=__path_parts,
|
|
4294
4821
|
)
|
|
4295
4822
|
|
|
4296
4823
|
@_rewrite_parameters(
|
|
@@ -4344,7 +4871,7 @@ class MlClient(NamespacedClient):
|
|
|
4344
4871
|
"""
|
|
4345
4872
|
Updates certain properties of an anomaly detection job.
|
|
4346
4873
|
|
|
4347
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4874
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-update-job.html>`_
|
|
4348
4875
|
|
|
4349
4876
|
:param job_id: Identifier for the job.
|
|
4350
4877
|
:param allow_lazy_open: Advanced configuration option. Specifies whether this
|
|
@@ -4397,7 +4924,8 @@ class MlClient(NamespacedClient):
|
|
|
4397
4924
|
"""
|
|
4398
4925
|
if job_id in SKIP_IN_PATH:
|
|
4399
4926
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
4400
|
-
|
|
4927
|
+
__path_parts: t.Dict[str, str] = {"job_id": _quote(job_id)}
|
|
4928
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/_update'
|
|
4401
4929
|
__query: t.Dict[str, t.Any] = {}
|
|
4402
4930
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4403
4931
|
if error_trace is not None:
|
|
@@ -4443,7 +4971,13 @@ class MlClient(NamespacedClient):
|
|
|
4443
4971
|
__body["results_retention_days"] = results_retention_days
|
|
4444
4972
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4445
4973
|
return await self.perform_request( # type: ignore[return-value]
|
|
4446
|
-
"POST",
|
|
4974
|
+
"POST",
|
|
4975
|
+
__path,
|
|
4976
|
+
params=__query,
|
|
4977
|
+
headers=__headers,
|
|
4978
|
+
body=__body,
|
|
4979
|
+
endpoint_id="ml.update_job",
|
|
4980
|
+
path_parts=__path_parts,
|
|
4447
4981
|
)
|
|
4448
4982
|
|
|
4449
4983
|
@_rewrite_parameters(
|
|
@@ -4465,7 +4999,7 @@ class MlClient(NamespacedClient):
|
|
|
4465
4999
|
"""
|
|
4466
5000
|
Updates certain properties of a snapshot.
|
|
4467
5001
|
|
|
4468
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5002
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-update-snapshot.html>`_
|
|
4469
5003
|
|
|
4470
5004
|
:param job_id: Identifier for the anomaly detection job.
|
|
4471
5005
|
:param snapshot_id: Identifier for the model snapshot.
|
|
@@ -4478,7 +5012,11 @@ class MlClient(NamespacedClient):
|
|
|
4478
5012
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
4479
5013
|
if snapshot_id in SKIP_IN_PATH:
|
|
4480
5014
|
raise ValueError("Empty value passed for parameter 'snapshot_id'")
|
|
4481
|
-
|
|
5015
|
+
__path_parts: t.Dict[str, str] = {
|
|
5016
|
+
"job_id": _quote(job_id),
|
|
5017
|
+
"snapshot_id": _quote(snapshot_id),
|
|
5018
|
+
}
|
|
5019
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_update'
|
|
4482
5020
|
__query: t.Dict[str, t.Any] = {}
|
|
4483
5021
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4484
5022
|
if error_trace is not None:
|
|
@@ -4496,7 +5034,13 @@ class MlClient(NamespacedClient):
|
|
|
4496
5034
|
__body["retain"] = retain
|
|
4497
5035
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4498
5036
|
return await self.perform_request( # type: ignore[return-value]
|
|
4499
|
-
"POST",
|
|
5037
|
+
"POST",
|
|
5038
|
+
__path,
|
|
5039
|
+
params=__query,
|
|
5040
|
+
headers=__headers,
|
|
5041
|
+
body=__body,
|
|
5042
|
+
endpoint_id="ml.update_model_snapshot",
|
|
5043
|
+
path_parts=__path_parts,
|
|
4500
5044
|
)
|
|
4501
5045
|
|
|
4502
5046
|
@_rewrite_parameters()
|
|
@@ -4515,7 +5059,7 @@ class MlClient(NamespacedClient):
|
|
|
4515
5059
|
"""
|
|
4516
5060
|
Upgrades a given job snapshot to the current major version.
|
|
4517
5061
|
|
|
4518
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5062
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/ml-upgrade-job-model-snapshot.html>`_
|
|
4519
5063
|
|
|
4520
5064
|
:param job_id: Identifier for the anomaly detection job.
|
|
4521
5065
|
:param snapshot_id: A numerical character string that uniquely identifies the
|
|
@@ -4529,7 +5073,11 @@ class MlClient(NamespacedClient):
|
|
|
4529
5073
|
raise ValueError("Empty value passed for parameter 'job_id'")
|
|
4530
5074
|
if snapshot_id in SKIP_IN_PATH:
|
|
4531
5075
|
raise ValueError("Empty value passed for parameter 'snapshot_id'")
|
|
4532
|
-
|
|
5076
|
+
__path_parts: t.Dict[str, str] = {
|
|
5077
|
+
"job_id": _quote(job_id),
|
|
5078
|
+
"snapshot_id": _quote(snapshot_id),
|
|
5079
|
+
}
|
|
5080
|
+
__path = f'/_ml/anomaly_detectors/{__path_parts["job_id"]}/model_snapshots/{__path_parts["snapshot_id"]}/_upgrade'
|
|
4533
5081
|
__query: t.Dict[str, t.Any] = {}
|
|
4534
5082
|
if error_trace is not None:
|
|
4535
5083
|
__query["error_trace"] = error_trace
|
|
@@ -4545,7 +5093,12 @@ class MlClient(NamespacedClient):
|
|
|
4545
5093
|
__query["wait_for_completion"] = wait_for_completion
|
|
4546
5094
|
__headers = {"accept": "application/json"}
|
|
4547
5095
|
return await self.perform_request( # type: ignore[return-value]
|
|
4548
|
-
"POST",
|
|
5096
|
+
"POST",
|
|
5097
|
+
__path,
|
|
5098
|
+
params=__query,
|
|
5099
|
+
headers=__headers,
|
|
5100
|
+
endpoint_id="ml.upgrade_job_snapshot",
|
|
5101
|
+
path_parts=__path_parts,
|
|
4549
5102
|
)
|
|
4550
5103
|
|
|
4551
5104
|
@_rewrite_parameters(
|
|
@@ -4582,7 +5135,7 @@ class MlClient(NamespacedClient):
|
|
|
4582
5135
|
"""
|
|
4583
5136
|
Validates an anomaly detection job.
|
|
4584
5137
|
|
|
4585
|
-
`<https://www.elastic.co/guide/en/machine-learning/8.
|
|
5138
|
+
`<https://www.elastic.co/guide/en/machine-learning/8.13/ml-jobs.html>`_
|
|
4586
5139
|
|
|
4587
5140
|
:param analysis_config:
|
|
4588
5141
|
:param analysis_limits:
|
|
@@ -4594,6 +5147,7 @@ class MlClient(NamespacedClient):
|
|
|
4594
5147
|
:param model_snapshot_retention_days:
|
|
4595
5148
|
:param results_index_name:
|
|
4596
5149
|
"""
|
|
5150
|
+
__path_parts: t.Dict[str, str] = {}
|
|
4597
5151
|
__path = "/_ml/anomaly_detectors/_validate"
|
|
4598
5152
|
__query: t.Dict[str, t.Any] = {}
|
|
4599
5153
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -4626,7 +5180,13 @@ class MlClient(NamespacedClient):
|
|
|
4626
5180
|
__body["results_index_name"] = results_index_name
|
|
4627
5181
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4628
5182
|
return await self.perform_request( # type: ignore[return-value]
|
|
4629
|
-
"POST",
|
|
5183
|
+
"POST",
|
|
5184
|
+
__path,
|
|
5185
|
+
params=__query,
|
|
5186
|
+
headers=__headers,
|
|
5187
|
+
body=__body,
|
|
5188
|
+
endpoint_id="ml.validate",
|
|
5189
|
+
path_parts=__path_parts,
|
|
4630
5190
|
)
|
|
4631
5191
|
|
|
4632
5192
|
@_rewrite_parameters(
|
|
@@ -4645,7 +5205,7 @@ class MlClient(NamespacedClient):
|
|
|
4645
5205
|
"""
|
|
4646
5206
|
Validates an anomaly detection detector.
|
|
4647
5207
|
|
|
4648
|
-
`<https://www.elastic.co/guide/en/machine-learning/8.
|
|
5208
|
+
`<https://www.elastic.co/guide/en/machine-learning/8.13/ml-jobs.html>`_
|
|
4649
5209
|
|
|
4650
5210
|
:param detector:
|
|
4651
5211
|
"""
|
|
@@ -4655,6 +5215,7 @@ class MlClient(NamespacedClient):
|
|
|
4655
5215
|
)
|
|
4656
5216
|
elif detector is not None and body is not None:
|
|
4657
5217
|
raise ValueError("Cannot set both 'detector' and 'body'")
|
|
5218
|
+
__path_parts: t.Dict[str, str] = {}
|
|
4658
5219
|
__path = "/_ml/anomaly_detectors/_validate/detector"
|
|
4659
5220
|
__query: t.Dict[str, t.Any] = {}
|
|
4660
5221
|
if error_trace is not None:
|
|
@@ -4668,5 +5229,11 @@ class MlClient(NamespacedClient):
|
|
|
4668
5229
|
__body = detector if detector is not None else body
|
|
4669
5230
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
4670
5231
|
return await self.perform_request( # type: ignore[return-value]
|
|
4671
|
-
"POST",
|
|
5232
|
+
"POST",
|
|
5233
|
+
__path,
|
|
5234
|
+
params=__query,
|
|
5235
|
+
headers=__headers,
|
|
5236
|
+
body=__body,
|
|
5237
|
+
endpoint_id="ml.validate_detector",
|
|
5238
|
+
path_parts=__path_parts,
|
|
4672
5239
|
)
|