elasticsearch 8.17.1__py3-none-any.whl → 8.18.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2146 -859
- elasticsearch/_async/client/_base.py +0 -1
- elasticsearch/_async/client/async_search.py +44 -29
- elasticsearch/_async/client/autoscaling.py +32 -26
- elasticsearch/_async/client/cat.py +244 -169
- elasticsearch/_async/client/ccr.py +268 -128
- elasticsearch/_async/client/cluster.py +191 -164
- elasticsearch/_async/client/connector.py +212 -116
- elasticsearch/_async/client/dangling_indices.py +22 -16
- elasticsearch/_async/client/enrich.py +51 -11
- elasticsearch/_async/client/eql.py +54 -13
- elasticsearch/_async/client/esql.py +352 -4
- elasticsearch/_async/client/features.py +37 -27
- elasticsearch/_async/client/fleet.py +22 -10
- elasticsearch/_async/client/graph.py +10 -9
- elasticsearch/_async/client/ilm.py +108 -77
- elasticsearch/_async/client/indices.py +1112 -677
- elasticsearch/_async/client/inference.py +1875 -133
- elasticsearch/_async/client/ingest.py +83 -50
- elasticsearch/_async/client/license.py +90 -38
- elasticsearch/_async/client/logstash.py +20 -9
- elasticsearch/_async/client/migration.py +26 -17
- elasticsearch/_async/client/ml.py +642 -365
- elasticsearch/_async/client/monitoring.py +6 -3
- elasticsearch/_async/client/nodes.py +51 -53
- elasticsearch/_async/client/query_rules.py +59 -33
- elasticsearch/_async/client/rollup.py +124 -86
- elasticsearch/_async/client/search_application.py +60 -32
- elasticsearch/_async/client/searchable_snapshots.py +25 -12
- elasticsearch/_async/client/security.py +896 -558
- elasticsearch/_async/client/shutdown.py +34 -36
- elasticsearch/_async/client/simulate.py +22 -28
- elasticsearch/_async/client/slm.py +65 -40
- elasticsearch/_async/client/snapshot.py +190 -213
- elasticsearch/_async/client/sql.py +43 -22
- elasticsearch/_async/client/ssl.py +17 -18
- elasticsearch/_async/client/synonyms.py +58 -37
- elasticsearch/_async/client/tasks.py +77 -48
- elasticsearch/_async/client/text_structure.py +65 -56
- elasticsearch/_async/client/transform.py +124 -93
- elasticsearch/_async/client/watcher.py +116 -72
- elasticsearch/_async/client/xpack.py +18 -9
- elasticsearch/_async/helpers.py +1 -2
- elasticsearch/_sync/client/__init__.py +2146 -859
- elasticsearch/_sync/client/_base.py +0 -1
- elasticsearch/_sync/client/async_search.py +44 -29
- elasticsearch/_sync/client/autoscaling.py +32 -26
- elasticsearch/_sync/client/cat.py +244 -169
- elasticsearch/_sync/client/ccr.py +268 -128
- elasticsearch/_sync/client/cluster.py +191 -164
- elasticsearch/_sync/client/connector.py +212 -116
- elasticsearch/_sync/client/dangling_indices.py +22 -16
- elasticsearch/_sync/client/enrich.py +51 -11
- elasticsearch/_sync/client/eql.py +54 -13
- elasticsearch/_sync/client/esql.py +352 -4
- elasticsearch/_sync/client/features.py +37 -27
- elasticsearch/_sync/client/fleet.py +22 -10
- elasticsearch/_sync/client/graph.py +10 -9
- elasticsearch/_sync/client/ilm.py +108 -77
- elasticsearch/_sync/client/indices.py +1112 -677
- elasticsearch/_sync/client/inference.py +1875 -133
- elasticsearch/_sync/client/ingest.py +83 -50
- elasticsearch/_sync/client/license.py +90 -38
- elasticsearch/_sync/client/logstash.py +20 -9
- elasticsearch/_sync/client/migration.py +26 -17
- elasticsearch/_sync/client/ml.py +642 -365
- elasticsearch/_sync/client/monitoring.py +6 -3
- elasticsearch/_sync/client/nodes.py +51 -53
- elasticsearch/_sync/client/query_rules.py +59 -33
- elasticsearch/_sync/client/rollup.py +124 -86
- elasticsearch/_sync/client/search_application.py +60 -32
- elasticsearch/_sync/client/searchable_snapshots.py +25 -12
- elasticsearch/_sync/client/security.py +896 -558
- elasticsearch/_sync/client/shutdown.py +34 -36
- elasticsearch/_sync/client/simulate.py +22 -28
- elasticsearch/_sync/client/slm.py +65 -40
- elasticsearch/_sync/client/snapshot.py +190 -213
- elasticsearch/_sync/client/sql.py +43 -22
- elasticsearch/_sync/client/ssl.py +17 -18
- elasticsearch/_sync/client/synonyms.py +58 -37
- elasticsearch/_sync/client/tasks.py +77 -48
- elasticsearch/_sync/client/text_structure.py +65 -56
- elasticsearch/_sync/client/transform.py +124 -93
- elasticsearch/_sync/client/utils.py +1 -4
- elasticsearch/_sync/client/watcher.py +116 -72
- elasticsearch/_sync/client/xpack.py +18 -9
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +2 -0
- elasticsearch/dsl/__init__.py +203 -0
- elasticsearch/dsl/_async/__init__.py +16 -0
- elasticsearch/dsl/_async/document.py +522 -0
- elasticsearch/dsl/_async/faceted_search.py +50 -0
- elasticsearch/dsl/_async/index.py +639 -0
- elasticsearch/dsl/_async/mapping.py +49 -0
- elasticsearch/dsl/_async/search.py +233 -0
- elasticsearch/dsl/_async/update_by_query.py +47 -0
- elasticsearch/dsl/_sync/__init__.py +16 -0
- elasticsearch/dsl/_sync/document.py +514 -0
- elasticsearch/dsl/_sync/faceted_search.py +50 -0
- elasticsearch/dsl/_sync/index.py +597 -0
- elasticsearch/dsl/_sync/mapping.py +49 -0
- elasticsearch/dsl/_sync/search.py +226 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3730 -0
- elasticsearch/dsl/analysis.py +341 -0
- elasticsearch/dsl/async_connections.py +37 -0
- elasticsearch/dsl/connections.py +142 -0
- elasticsearch/dsl/document.py +20 -0
- elasticsearch/dsl/document_base.py +444 -0
- elasticsearch/dsl/exceptions.py +32 -0
- elasticsearch/dsl/faceted_search.py +28 -0
- elasticsearch/dsl/faceted_search_base.py +489 -0
- elasticsearch/dsl/field.py +4254 -0
- elasticsearch/dsl/function.py +180 -0
- elasticsearch/dsl/index.py +23 -0
- elasticsearch/dsl/index_base.py +178 -0
- elasticsearch/dsl/mapping.py +19 -0
- elasticsearch/dsl/mapping_base.py +219 -0
- elasticsearch/dsl/query.py +2816 -0
- elasticsearch/dsl/response/__init__.py +388 -0
- elasticsearch/dsl/response/aggs.py +100 -0
- elasticsearch/dsl/response/hit.py +53 -0
- elasticsearch/dsl/search.py +20 -0
- elasticsearch/dsl/search_base.py +1040 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6471 -0
- elasticsearch/dsl/update_by_query.py +19 -0
- elasticsearch/dsl/update_by_query_base.py +149 -0
- elasticsearch/dsl/utils.py +687 -0
- elasticsearch/dsl/wrappers.py +119 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/METADATA +12 -2
- elasticsearch-8.18.0.dist-info/RECORD +161 -0
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-8.18.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -36,13 +36,16 @@ class MlClient(NamespacedClient):
|
|
|
36
36
|
pretty: t.Optional[bool] = None,
|
|
37
37
|
) -> ObjectApiResponse[t.Any]:
|
|
38
38
|
"""
|
|
39
|
-
|
|
40
|
-
the trained model is assigned. A trained model deployment may have an inference
|
|
41
|
-
cache enabled. As requests are handled by each allocated node, their responses
|
|
42
|
-
may be cached on that individual node. Calling this API clears the caches without
|
|
43
|
-
restarting the deployment.
|
|
39
|
+
.. raw:: html
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
<p>Clear trained model deployment cache.</p>
|
|
42
|
+
<p>Cache will be cleared on all nodes where the trained model is assigned.
|
|
43
|
+
A trained model deployment may have an inference cache enabled.
|
|
44
|
+
As requests are handled by each allocated node, their responses may be cached on that individual node.
|
|
45
|
+
Calling this API clears the caches without restarting the deployment.</p>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/clear-trained-model-deployment-cache.html>`_
|
|
46
49
|
|
|
47
50
|
:param model_id: The unique identifier of the trained model.
|
|
48
51
|
"""
|
|
@@ -88,21 +91,16 @@ class MlClient(NamespacedClient):
|
|
|
88
91
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
89
92
|
) -> ObjectApiResponse[t.Any]:
|
|
90
93
|
"""
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
behavior is equivalent to calling stop datafeed API with the same timeout and
|
|
102
|
-
force parameters as the close job request. When a datafeed that has a specified
|
|
103
|
-
end date stops, it automatically closes its associated job.
|
|
104
|
-
|
|
105
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-close-job.html>`_
|
|
94
|
+
.. raw:: html
|
|
95
|
+
|
|
96
|
+
<p>Close anomaly detection jobs.</p>
|
|
97
|
+
<p>A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results.
|
|
98
|
+
When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data.
|
|
99
|
+
If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request.
|
|
100
|
+
When a datafeed that has a specified end date stops, it automatically closes its associated job.</p>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-close-job.html>`_
|
|
106
104
|
|
|
107
105
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
108
106
|
a group name, or a wildcard expression. You can close multiple anomaly detection
|
|
@@ -161,10 +159,13 @@ class MlClient(NamespacedClient):
|
|
|
161
159
|
pretty: t.Optional[bool] = None,
|
|
162
160
|
) -> ObjectApiResponse[t.Any]:
|
|
163
161
|
"""
|
|
164
|
-
|
|
165
|
-
it.
|
|
162
|
+
.. raw:: html
|
|
166
163
|
|
|
167
|
-
|
|
164
|
+
<p>Delete a calendar.</p>
|
|
165
|
+
<p>Remove all scheduled events from a calendar, then delete it.</p>
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-calendar.html>`_
|
|
168
169
|
|
|
169
170
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
170
171
|
"""
|
|
@@ -203,9 +204,12 @@ class MlClient(NamespacedClient):
|
|
|
203
204
|
pretty: t.Optional[bool] = None,
|
|
204
205
|
) -> ObjectApiResponse[t.Any]:
|
|
205
206
|
"""
|
|
206
|
-
|
|
207
|
+
.. raw:: html
|
|
208
|
+
|
|
209
|
+
<p>Delete events from a calendar.</p>
|
|
207
210
|
|
|
208
|
-
|
|
211
|
+
|
|
212
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-calendar-event.html>`_
|
|
209
213
|
|
|
210
214
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
211
215
|
:param event_id: Identifier for the scheduled event. You can obtain this identifier
|
|
@@ -251,9 +255,12 @@ class MlClient(NamespacedClient):
|
|
|
251
255
|
pretty: t.Optional[bool] = None,
|
|
252
256
|
) -> ObjectApiResponse[t.Any]:
|
|
253
257
|
"""
|
|
254
|
-
|
|
258
|
+
.. raw:: html
|
|
259
|
+
|
|
260
|
+
<p>Delete anomaly jobs from a calendar.</p>
|
|
255
261
|
|
|
256
|
-
|
|
262
|
+
|
|
263
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-calendar-job.html>`_
|
|
257
264
|
|
|
258
265
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
259
266
|
:param job_id: An identifier for the anomaly detection jobs. It can be a job
|
|
@@ -300,9 +307,12 @@ class MlClient(NamespacedClient):
|
|
|
300
307
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
301
308
|
) -> ObjectApiResponse[t.Any]:
|
|
302
309
|
"""
|
|
303
|
-
|
|
310
|
+
.. raw:: html
|
|
311
|
+
|
|
312
|
+
<p>Delete a data frame analytics job.</p>
|
|
313
|
+
|
|
304
314
|
|
|
305
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
315
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-dfanalytics.html>`_
|
|
306
316
|
|
|
307
317
|
:param id: Identifier for the data frame analytics job.
|
|
308
318
|
:param force: If `true`, it deletes a job that is not stopped; this method is
|
|
@@ -348,9 +358,12 @@ class MlClient(NamespacedClient):
|
|
|
348
358
|
pretty: t.Optional[bool] = None,
|
|
349
359
|
) -> ObjectApiResponse[t.Any]:
|
|
350
360
|
"""
|
|
351
|
-
|
|
361
|
+
.. raw:: html
|
|
362
|
+
|
|
363
|
+
<p>Delete a datafeed.</p>
|
|
364
|
+
|
|
352
365
|
|
|
353
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
366
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-datafeed.html>`_
|
|
354
367
|
|
|
355
368
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
356
369
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -400,15 +413,20 @@ class MlClient(NamespacedClient):
|
|
|
400
413
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
401
414
|
) -> ObjectApiResponse[t.Any]:
|
|
402
415
|
"""
|
|
403
|
-
|
|
404
|
-
data that have exceeded their retention days period. Machine learning state documents
|
|
405
|
-
that are not associated with any job are also deleted. You can limit the request
|
|
406
|
-
to a single or set of anomaly detection jobs by using a job identifier, a group
|
|
407
|
-
name, a comma-separated list of jobs, or a wildcard expression. You can delete
|
|
408
|
-
expired data for all anomaly detection jobs by using _all, by specifying * as
|
|
409
|
-
the <job_id>, or by omitting the <job_id>.
|
|
416
|
+
.. raw:: html
|
|
410
417
|
|
|
411
|
-
|
|
418
|
+
<p>Delete expired ML data.</p>
|
|
419
|
+
<p>Delete all job results, model snapshots and forecast data that have exceeded
|
|
420
|
+
their retention days period. Machine learning state documents that are not
|
|
421
|
+
associated with any job are also deleted.
|
|
422
|
+
You can limit the request to a single or set of anomaly detection jobs by
|
|
423
|
+
using a job identifier, a group name, a comma-separated list of jobs, or a
|
|
424
|
+
wildcard expression. You can delete expired data for all anomaly detection
|
|
425
|
+
jobs by using <code>_all</code>, by specifying <code>*</code> as the <code><job_id></code>, or by omitting the
|
|
426
|
+
<code><job_id></code>.</p>
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-expired-data.html>`_
|
|
412
430
|
|
|
413
431
|
:param job_id: Identifier for an anomaly detection job. It can be a job identifier,
|
|
414
432
|
a group name, or a wildcard expression.
|
|
@@ -465,11 +483,14 @@ class MlClient(NamespacedClient):
|
|
|
465
483
|
pretty: t.Optional[bool] = None,
|
|
466
484
|
) -> ObjectApiResponse[t.Any]:
|
|
467
485
|
"""
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
486
|
+
.. raw:: html
|
|
487
|
+
|
|
488
|
+
<p>Delete a filter.</p>
|
|
489
|
+
<p>If an anomaly detection job references the filter, you cannot delete the
|
|
490
|
+
filter. You must update or delete the job before you can delete the filter.</p>
|
|
471
491
|
|
|
472
|
-
|
|
492
|
+
|
|
493
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-filter.html>`_
|
|
473
494
|
|
|
474
495
|
:param filter_id: A string that uniquely identifies a filter.
|
|
475
496
|
"""
|
|
@@ -510,12 +531,16 @@ class MlClient(NamespacedClient):
|
|
|
510
531
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
511
532
|
) -> ObjectApiResponse[t.Any]:
|
|
512
533
|
"""
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
534
|
+
.. raw:: html
|
|
535
|
+
|
|
536
|
+
<p>Delete forecasts from a job.</p>
|
|
537
|
+
<p>By default, forecasts are retained for 14 days. You can specify a
|
|
538
|
+
different retention period with the <code>expires_in</code> parameter in the forecast
|
|
539
|
+
jobs API. The delete forecast API enables you to delete one or more
|
|
540
|
+
forecasts before they expire.</p>
|
|
517
541
|
|
|
518
|
-
|
|
542
|
+
|
|
543
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-forecast.html>`_
|
|
519
544
|
|
|
520
545
|
:param job_id: Identifier for the anomaly detection job.
|
|
521
546
|
:param forecast_id: A comma-separated list of forecast identifiers. If you do
|
|
@@ -580,14 +605,18 @@ class MlClient(NamespacedClient):
|
|
|
580
605
|
wait_for_completion: t.Optional[bool] = None,
|
|
581
606
|
) -> ObjectApiResponse[t.Any]:
|
|
582
607
|
"""
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
608
|
+
.. raw:: html
|
|
609
|
+
|
|
610
|
+
<p>Delete an anomaly detection job.</p>
|
|
611
|
+
<p>All job configuration, model state and results are deleted.
|
|
612
|
+
It is not currently possible to delete multiple jobs using wildcards or a
|
|
613
|
+
comma separated list. If you delete a job that has a datafeed, the request
|
|
614
|
+
first tries to delete the datafeed. This behavior is equivalent to calling
|
|
615
|
+
the delete datafeed API with the same timeout and force parameters as the
|
|
616
|
+
delete job request.</p>
|
|
617
|
+
|
|
589
618
|
|
|
590
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
619
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-job.html>`_
|
|
591
620
|
|
|
592
621
|
:param job_id: Identifier for the anomaly detection job.
|
|
593
622
|
:param delete_user_annotations: Specifies whether annotations that have been
|
|
@@ -639,11 +668,15 @@ class MlClient(NamespacedClient):
|
|
|
639
668
|
pretty: t.Optional[bool] = None,
|
|
640
669
|
) -> ObjectApiResponse[t.Any]:
|
|
641
670
|
"""
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
671
|
+
.. raw:: html
|
|
672
|
+
|
|
673
|
+
<p>Delete a model snapshot.</p>
|
|
674
|
+
<p>You cannot delete the active model snapshot. To delete that snapshot, first
|
|
675
|
+
revert to a different one. To identify the active model snapshot, refer to
|
|
676
|
+
the <code>model_snapshot_id</code> in the results from the get jobs API.</p>
|
|
677
|
+
|
|
645
678
|
|
|
646
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
679
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-delete-snapshot.html>`_
|
|
647
680
|
|
|
648
681
|
:param job_id: Identifier for the anomaly detection job.
|
|
649
682
|
:param snapshot_id: Identifier for the model snapshot.
|
|
@@ -686,16 +719,22 @@ class MlClient(NamespacedClient):
|
|
|
686
719
|
force: t.Optional[bool] = None,
|
|
687
720
|
human: t.Optional[bool] = None,
|
|
688
721
|
pretty: t.Optional[bool] = None,
|
|
722
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
689
723
|
) -> ObjectApiResponse[t.Any]:
|
|
690
724
|
"""
|
|
691
|
-
|
|
692
|
-
|
|
725
|
+
.. raw:: html
|
|
726
|
+
|
|
727
|
+
<p>Delete an unreferenced trained model.</p>
|
|
728
|
+
<p>The request deletes a trained inference model that is not referenced by an ingest pipeline.</p>
|
|
729
|
+
|
|
693
730
|
|
|
694
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
731
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-trained-models.html>`_
|
|
695
732
|
|
|
696
733
|
:param model_id: The unique identifier of the trained model.
|
|
697
734
|
:param force: Forcefully deletes a trained model that is referenced by ingest
|
|
698
735
|
pipelines or has a started deployment.
|
|
736
|
+
:param timeout: Period to wait for a response. If no response is received before
|
|
737
|
+
the timeout expires, the request fails and returns an error.
|
|
699
738
|
"""
|
|
700
739
|
if model_id in SKIP_IN_PATH:
|
|
701
740
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
@@ -712,6 +751,8 @@ class MlClient(NamespacedClient):
|
|
|
712
751
|
__query["human"] = human
|
|
713
752
|
if pretty is not None:
|
|
714
753
|
__query["pretty"] = pretty
|
|
754
|
+
if timeout is not None:
|
|
755
|
+
__query["timeout"] = timeout
|
|
715
756
|
__headers = {"accept": "application/json"}
|
|
716
757
|
return await self.perform_request( # type: ignore[return-value]
|
|
717
758
|
"DELETE",
|
|
@@ -734,11 +775,15 @@ class MlClient(NamespacedClient):
|
|
|
734
775
|
pretty: t.Optional[bool] = None,
|
|
735
776
|
) -> ObjectApiResponse[t.Any]:
|
|
736
777
|
"""
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
778
|
+
.. raw:: html
|
|
779
|
+
|
|
780
|
+
<p>Delete a trained model alias.</p>
|
|
781
|
+
<p>This API deletes an existing model alias that refers to a trained model. If
|
|
782
|
+
the model alias is missing or refers to a model other than the one identified
|
|
783
|
+
by the <code>model_id</code>, this API returns an error.</p>
|
|
740
784
|
|
|
741
|
-
|
|
785
|
+
|
|
786
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-trained-models-aliases.html>`_
|
|
742
787
|
|
|
743
788
|
:param model_id: The trained model ID to which the model alias refers.
|
|
744
789
|
:param model_alias: The model alias to delete.
|
|
@@ -791,11 +836,15 @@ class MlClient(NamespacedClient):
|
|
|
791
836
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
792
837
|
) -> ObjectApiResponse[t.Any]:
|
|
793
838
|
"""
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
839
|
+
.. raw:: html
|
|
840
|
+
|
|
841
|
+
<p>Estimate job model memory usage.</p>
|
|
842
|
+
<p>Make an estimation of the memory usage for an anomaly detection job model.
|
|
843
|
+
The estimate is based on analysis configuration details for the job and cardinality
|
|
844
|
+
estimates for the fields it references.</p>
|
|
797
845
|
|
|
798
|
-
|
|
846
|
+
|
|
847
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-estimate-model-memory.html>`_
|
|
799
848
|
|
|
800
849
|
:param analysis_config: For a list of the properties that you can specify in
|
|
801
850
|
the `analysis_config` component of the body of this API.
|
|
@@ -858,12 +907,16 @@ class MlClient(NamespacedClient):
|
|
|
858
907
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
859
908
|
) -> ObjectApiResponse[t.Any]:
|
|
860
909
|
"""
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
910
|
+
.. raw:: html
|
|
911
|
+
|
|
912
|
+
<p>Evaluate data frame analytics.</p>
|
|
913
|
+
<p>The API packages together commonly used evaluation metrics for various types
|
|
914
|
+
of machine learning features. This has been designed for use on indexes
|
|
915
|
+
created by data frame analytics. Evaluation requires both a ground truth
|
|
916
|
+
field and an analytics result field to be present.</p>
|
|
917
|
+
|
|
865
918
|
|
|
866
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
919
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/evaluate-dfanalytics.html>`_
|
|
867
920
|
|
|
868
921
|
:param evaluation: Defines the type of evaluation you want to perform.
|
|
869
922
|
:param index: Defines the `index` in which the evaluation will be performed.
|
|
@@ -935,15 +988,20 @@ class MlClient(NamespacedClient):
|
|
|
935
988
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
936
989
|
) -> ObjectApiResponse[t.Any]:
|
|
937
990
|
"""
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
991
|
+
.. raw:: html
|
|
992
|
+
|
|
993
|
+
<p>Explain data frame analytics config.</p>
|
|
994
|
+
<p>This API provides explanations for a data frame analytics config that either
|
|
995
|
+
exists already or one that has not been created yet. The following
|
|
996
|
+
explanations are provided:</p>
|
|
997
|
+
<ul>
|
|
998
|
+
<li>which fields are included or not in the analysis and why,</li>
|
|
999
|
+
<li>how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on.
|
|
1000
|
+
If you have object fields or fields that are excluded via source filtering, they are not included in the explanation.</li>
|
|
1001
|
+
</ul>
|
|
1002
|
+
|
|
945
1003
|
|
|
946
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1004
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/explain-dfanalytics.html>`_
|
|
947
1005
|
|
|
948
1006
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
949
1007
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -1041,16 +1099,20 @@ class MlClient(NamespacedClient):
|
|
|
1041
1099
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1042
1100
|
) -> ObjectApiResponse[t.Any]:
|
|
1043
1101
|
"""
|
|
1044
|
-
|
|
1045
|
-
sending data for analysis using the post data API. Depending on the content of
|
|
1046
|
-
the buffer, then it might additionally calculate new results. Both flush and
|
|
1047
|
-
close operations are similar, however the flush is more efficient if you are
|
|
1048
|
-
expecting to send more data for analysis. When flushing, the job remains open
|
|
1049
|
-
and is available to continue analyzing data. A close operation additionally prunes
|
|
1050
|
-
and persists the model state to disk and the job must be opened again before
|
|
1051
|
-
analyzing further data.
|
|
1102
|
+
.. raw:: html
|
|
1052
1103
|
|
|
1053
|
-
|
|
1104
|
+
<p>Force buffered data to be processed.
|
|
1105
|
+
The flush jobs API is only applicable when sending data for analysis using
|
|
1106
|
+
the post data API. Depending on the content of the buffer, then it might
|
|
1107
|
+
additionally calculate new results. Both flush and close operations are
|
|
1108
|
+
similar, however the flush is more efficient if you are expecting to send
|
|
1109
|
+
more data for analysis. When flushing, the job remains open and is available
|
|
1110
|
+
to continue analyzing data. A close operation additionally prunes and
|
|
1111
|
+
persists the model state to disk and the job must be opened again before
|
|
1112
|
+
analyzing further data.</p>
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-flush-job.html>`_
|
|
1054
1116
|
|
|
1055
1117
|
:param job_id: Identifier for the anomaly detection job.
|
|
1056
1118
|
:param advance_time: Refer to the description for the `advance_time` query parameter.
|
|
@@ -1116,12 +1178,16 @@ class MlClient(NamespacedClient):
|
|
|
1116
1178
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1117
1179
|
) -> ObjectApiResponse[t.Any]:
|
|
1118
1180
|
"""
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1181
|
+
.. raw:: html
|
|
1182
|
+
|
|
1183
|
+
<p>Predict future behavior of a time series.</p>
|
|
1184
|
+
<p>Forecasts are not supported for jobs that perform population analysis; an
|
|
1185
|
+
error occurs if you try to create a forecast for a job that has an
|
|
1186
|
+
<code>over_field_name</code> in its configuration. Forcasts predict future behavior
|
|
1187
|
+
based on historical data.</p>
|
|
1123
1188
|
|
|
1124
|
-
|
|
1189
|
+
|
|
1190
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-forecast.html>`_
|
|
1125
1191
|
|
|
1126
1192
|
:param job_id: Identifier for the anomaly detection job. The job must be open
|
|
1127
1193
|
when you create a forecast; otherwise, an error occurs.
|
|
@@ -1201,10 +1267,13 @@ class MlClient(NamespacedClient):
|
|
|
1201
1267
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1202
1268
|
) -> ObjectApiResponse[t.Any]:
|
|
1203
1269
|
"""
|
|
1204
|
-
|
|
1205
|
-
|
|
1270
|
+
.. raw:: html
|
|
1271
|
+
|
|
1272
|
+
<p>Get anomaly detection job results for buckets.
|
|
1273
|
+
The API presents a chronological view of the records, grouped by bucket.</p>
|
|
1206
1274
|
|
|
1207
|
-
|
|
1275
|
+
|
|
1276
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-bucket.html>`_
|
|
1208
1277
|
|
|
1209
1278
|
:param job_id: Identifier for the anomaly detection job.
|
|
1210
1279
|
:param timestamp: The timestamp of a single bucket result. If you do not specify
|
|
@@ -1297,9 +1366,12 @@ class MlClient(NamespacedClient):
|
|
|
1297
1366
|
start: t.Optional[t.Union[str, t.Any]] = None,
|
|
1298
1367
|
) -> ObjectApiResponse[t.Any]:
|
|
1299
1368
|
"""
|
|
1300
|
-
|
|
1369
|
+
.. raw:: html
|
|
1370
|
+
|
|
1371
|
+
<p>Get info about events in calendars.</p>
|
|
1372
|
+
|
|
1301
1373
|
|
|
1302
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1374
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-calendar-event.html>`_
|
|
1303
1375
|
|
|
1304
1376
|
:param calendar_id: A string that uniquely identifies a calendar. You can get
|
|
1305
1377
|
information for multiple calendars by using a comma-separated list of ids
|
|
@@ -1363,9 +1435,12 @@ class MlClient(NamespacedClient):
|
|
|
1363
1435
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1364
1436
|
) -> ObjectApiResponse[t.Any]:
|
|
1365
1437
|
"""
|
|
1366
|
-
|
|
1438
|
+
.. raw:: html
|
|
1439
|
+
|
|
1440
|
+
<p>Get calendar configuration info.</p>
|
|
1441
|
+
|
|
1367
1442
|
|
|
1368
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1443
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-calendar.html>`_
|
|
1369
1444
|
|
|
1370
1445
|
:param calendar_id: A string that uniquely identifies a calendar. You can get
|
|
1371
1446
|
information for multiple calendars by using a comma-separated list of ids
|
|
@@ -1436,9 +1511,12 @@ class MlClient(NamespacedClient):
|
|
|
1436
1511
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1437
1512
|
) -> ObjectApiResponse[t.Any]:
|
|
1438
1513
|
"""
|
|
1439
|
-
|
|
1514
|
+
.. raw:: html
|
|
1440
1515
|
|
|
1441
|
-
|
|
1516
|
+
<p>Get anomaly detection job results for categories.</p>
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-category.html>`_
|
|
1442
1520
|
|
|
1443
1521
|
:param job_id: Identifier for the anomaly detection job.
|
|
1444
1522
|
:param category_id: Identifier for the category, which is unique in the job.
|
|
@@ -1518,11 +1596,15 @@ class MlClient(NamespacedClient):
|
|
|
1518
1596
|
size: t.Optional[int] = None,
|
|
1519
1597
|
) -> ObjectApiResponse[t.Any]:
|
|
1520
1598
|
"""
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1599
|
+
.. raw:: html
|
|
1600
|
+
|
|
1601
|
+
<p>Get data frame analytics job configuration info.
|
|
1602
|
+
You can get information for multiple data frame analytics jobs in a single
|
|
1603
|
+
API request by using a comma-separated list of data frame analytics jobs or a
|
|
1604
|
+
wildcard expression.</p>
|
|
1524
1605
|
|
|
1525
|
-
|
|
1606
|
+
|
|
1607
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-dfanalytics.html>`_
|
|
1526
1608
|
|
|
1527
1609
|
:param id: Identifier for the data frame analytics job. If you do not specify
|
|
1528
1610
|
this option, the API returns information for the first hundred data frame
|
|
@@ -1592,9 +1674,12 @@ class MlClient(NamespacedClient):
|
|
|
1592
1674
|
verbose: t.Optional[bool] = None,
|
|
1593
1675
|
) -> ObjectApiResponse[t.Any]:
|
|
1594
1676
|
"""
|
|
1595
|
-
|
|
1677
|
+
.. raw:: html
|
|
1678
|
+
|
|
1679
|
+
<p>Get data frame analytics jobs usage info.</p>
|
|
1596
1680
|
|
|
1597
|
-
|
|
1681
|
+
|
|
1682
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-dfanalytics-stats.html>`_
|
|
1598
1683
|
|
|
1599
1684
|
:param id: Identifier for the data frame analytics job. If you do not specify
|
|
1600
1685
|
this option, the API returns information for the first hundred data frame
|
|
@@ -1657,14 +1742,18 @@ class MlClient(NamespacedClient):
|
|
|
1657
1742
|
pretty: t.Optional[bool] = None,
|
|
1658
1743
|
) -> ObjectApiResponse[t.Any]:
|
|
1659
1744
|
"""
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1745
|
+
.. raw:: html
|
|
1746
|
+
|
|
1747
|
+
<p>Get datafeeds usage info.
|
|
1748
|
+
You can get statistics for multiple datafeeds in a single API request by
|
|
1749
|
+
using a comma-separated list of datafeeds or a wildcard expression. You can
|
|
1750
|
+
get statistics for all datafeeds by using <code>_all</code>, by specifying <code>*</code> as the
|
|
1751
|
+
<code><feed_id></code>, or by omitting the <code><feed_id></code>. If the datafeed is stopped, the
|
|
1752
|
+
only information you receive is the <code>datafeed_id</code> and the <code>state</code>.
|
|
1753
|
+
This API returns a maximum of 10,000 datafeeds.</p>
|
|
1754
|
+
|
|
1666
1755
|
|
|
1667
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1756
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-datafeed-stats.html>`_
|
|
1668
1757
|
|
|
1669
1758
|
:param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier
|
|
1670
1759
|
or a wildcard expression. If you do not specify one of these options, the
|
|
@@ -1718,13 +1807,17 @@ class MlClient(NamespacedClient):
|
|
|
1718
1807
|
pretty: t.Optional[bool] = None,
|
|
1719
1808
|
) -> ObjectApiResponse[t.Any]:
|
|
1720
1809
|
"""
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1810
|
+
.. raw:: html
|
|
1811
|
+
|
|
1812
|
+
<p>Get datafeeds configuration info.
|
|
1813
|
+
You can get information for multiple datafeeds in a single API request by
|
|
1814
|
+
using a comma-separated list of datafeeds or a wildcard expression. You can
|
|
1815
|
+
get information for all datafeeds by using <code>_all</code>, by specifying <code>*</code> as the
|
|
1816
|
+
<code><feed_id></code>, or by omitting the <code><feed_id></code>.
|
|
1817
|
+
This API returns a maximum of 10,000 datafeeds.</p>
|
|
1818
|
+
|
|
1726
1819
|
|
|
1727
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1820
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-datafeed.html>`_
|
|
1728
1821
|
|
|
1729
1822
|
:param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier
|
|
1730
1823
|
or a wildcard expression. If you do not specify one of these options, the
|
|
@@ -1785,9 +1878,13 @@ class MlClient(NamespacedClient):
|
|
|
1785
1878
|
size: t.Optional[int] = None,
|
|
1786
1879
|
) -> ObjectApiResponse[t.Any]:
|
|
1787
1880
|
"""
|
|
1788
|
-
|
|
1881
|
+
.. raw:: html
|
|
1789
1882
|
|
|
1790
|
-
|
|
1883
|
+
<p>Get filters.
|
|
1884
|
+
You can get a single filter or all filters.</p>
|
|
1885
|
+
|
|
1886
|
+
|
|
1887
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-filter.html>`_
|
|
1791
1888
|
|
|
1792
1889
|
:param filter_id: A string that uniquely identifies a filter.
|
|
1793
1890
|
:param from_: Skips the specified number of filters.
|
|
@@ -1847,11 +1944,15 @@ class MlClient(NamespacedClient):
|
|
|
1847
1944
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
1848
1945
|
) -> ObjectApiResponse[t.Any]:
|
|
1849
1946
|
"""
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1947
|
+
.. raw:: html
|
|
1948
|
+
|
|
1949
|
+
<p>Get anomaly detection job results for influencers.
|
|
1950
|
+
Influencers are the entities that have contributed to, or are to blame for,
|
|
1951
|
+
the anomalies. Influencer results are available only if an
|
|
1952
|
+
<code>influencer_field_name</code> is specified in the job configuration.</p>
|
|
1853
1953
|
|
|
1854
|
-
|
|
1954
|
+
|
|
1955
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-influencer.html>`_
|
|
1855
1956
|
|
|
1856
1957
|
:param job_id: Identifier for the anomaly detection job.
|
|
1857
1958
|
:param desc: If true, the results are sorted in descending order.
|
|
@@ -1930,9 +2031,12 @@ class MlClient(NamespacedClient):
|
|
|
1930
2031
|
pretty: t.Optional[bool] = None,
|
|
1931
2032
|
) -> ObjectApiResponse[t.Any]:
|
|
1932
2033
|
"""
|
|
1933
|
-
|
|
2034
|
+
.. raw:: html
|
|
2035
|
+
|
|
2036
|
+
<p>Get anomaly detection jobs usage info.</p>
|
|
1934
2037
|
|
|
1935
|
-
|
|
2038
|
+
|
|
2039
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-job-stats.html>`_
|
|
1936
2040
|
|
|
1937
2041
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
1938
2042
|
a group name, a comma-separated list of jobs, or a wildcard expression. If
|
|
@@ -1987,13 +2091,16 @@ class MlClient(NamespacedClient):
|
|
|
1987
2091
|
pretty: t.Optional[bool] = None,
|
|
1988
2092
|
) -> ObjectApiResponse[t.Any]:
|
|
1989
2093
|
"""
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2094
|
+
.. raw:: html
|
|
2095
|
+
|
|
2096
|
+
<p>Get anomaly detection jobs configuration info.
|
|
2097
|
+
You can get information for multiple anomaly detection jobs in a single API
|
|
2098
|
+
request by using a group name, a comma-separated list of jobs, or a wildcard
|
|
2099
|
+
expression. You can get information for all anomaly detection jobs by using
|
|
2100
|
+
<code>_all</code>, by specifying <code>*</code> as the <code><job_id></code>, or by omitting the <code><job_id></code>.</p>
|
|
2101
|
+
|
|
1995
2102
|
|
|
1996
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2103
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-job.html>`_
|
|
1997
2104
|
|
|
1998
2105
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
1999
2106
|
a group name, or a wildcard expression. If you do not specify one of these
|
|
@@ -2052,11 +2159,14 @@ class MlClient(NamespacedClient):
|
|
|
2052
2159
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
2053
2160
|
) -> ObjectApiResponse[t.Any]:
|
|
2054
2161
|
"""
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2162
|
+
.. raw:: html
|
|
2163
|
+
|
|
2164
|
+
<p>Get machine learning memory usage info.
|
|
2165
|
+
Get information about how machine learning jobs and trained models are using memory,
|
|
2166
|
+
on each node, both within the JVM heap, and natively, outside of the JVM.</p>
|
|
2167
|
+
|
|
2058
2168
|
|
|
2059
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2169
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-ml-memory.html>`_
|
|
2060
2170
|
|
|
2061
2171
|
:param node_id: The names of particular nodes in the cluster to target. For example,
|
|
2062
2172
|
`nodeId1,nodeId2` or `ml:true`
|
|
@@ -2109,9 +2219,12 @@ class MlClient(NamespacedClient):
|
|
|
2109
2219
|
pretty: t.Optional[bool] = None,
|
|
2110
2220
|
) -> ObjectApiResponse[t.Any]:
|
|
2111
2221
|
"""
|
|
2112
|
-
|
|
2222
|
+
.. raw:: html
|
|
2113
2223
|
|
|
2114
|
-
|
|
2224
|
+
<p>Get anomaly detection job model snapshot upgrade usage info.</p>
|
|
2225
|
+
|
|
2226
|
+
|
|
2227
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-job-model-snapshot-upgrade-stats.html>`_
|
|
2115
2228
|
|
|
2116
2229
|
:param job_id: Identifier for the anomaly detection job.
|
|
2117
2230
|
:param snapshot_id: A numerical character string that uniquely identifies the
|
|
@@ -2180,9 +2293,12 @@ class MlClient(NamespacedClient):
|
|
|
2180
2293
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2181
2294
|
) -> ObjectApiResponse[t.Any]:
|
|
2182
2295
|
"""
|
|
2183
|
-
|
|
2296
|
+
.. raw:: html
|
|
2297
|
+
|
|
2298
|
+
<p>Get model snapshots info.</p>
|
|
2184
2299
|
|
|
2185
|
-
|
|
2300
|
+
|
|
2301
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-snapshot.html>`_
|
|
2186
2302
|
|
|
2187
2303
|
:param job_id: Identifier for the anomaly detection job.
|
|
2188
2304
|
:param snapshot_id: A numerical character string that uniquely identifies the
|
|
@@ -2281,21 +2397,28 @@ class MlClient(NamespacedClient):
|
|
|
2281
2397
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2282
2398
|
) -> ObjectApiResponse[t.Any]:
|
|
2283
2399
|
"""
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2400
|
+
.. raw:: html
|
|
2401
|
+
|
|
2402
|
+
<p>Get overall bucket results.</p>
|
|
2403
|
+
<p>Retrievs overall bucket results that summarize the bucket results of
|
|
2404
|
+
multiple anomaly detection jobs.</p>
|
|
2405
|
+
<p>The <code>overall_score</code> is calculated by combining the scores of all the
|
|
2406
|
+
buckets within the overall bucket span. First, the maximum
|
|
2407
|
+
<code>anomaly_score</code> per anomaly detection job in the overall bucket is
|
|
2408
|
+
calculated. Then the <code>top_n</code> of those scores are averaged to result in
|
|
2409
|
+
the <code>overall_score</code>. This means that you can fine-tune the
|
|
2410
|
+
<code>overall_score</code> so that it is more or less sensitive to the number of
|
|
2411
|
+
jobs that detect an anomaly at the same time. For example, if you set
|
|
2412
|
+
<code>top_n</code> to <code>1</code>, the <code>overall_score</code> is the maximum bucket score in the
|
|
2413
|
+
overall bucket. Alternatively, if you set <code>top_n</code> to the number of jobs,
|
|
2414
|
+
the <code>overall_score</code> is high only when all jobs detect anomalies in that
|
|
2415
|
+
overall bucket. If you set the <code>bucket_span</code> parameter (to a value
|
|
2416
|
+
greater than its default), the <code>overall_score</code> is the maximum
|
|
2417
|
+
<code>overall_score</code> of the overall buckets that have a span equal to the
|
|
2418
|
+
jobs' largest bucket span.</p>
|
|
2419
|
+
|
|
2420
|
+
|
|
2421
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-overall-buckets.html>`_
|
|
2299
2422
|
|
|
2300
2423
|
:param job_id: Identifier for the anomaly detection job. It can be a job identifier,
|
|
2301
2424
|
a group name, a comma-separated list of jobs or groups, or a wildcard expression.
|
|
@@ -2390,17 +2513,22 @@ class MlClient(NamespacedClient):
|
|
|
2390
2513
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2391
2514
|
) -> ObjectApiResponse[t.Any]:
|
|
2392
2515
|
"""
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2516
|
+
.. raw:: html
|
|
2517
|
+
|
|
2518
|
+
<p>Get anomaly records for an anomaly detection job.
|
|
2519
|
+
Records contain the detailed analytical results. They describe the anomalous
|
|
2520
|
+
activity that has been identified in the input data based on the detector
|
|
2521
|
+
configuration.
|
|
2522
|
+
There can be many anomaly records depending on the characteristics and size
|
|
2523
|
+
of the input data. In practice, there are often too many to be able to
|
|
2524
|
+
manually process them. The machine learning features therefore perform a
|
|
2525
|
+
sophisticated aggregation of the anomaly records into buckets.
|
|
2526
|
+
The number of record results depends on the number of anomalies found in each
|
|
2527
|
+
bucket, which relates to the number of time series being modeled and the
|
|
2528
|
+
number of detectors.</p>
|
|
2402
2529
|
|
|
2403
|
-
|
|
2530
|
+
|
|
2531
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-get-record.html>`_
|
|
2404
2532
|
|
|
2405
2533
|
:param job_id: Identifier for the anomaly detection job.
|
|
2406
2534
|
:param desc: Refer to the description for the `desc` query parameter.
|
|
@@ -2494,9 +2622,12 @@ class MlClient(NamespacedClient):
|
|
|
2494
2622
|
tags: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2495
2623
|
) -> ObjectApiResponse[t.Any]:
|
|
2496
2624
|
"""
|
|
2497
|
-
|
|
2625
|
+
.. raw:: html
|
|
2626
|
+
|
|
2627
|
+
<p>Get trained model configuration info.</p>
|
|
2628
|
+
|
|
2498
2629
|
|
|
2499
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2630
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-trained-models.html>`_
|
|
2500
2631
|
|
|
2501
2632
|
:param model_id: The unique identifier of the trained model or a model alias.
|
|
2502
2633
|
You can get information for multiple trained models in a single API request
|
|
@@ -2580,11 +2711,14 @@ class MlClient(NamespacedClient):
|
|
|
2580
2711
|
size: t.Optional[int] = None,
|
|
2581
2712
|
) -> ObjectApiResponse[t.Any]:
|
|
2582
2713
|
"""
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2714
|
+
.. raw:: html
|
|
2715
|
+
|
|
2716
|
+
<p>Get trained models usage info.
|
|
2717
|
+
You can get usage information for multiple trained
|
|
2718
|
+
models in a single API request by using a comma-separated list of model IDs or a wildcard expression.</p>
|
|
2719
|
+
|
|
2586
2720
|
|
|
2587
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2721
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-trained-models-stats.html>`_
|
|
2588
2722
|
|
|
2589
2723
|
:param model_id: The unique identifier of the trained model or a model alias.
|
|
2590
2724
|
It can be a comma-separated list or a wildcard expression.
|
|
@@ -2645,9 +2779,12 @@ class MlClient(NamespacedClient):
|
|
|
2645
2779
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2646
2780
|
) -> ObjectApiResponse[t.Any]:
|
|
2647
2781
|
"""
|
|
2648
|
-
|
|
2782
|
+
.. raw:: html
|
|
2649
2783
|
|
|
2650
|
-
|
|
2784
|
+
<p>Evaluate a trained model.</p>
|
|
2785
|
+
|
|
2786
|
+
|
|
2787
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-trained-model.html>`_
|
|
2651
2788
|
|
|
2652
2789
|
:param model_id: The unique identifier of the trained model.
|
|
2653
2790
|
:param docs: An array of objects to pass to the model for inference. The objects
|
|
@@ -2702,14 +2839,19 @@ class MlClient(NamespacedClient):
|
|
|
2702
2839
|
pretty: t.Optional[bool] = None,
|
|
2703
2840
|
) -> ObjectApiResponse[t.Any]:
|
|
2704
2841
|
"""
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2842
|
+
.. raw:: html
|
|
2843
|
+
|
|
2844
|
+
<p>Get machine learning information.
|
|
2845
|
+
Get defaults and limits used by machine learning.
|
|
2846
|
+
This endpoint is designed to be used by a user interface that needs to fully
|
|
2847
|
+
understand machine learning configurations where some options are not
|
|
2848
|
+
specified, meaning that the defaults should be used. This endpoint may be
|
|
2849
|
+
used to find out what those defaults are. It also provides information about
|
|
2850
|
+
the maximum size of machine learning jobs that could run in the current
|
|
2851
|
+
cluster configuration.</p>
|
|
2711
2852
|
|
|
2712
|
-
|
|
2853
|
+
|
|
2854
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/get-ml-info.html>`_
|
|
2713
2855
|
"""
|
|
2714
2856
|
__path_parts: t.Dict[str, str] = {}
|
|
2715
2857
|
__path = "/_ml/info"
|
|
@@ -2747,14 +2889,18 @@ class MlClient(NamespacedClient):
|
|
|
2747
2889
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2748
2890
|
) -> ObjectApiResponse[t.Any]:
|
|
2749
2891
|
"""
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2892
|
+
.. raw:: html
|
|
2893
|
+
|
|
2894
|
+
<p>Open anomaly detection jobs.</p>
|
|
2895
|
+
<p>An anomaly detection job must be opened to be ready to receive and analyze
|
|
2896
|
+
data. It can be opened and closed multiple times throughout its lifecycle.
|
|
2897
|
+
When you open a new job, it starts with an empty model.
|
|
2898
|
+
When you open an existing job, the most recent model state is automatically
|
|
2899
|
+
loaded. The job is ready to resume its analysis from where it left off, once
|
|
2900
|
+
new data is received.</p>
|
|
2756
2901
|
|
|
2757
|
-
|
|
2902
|
+
|
|
2903
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-open-job.html>`_
|
|
2758
2904
|
|
|
2759
2905
|
:param job_id: Identifier for the anomaly detection job.
|
|
2760
2906
|
:param timeout: Refer to the description for the `timeout` query parameter.
|
|
@@ -2806,9 +2952,12 @@ class MlClient(NamespacedClient):
|
|
|
2806
2952
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2807
2953
|
) -> ObjectApiResponse[t.Any]:
|
|
2808
2954
|
"""
|
|
2809
|
-
|
|
2955
|
+
.. raw:: html
|
|
2956
|
+
|
|
2957
|
+
<p>Add scheduled events to the calendar.</p>
|
|
2958
|
+
|
|
2810
2959
|
|
|
2811
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
2960
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-post-calendar-event.html>`_
|
|
2812
2961
|
|
|
2813
2962
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
2814
2963
|
:param events: A list of one of more scheduled events. The event’s start and
|
|
@@ -2862,11 +3011,14 @@ class MlClient(NamespacedClient):
|
|
|
2862
3011
|
reset_start: t.Optional[t.Union[str, t.Any]] = None,
|
|
2863
3012
|
) -> ObjectApiResponse[t.Any]:
|
|
2864
3013
|
"""
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
3014
|
+
.. raw:: html
|
|
3015
|
+
|
|
3016
|
+
<p>Send data to an anomaly detection job for analysis.</p>
|
|
3017
|
+
<p>IMPORTANT: For each job, data can be accepted from only a single connection at a time.
|
|
3018
|
+
It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.</p>
|
|
3019
|
+
|
|
2868
3020
|
|
|
2869
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3021
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-post-data.html>`_
|
|
2870
3022
|
|
|
2871
3023
|
:param job_id: Identifier for the anomaly detection job. The job must have a
|
|
2872
3024
|
state of open to receive and process the data.
|
|
@@ -2927,10 +3079,13 @@ class MlClient(NamespacedClient):
|
|
|
2927
3079
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2928
3080
|
) -> ObjectApiResponse[t.Any]:
|
|
2929
3081
|
"""
|
|
2930
|
-
|
|
2931
|
-
used by a data frame analytics config.
|
|
3082
|
+
.. raw:: html
|
|
2932
3083
|
|
|
2933
|
-
|
|
3084
|
+
<p>Preview features used by data frame analytics.
|
|
3085
|
+
Preview the extracted features used by a data frame analytics config.</p>
|
|
3086
|
+
|
|
3087
|
+
|
|
3088
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/preview-dfanalytics.html>`_
|
|
2934
3089
|
|
|
2935
3090
|
:param id: Identifier for the data frame analytics job.
|
|
2936
3091
|
:param config: A data frame analytics config as described in create data frame
|
|
@@ -2990,17 +3145,20 @@ class MlClient(NamespacedClient):
|
|
|
2990
3145
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2991
3146
|
) -> ObjectApiResponse[t.Any]:
|
|
2992
3147
|
"""
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3148
|
+
.. raw:: html
|
|
3149
|
+
|
|
3150
|
+
<p>Preview a datafeed.
|
|
3151
|
+
This API returns the first "page" of search results from a datafeed.
|
|
3152
|
+
You can preview an existing datafeed or provide configuration details for a datafeed
|
|
3153
|
+
and anomaly detection job in the API. The preview shows the structure of the data
|
|
3154
|
+
that will be passed to the anomaly detection engine.
|
|
3155
|
+
IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that
|
|
3156
|
+
called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the
|
|
3157
|
+
datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials.
|
|
3158
|
+
You can also use secondary authorization headers to supply the credentials.</p>
|
|
3002
3159
|
|
|
3003
|
-
|
|
3160
|
+
|
|
3161
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-preview-datafeed.html>`_
|
|
3004
3162
|
|
|
3005
3163
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
3006
3164
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -3074,9 +3232,12 @@ class MlClient(NamespacedClient):
|
|
|
3074
3232
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3075
3233
|
) -> ObjectApiResponse[t.Any]:
|
|
3076
3234
|
"""
|
|
3077
|
-
|
|
3235
|
+
.. raw:: html
|
|
3236
|
+
|
|
3237
|
+
<p>Create a calendar.</p>
|
|
3078
3238
|
|
|
3079
|
-
|
|
3239
|
+
|
|
3240
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-put-calendar.html>`_
|
|
3080
3241
|
|
|
3081
3242
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
3082
3243
|
:param description: A description of the calendar.
|
|
@@ -3128,9 +3289,12 @@ class MlClient(NamespacedClient):
|
|
|
3128
3289
|
pretty: t.Optional[bool] = None,
|
|
3129
3290
|
) -> ObjectApiResponse[t.Any]:
|
|
3130
3291
|
"""
|
|
3131
|
-
|
|
3292
|
+
.. raw:: html
|
|
3293
|
+
|
|
3294
|
+
<p>Add anomaly detection job to calendar.</p>
|
|
3295
|
+
|
|
3132
3296
|
|
|
3133
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3297
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-put-calendar-job.html>`_
|
|
3134
3298
|
|
|
3135
3299
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
3136
3300
|
:param job_id: An identifier for the anomaly detection jobs. It can be a job
|
|
@@ -3203,15 +3367,17 @@ class MlClient(NamespacedClient):
|
|
|
3203
3367
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3204
3368
|
) -> ObjectApiResponse[t.Any]:
|
|
3205
3369
|
"""
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3370
|
+
.. raw:: html
|
|
3371
|
+
|
|
3372
|
+
<p>Create a data frame analytics job.
|
|
3373
|
+
This API creates a data frame analytics job that performs an analysis on the
|
|
3374
|
+
source indices and stores the outcome in a destination index.
|
|
3375
|
+
By default, the query used in the source configuration is <code>{"match_all": {}}</code>.</p>
|
|
3376
|
+
<p>If the destination index does not exist, it is created automatically when you start the job.</p>
|
|
3377
|
+
<p>If you supply only a subset of the regression or classification parameters, hyperparameter optimization occurs. It determines a value for each of the undefined parameters.</p>
|
|
3378
|
+
|
|
3213
3379
|
|
|
3214
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3380
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-dfanalytics.html>`_
|
|
3215
3381
|
|
|
3216
3382
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
3217
3383
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -3382,20 +3548,21 @@ class MlClient(NamespacedClient):
|
|
|
3382
3548
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3383
3549
|
) -> ObjectApiResponse[t.Any]:
|
|
3384
3550
|
"""
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3551
|
+
.. raw:: html
|
|
3552
|
+
|
|
3553
|
+
<p>Create a datafeed.
|
|
3554
|
+
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
|
|
3555
|
+
You can associate only one datafeed with each anomaly detection job.
|
|
3556
|
+
The datafeed contains a query that runs at a defined interval (<code>frequency</code>).
|
|
3557
|
+
If you are concerned about delayed data, you can add a delay (<code>query_delay') at each interval. By default, the datafeed uses the following query: </code>{"match_all": {"boost": 1}}`.</p>
|
|
3558
|
+
<p>When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
|
|
3559
|
+
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
|
|
3560
|
+
those credentials are used instead.
|
|
3561
|
+
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
|
|
3562
|
+
directly to the <code>.ml-config</code> index. Do not give users <code>write</code> privileges on the <code>.ml-config</code> index.</p>
|
|
3563
|
+
|
|
3564
|
+
|
|
3565
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-put-datafeed.html>`_
|
|
3399
3566
|
|
|
3400
3567
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
3401
3568
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -3550,11 +3717,14 @@ class MlClient(NamespacedClient):
|
|
|
3550
3717
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3551
3718
|
) -> ObjectApiResponse[t.Any]:
|
|
3552
3719
|
"""
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3720
|
+
.. raw:: html
|
|
3721
|
+
|
|
3722
|
+
<p>Create a filter.
|
|
3723
|
+
A filter contains a list of strings. It can be used by one or more anomaly detection jobs.
|
|
3724
|
+
Specifically, filters are referenced in the <code>custom_rules</code> property of detector configuration objects.</p>
|
|
3725
|
+
|
|
3556
3726
|
|
|
3557
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
3727
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-put-filter.html>`_
|
|
3558
3728
|
|
|
3559
3729
|
:param filter_id: A string that uniquely identifies a filter.
|
|
3560
3730
|
:param description: A description of the filter.
|
|
@@ -3649,11 +3819,14 @@ class MlClient(NamespacedClient):
|
|
|
3649
3819
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3650
3820
|
) -> ObjectApiResponse[t.Any]:
|
|
3651
3821
|
"""
|
|
3652
|
-
|
|
3653
|
-
have read index privileges on the source index. If you include a `datafeed_config`
|
|
3654
|
-
but do not provide a query, the datafeed uses `{"match_all": {"boost": 1}}`.
|
|
3822
|
+
.. raw:: html
|
|
3655
3823
|
|
|
3656
|
-
|
|
3824
|
+
<p>Create an anomaly detection job.</p>
|
|
3825
|
+
<p>If you include a <code>datafeed_config</code>, you must have read index privileges on the source index.
|
|
3826
|
+
If you include a <code>datafeed_config</code> but do not provide a query, the datafeed uses <code>{"match_all": {"boost": 1}}</code>.</p>
|
|
3827
|
+
|
|
3828
|
+
|
|
3829
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-put-job.html>`_
|
|
3657
3830
|
|
|
3658
3831
|
:param job_id: The identifier for the anomaly detection job. This identifier
|
|
3659
3832
|
can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and
|
|
@@ -3855,10 +4028,13 @@ class MlClient(NamespacedClient):
|
|
|
3855
4028
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3856
4029
|
) -> ObjectApiResponse[t.Any]:
|
|
3857
4030
|
"""
|
|
3858
|
-
|
|
3859
|
-
|
|
4031
|
+
.. raw:: html
|
|
4032
|
+
|
|
4033
|
+
<p>Create a trained model.
|
|
4034
|
+
Enable you to supply a trained model that is not created by data frame analytics.</p>
|
|
3860
4035
|
|
|
3861
|
-
|
|
4036
|
+
|
|
4037
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-trained-models.html>`_
|
|
3862
4038
|
|
|
3863
4039
|
:param model_id: The unique identifier of the trained model.
|
|
3864
4040
|
:param compressed_definition: The compressed (GZipped and Base64 encoded) inference
|
|
@@ -3958,21 +4134,28 @@ class MlClient(NamespacedClient):
|
|
|
3958
4134
|
reassign: t.Optional[bool] = None,
|
|
3959
4135
|
) -> ObjectApiResponse[t.Any]:
|
|
3960
4136
|
"""
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
4137
|
+
.. raw:: html
|
|
4138
|
+
|
|
4139
|
+
<p>Create or update a trained model alias.
|
|
4140
|
+
A trained model alias is a logical name used to reference a single trained
|
|
4141
|
+
model.
|
|
4142
|
+
You can use aliases instead of trained model identifiers to make it easier to
|
|
4143
|
+
reference your models. For example, you can use aliases in inference
|
|
4144
|
+
aggregations and processors.
|
|
4145
|
+
An alias must be unique and refer to only a single trained model. However,
|
|
4146
|
+
you can have multiple aliases for each trained model.
|
|
4147
|
+
If you use this API to update an alias such that it references a different
|
|
4148
|
+
trained model ID and the model uses a different type of data frame analytics,
|
|
4149
|
+
an error occurs. For example, this situation occurs if you have a trained
|
|
4150
|
+
model for regression analysis and a trained model for classification
|
|
4151
|
+
analysis; you cannot reassign an alias from one type of trained model to
|
|
4152
|
+
another.
|
|
4153
|
+
If you use this API to update an alias and there are very few input fields in
|
|
4154
|
+
common between the old and new trained models for the model alias, the API
|
|
4155
|
+
returns a warning.</p>
|
|
4156
|
+
|
|
4157
|
+
|
|
4158
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-trained-models-aliases.html>`_
|
|
3976
4159
|
|
|
3977
4160
|
:param model_id: The identifier for the trained model that the alias refers to.
|
|
3978
4161
|
:param model_alias: The alias to create or update. This value cannot end in numbers.
|
|
@@ -4028,9 +4211,12 @@ class MlClient(NamespacedClient):
|
|
|
4028
4211
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4029
4212
|
) -> ObjectApiResponse[t.Any]:
|
|
4030
4213
|
"""
|
|
4031
|
-
|
|
4214
|
+
.. raw:: html
|
|
4215
|
+
|
|
4216
|
+
<p>Create part of a trained model definition.</p>
|
|
4032
4217
|
|
|
4033
|
-
|
|
4218
|
+
|
|
4219
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-trained-model-definition-part.html>`_
|
|
4034
4220
|
|
|
4035
4221
|
:param model_id: The unique identifier of the trained model.
|
|
4036
4222
|
:param part: The definition part number. When the definition is loaded for inference
|
|
@@ -4105,11 +4291,14 @@ class MlClient(NamespacedClient):
|
|
|
4105
4291
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4106
4292
|
) -> ObjectApiResponse[t.Any]:
|
|
4107
4293
|
"""
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4294
|
+
.. raw:: html
|
|
4295
|
+
|
|
4296
|
+
<p>Create a trained model vocabulary.
|
|
4297
|
+
This API is supported only for natural language processing (NLP) models.
|
|
4298
|
+
The vocabulary is stored in the index as described in <code>inference_config.*.vocabulary</code> of the trained model definition.</p>
|
|
4299
|
+
|
|
4111
4300
|
|
|
4112
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4301
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-trained-model-vocabulary.html>`_
|
|
4113
4302
|
|
|
4114
4303
|
:param model_id: The unique identifier of the trained model.
|
|
4115
4304
|
:param vocabulary: The model vocabulary, which must not be empty.
|
|
@@ -4163,11 +4352,16 @@ class MlClient(NamespacedClient):
|
|
|
4163
4352
|
wait_for_completion: t.Optional[bool] = None,
|
|
4164
4353
|
) -> ObjectApiResponse[t.Any]:
|
|
4165
4354
|
"""
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4355
|
+
.. raw:: html
|
|
4356
|
+
|
|
4357
|
+
<p>Reset an anomaly detection job.
|
|
4358
|
+
All model state and results are deleted. The job is ready to start over as if
|
|
4359
|
+
it had just been created.
|
|
4360
|
+
It is not currently possible to reset multiple jobs using wildcards or a
|
|
4361
|
+
comma separated list.</p>
|
|
4362
|
+
|
|
4169
4363
|
|
|
4170
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4364
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-reset-job.html>`_
|
|
4171
4365
|
|
|
4172
4366
|
:param job_id: The ID of the job to reset.
|
|
4173
4367
|
:param delete_user_annotations: Specifies whether annotations that have been
|
|
@@ -4219,15 +4413,19 @@ class MlClient(NamespacedClient):
|
|
|
4219
4413
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4220
4414
|
) -> ObjectApiResponse[t.Any]:
|
|
4221
4415
|
"""
|
|
4222
|
-
|
|
4223
|
-
input, learning new behaviors in data. Highly anomalous input increases the variance
|
|
4224
|
-
in the models whilst the system learns whether this is a new step-change in behavior
|
|
4225
|
-
or a one-off event. In the case where this anomalous input is known to be a one-off,
|
|
4226
|
-
then it might be appropriate to reset the model state to a time before this event.
|
|
4227
|
-
For example, you might consider reverting to a saved snapshot after Black Friday
|
|
4228
|
-
or a critical system failure.
|
|
4416
|
+
.. raw:: html
|
|
4229
4417
|
|
|
4230
|
-
|
|
4418
|
+
<p>Revert to a snapshot.
|
|
4419
|
+
The machine learning features react quickly to anomalous input, learning new
|
|
4420
|
+
behaviors in data. Highly anomalous input increases the variance in the
|
|
4421
|
+
models whilst the system learns whether this is a new step-change in behavior
|
|
4422
|
+
or a one-off event. In the case where this anomalous input is known to be a
|
|
4423
|
+
one-off, then it might be appropriate to reset the model state to a time
|
|
4424
|
+
before this event. For example, you might consider reverting to a saved
|
|
4425
|
+
snapshot after Black Friday or a critical system failure.</p>
|
|
4426
|
+
|
|
4427
|
+
|
|
4428
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-revert-snapshot.html>`_
|
|
4231
4429
|
|
|
4232
4430
|
:param job_id: Identifier for the anomaly detection job.
|
|
4233
4431
|
:param snapshot_id: You can specify `empty` as the <snapshot_id>. Reverting to
|
|
@@ -4285,19 +4483,24 @@ class MlClient(NamespacedClient):
|
|
|
4285
4483
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4286
4484
|
) -> ObjectApiResponse[t.Any]:
|
|
4287
4485
|
"""
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4486
|
+
.. raw:: html
|
|
4487
|
+
|
|
4488
|
+
<p>Set upgrade_mode for ML indices.
|
|
4489
|
+
Sets a cluster wide upgrade_mode setting that prepares machine learning
|
|
4490
|
+
indices for an upgrade.
|
|
4491
|
+
When upgrading your cluster, in some circumstances you must restart your
|
|
4492
|
+
nodes and reindex your machine learning indices. In those circumstances,
|
|
4493
|
+
there must be no machine learning jobs running. You can close the machine
|
|
4494
|
+
learning jobs, do the upgrade, then open all the jobs again. Alternatively,
|
|
4495
|
+
you can use this API to temporarily halt tasks associated with the jobs and
|
|
4496
|
+
datafeeds and prevent new jobs from opening. You can also use this API
|
|
4497
|
+
during upgrades that do not require you to reindex your machine learning
|
|
4498
|
+
indices, though stopping jobs is not a requirement in that case.
|
|
4499
|
+
You can see the current value for the upgrade_mode setting by using the get
|
|
4500
|
+
machine learning info API.</p>
|
|
4299
4501
|
|
|
4300
|
-
|
|
4502
|
+
|
|
4503
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-set-upgrade-mode.html>`_
|
|
4301
4504
|
|
|
4302
4505
|
:param enabled: When `true`, it enables `upgrade_mode` which temporarily halts
|
|
4303
4506
|
all job and datafeed tasks and prohibits new job and datafeed tasks from
|
|
@@ -4341,18 +4544,23 @@ class MlClient(NamespacedClient):
|
|
|
4341
4544
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4342
4545
|
) -> ObjectApiResponse[t.Any]:
|
|
4343
4546
|
"""
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4547
|
+
.. raw:: html
|
|
4548
|
+
|
|
4549
|
+
<p>Start a data frame analytics job.
|
|
4550
|
+
A data frame analytics job can be started and stopped multiple times
|
|
4551
|
+
throughout its lifecycle.
|
|
4552
|
+
If the destination index does not exist, it is created automatically the
|
|
4553
|
+
first time you start the data frame analytics job. The
|
|
4554
|
+
<code>index.number_of_shards</code> and <code>index.number_of_replicas</code> settings for the
|
|
4555
|
+
destination index are copied from the source index. If there are multiple
|
|
4556
|
+
source indices, the destination index copies the highest setting values. The
|
|
4557
|
+
mappings for the destination index are also copied from the source indices.
|
|
4558
|
+
If there are any mapping conflicts, the job fails to start.
|
|
4559
|
+
If the destination index exists, it is used as is. You can therefore set up
|
|
4560
|
+
the destination index in advance with custom settings and mappings.</p>
|
|
4354
4561
|
|
|
4355
|
-
|
|
4562
|
+
|
|
4563
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/start-dfanalytics.html>`_
|
|
4356
4564
|
|
|
4357
4565
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
4358
4566
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -4402,19 +4610,20 @@ class MlClient(NamespacedClient):
|
|
|
4402
4610
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4403
4611
|
) -> ObjectApiResponse[t.Any]:
|
|
4404
4612
|
"""
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4613
|
+
.. raw:: html
|
|
4614
|
+
|
|
4615
|
+
<p>Start datafeeds.</p>
|
|
4616
|
+
<p>A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped
|
|
4617
|
+
multiple times throughout its lifecycle.</p>
|
|
4618
|
+
<p>Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs.</p>
|
|
4619
|
+
<p>If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.
|
|
4620
|
+
If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.</p>
|
|
4621
|
+
<p>When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or
|
|
4622
|
+
update it had at the time of creation or update and runs the query using those same roles. If you provided secondary
|
|
4623
|
+
authorization headers when you created or updated the datafeed, those credentials are used instead.</p>
|
|
4624
|
+
|
|
4416
4625
|
|
|
4417
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4626
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-start-datafeed.html>`_
|
|
4418
4627
|
|
|
4419
4628
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
4420
4629
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -4460,11 +4669,14 @@ class MlClient(NamespacedClient):
|
|
|
4460
4669
|
path_parts=__path_parts,
|
|
4461
4670
|
)
|
|
4462
4671
|
|
|
4463
|
-
@_rewrite_parameters(
|
|
4672
|
+
@_rewrite_parameters(
|
|
4673
|
+
body_fields=("adaptive_allocations",),
|
|
4674
|
+
)
|
|
4464
4675
|
async def start_trained_model_deployment(
|
|
4465
4676
|
self,
|
|
4466
4677
|
*,
|
|
4467
4678
|
model_id: str,
|
|
4679
|
+
adaptive_allocations: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4468
4680
|
cache_size: t.Optional[t.Union[int, str]] = None,
|
|
4469
4681
|
deployment_id: t.Optional[str] = None,
|
|
4470
4682
|
error_trace: t.Optional[bool] = None,
|
|
@@ -4479,15 +4691,22 @@ class MlClient(NamespacedClient):
|
|
|
4479
4691
|
wait_for: t.Optional[
|
|
4480
4692
|
t.Union[str, t.Literal["fully_allocated", "started", "starting"]]
|
|
4481
4693
|
] = None,
|
|
4694
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4482
4695
|
) -> ObjectApiResponse[t.Any]:
|
|
4483
4696
|
"""
|
|
4484
|
-
|
|
4485
|
-
|
|
4697
|
+
.. raw:: html
|
|
4698
|
+
|
|
4699
|
+
<p>Start a trained model deployment.
|
|
4700
|
+
It allocates the model to every machine learning node.</p>
|
|
4486
4701
|
|
|
4487
|
-
|
|
4702
|
+
|
|
4703
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/start-trained-model-deployment.html>`_
|
|
4488
4704
|
|
|
4489
4705
|
:param model_id: The unique identifier of the trained model. Currently, only
|
|
4490
4706
|
PyTorch models are supported.
|
|
4707
|
+
:param adaptive_allocations: Adaptive allocations configuration. When enabled,
|
|
4708
|
+
the number of allocations is set based on the current load. If adaptive_allocations
|
|
4709
|
+
is enabled, do not set the number of allocations manually.
|
|
4491
4710
|
:param cache_size: The inference cache size (in memory outside the JVM heap)
|
|
4492
4711
|
per node for the model. The default value is the same size as the `model_size_bytes`.
|
|
4493
4712
|
To disable the cache, `0b` can be provided.
|
|
@@ -4497,7 +4716,8 @@ class MlClient(NamespacedClient):
|
|
|
4497
4716
|
model in memory but use a separate set of threads to evaluate the model.
|
|
4498
4717
|
Increasing this value generally increases the throughput. If this setting
|
|
4499
4718
|
is greater than the number of hardware threads it will automatically be changed
|
|
4500
|
-
to a value less than the number of hardware threads.
|
|
4719
|
+
to a value less than the number of hardware threads. If adaptive_allocations
|
|
4720
|
+
is enabled, do not set this value, because it’s automatically set.
|
|
4501
4721
|
:param priority: The deployment priority.
|
|
4502
4722
|
:param queue_capacity: Specifies the number of inference requests that are allowed
|
|
4503
4723
|
in the queue. After the number of requests exceeds this value, new requests
|
|
@@ -4517,6 +4737,7 @@ class MlClient(NamespacedClient):
|
|
|
4517
4737
|
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
4518
4738
|
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_start'
|
|
4519
4739
|
__query: t.Dict[str, t.Any] = {}
|
|
4740
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4520
4741
|
if cache_size is not None:
|
|
4521
4742
|
__query["cache_size"] = cache_size
|
|
4522
4743
|
if deployment_id is not None:
|
|
@@ -4541,12 +4762,20 @@ class MlClient(NamespacedClient):
|
|
|
4541
4762
|
__query["timeout"] = timeout
|
|
4542
4763
|
if wait_for is not None:
|
|
4543
4764
|
__query["wait_for"] = wait_for
|
|
4765
|
+
if not __body:
|
|
4766
|
+
if adaptive_allocations is not None:
|
|
4767
|
+
__body["adaptive_allocations"] = adaptive_allocations
|
|
4768
|
+
if not __body:
|
|
4769
|
+
__body = None # type: ignore[assignment]
|
|
4544
4770
|
__headers = {"accept": "application/json"}
|
|
4771
|
+
if __body is not None:
|
|
4772
|
+
__headers["content-type"] = "application/json"
|
|
4545
4773
|
return await self.perform_request( # type: ignore[return-value]
|
|
4546
4774
|
"POST",
|
|
4547
4775
|
__path,
|
|
4548
4776
|
params=__query,
|
|
4549
4777
|
headers=__headers,
|
|
4778
|
+
body=__body,
|
|
4550
4779
|
endpoint_id="ml.start_trained_model_deployment",
|
|
4551
4780
|
path_parts=__path_parts,
|
|
4552
4781
|
)
|
|
@@ -4565,10 +4794,14 @@ class MlClient(NamespacedClient):
|
|
|
4565
4794
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4566
4795
|
) -> ObjectApiResponse[t.Any]:
|
|
4567
4796
|
"""
|
|
4568
|
-
|
|
4569
|
-
|
|
4797
|
+
.. raw:: html
|
|
4798
|
+
|
|
4799
|
+
<p>Stop data frame analytics jobs.
|
|
4800
|
+
A data frame analytics job can be started and stopped multiple times
|
|
4801
|
+
throughout its lifecycle.</p>
|
|
4802
|
+
|
|
4570
4803
|
|
|
4571
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4804
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/stop-dfanalytics.html>`_
|
|
4572
4805
|
|
|
4573
4806
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
4574
4807
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -4631,10 +4864,14 @@ class MlClient(NamespacedClient):
|
|
|
4631
4864
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4632
4865
|
) -> ObjectApiResponse[t.Any]:
|
|
4633
4866
|
"""
|
|
4634
|
-
|
|
4635
|
-
|
|
4867
|
+
.. raw:: html
|
|
4868
|
+
|
|
4869
|
+
<p>Stop datafeeds.
|
|
4870
|
+
A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped
|
|
4871
|
+
multiple times throughout its lifecycle.</p>
|
|
4872
|
+
|
|
4636
4873
|
|
|
4637
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
4874
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-stop-datafeed.html>`_
|
|
4638
4875
|
|
|
4639
4876
|
:param datafeed_id: Identifier for the datafeed. You can stop multiple datafeeds
|
|
4640
4877
|
in a single API request by using a comma-separated list of datafeeds or a
|
|
@@ -4694,9 +4931,12 @@ class MlClient(NamespacedClient):
|
|
|
4694
4931
|
pretty: t.Optional[bool] = None,
|
|
4695
4932
|
) -> ObjectApiResponse[t.Any]:
|
|
4696
4933
|
"""
|
|
4697
|
-
|
|
4934
|
+
.. raw:: html
|
|
4698
4935
|
|
|
4699
|
-
|
|
4936
|
+
<p>Stop a trained model deployment.</p>
|
|
4937
|
+
|
|
4938
|
+
|
|
4939
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/stop-trained-model-deployment.html>`_
|
|
4700
4940
|
|
|
4701
4941
|
:param model_id: The unique identifier of the trained model.
|
|
4702
4942
|
:param allow_no_match: Specifies what to do when the request: contains wildcard
|
|
@@ -4759,9 +4999,12 @@ class MlClient(NamespacedClient):
|
|
|
4759
4999
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4760
5000
|
) -> ObjectApiResponse[t.Any]:
|
|
4761
5001
|
"""
|
|
4762
|
-
|
|
5002
|
+
.. raw:: html
|
|
5003
|
+
|
|
5004
|
+
<p>Update a data frame analytics job.</p>
|
|
4763
5005
|
|
|
4764
|
-
|
|
5006
|
+
|
|
5007
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/update-dfanalytics.html>`_
|
|
4765
5008
|
|
|
4766
5009
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
4767
5010
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -4867,13 +5110,16 @@ class MlClient(NamespacedClient):
|
|
|
4867
5110
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4868
5111
|
) -> ObjectApiResponse[t.Any]:
|
|
4869
5112
|
"""
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
5113
|
+
.. raw:: html
|
|
5114
|
+
|
|
5115
|
+
<p>Update a datafeed.
|
|
5116
|
+
You must stop and start the datafeed for the changes to be applied.
|
|
5117
|
+
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
|
|
5118
|
+
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
|
|
5119
|
+
those credentials are used instead.</p>
|
|
4875
5120
|
|
|
4876
|
-
|
|
5121
|
+
|
|
5122
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-update-datafeed.html>`_
|
|
4877
5123
|
|
|
4878
5124
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
4879
5125
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -5034,10 +5280,13 @@ class MlClient(NamespacedClient):
|
|
|
5034
5280
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5035
5281
|
) -> ObjectApiResponse[t.Any]:
|
|
5036
5282
|
"""
|
|
5037
|
-
|
|
5038
|
-
|
|
5283
|
+
.. raw:: html
|
|
5284
|
+
|
|
5285
|
+
<p>Update a filter.
|
|
5286
|
+
Updates the description of a filter, adds items, or removes items from the list.</p>
|
|
5287
|
+
|
|
5039
5288
|
|
|
5040
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5289
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-update-filter.html>`_
|
|
5041
5290
|
|
|
5042
5291
|
:param filter_id: A string that uniquely identifies a filter.
|
|
5043
5292
|
:param add_items: The items to add to the filter.
|
|
@@ -5125,10 +5374,13 @@ class MlClient(NamespacedClient):
|
|
|
5125
5374
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5126
5375
|
) -> ObjectApiResponse[t.Any]:
|
|
5127
5376
|
"""
|
|
5128
|
-
|
|
5129
|
-
|
|
5377
|
+
.. raw:: html
|
|
5378
|
+
|
|
5379
|
+
<p>Update an anomaly detection job.
|
|
5380
|
+
Updates certain properties of an anomaly detection job.</p>
|
|
5381
|
+
|
|
5130
5382
|
|
|
5131
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
5383
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-update-job.html>`_
|
|
5132
5384
|
|
|
5133
5385
|
:param job_id: Identifier for the job.
|
|
5134
5386
|
:param allow_lazy_open: Advanced configuration option. Specifies whether this
|
|
@@ -5254,9 +5506,13 @@ class MlClient(NamespacedClient):
|
|
|
5254
5506
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5255
5507
|
) -> ObjectApiResponse[t.Any]:
|
|
5256
5508
|
"""
|
|
5257
|
-
|
|
5509
|
+
.. raw:: html
|
|
5258
5510
|
|
|
5259
|
-
|
|
5511
|
+
<p>Update a snapshot.
|
|
5512
|
+
Updates certain properties of a snapshot.</p>
|
|
5513
|
+
|
|
5514
|
+
|
|
5515
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-update-snapshot.html>`_
|
|
5260
5516
|
|
|
5261
5517
|
:param job_id: Identifier for the anomaly detection job.
|
|
5262
5518
|
:param snapshot_id: Identifier for the model snapshot.
|
|
@@ -5301,12 +5557,13 @@ class MlClient(NamespacedClient):
|
|
|
5301
5557
|
)
|
|
5302
5558
|
|
|
5303
5559
|
@_rewrite_parameters(
|
|
5304
|
-
body_fields=("number_of_allocations"
|
|
5560
|
+
body_fields=("adaptive_allocations", "number_of_allocations"),
|
|
5305
5561
|
)
|
|
5306
5562
|
async def update_trained_model_deployment(
|
|
5307
5563
|
self,
|
|
5308
5564
|
*,
|
|
5309
5565
|
model_id: str,
|
|
5566
|
+
adaptive_allocations: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
5310
5567
|
error_trace: t.Optional[bool] = None,
|
|
5311
5568
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
5312
5569
|
human: t.Optional[bool] = None,
|
|
@@ -5315,18 +5572,25 @@ class MlClient(NamespacedClient):
|
|
|
5315
5572
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5316
5573
|
) -> ObjectApiResponse[t.Any]:
|
|
5317
5574
|
"""
|
|
5318
|
-
|
|
5575
|
+
.. raw:: html
|
|
5576
|
+
|
|
5577
|
+
<p>Update a trained model deployment.</p>
|
|
5319
5578
|
|
|
5320
|
-
|
|
5579
|
+
|
|
5580
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/update-trained-model-deployment.html>`_
|
|
5321
5581
|
|
|
5322
5582
|
:param model_id: The unique identifier of the trained model. Currently, only
|
|
5323
5583
|
PyTorch models are supported.
|
|
5584
|
+
:param adaptive_allocations: Adaptive allocations configuration. When enabled,
|
|
5585
|
+
the number of allocations is set based on the current load. If adaptive_allocations
|
|
5586
|
+
is enabled, do not set the number of allocations manually.
|
|
5324
5587
|
:param number_of_allocations: The number of model allocations on each node where
|
|
5325
5588
|
the model is deployed. All allocations on a node share the same copy of the
|
|
5326
5589
|
model in memory but use a separate set of threads to evaluate the model.
|
|
5327
5590
|
Increasing this value generally increases the throughput. If this setting
|
|
5328
5591
|
is greater than the number of hardware threads it will automatically be changed
|
|
5329
|
-
to a value less than the number of hardware threads.
|
|
5592
|
+
to a value less than the number of hardware threads. If adaptive_allocations
|
|
5593
|
+
is enabled, do not set this value, because it’s automatically set.
|
|
5330
5594
|
"""
|
|
5331
5595
|
if model_id in SKIP_IN_PATH:
|
|
5332
5596
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
@@ -5343,6 +5607,8 @@ class MlClient(NamespacedClient):
|
|
|
5343
5607
|
if pretty is not None:
|
|
5344
5608
|
__query["pretty"] = pretty
|
|
5345
5609
|
if not __body:
|
|
5610
|
+
if adaptive_allocations is not None:
|
|
5611
|
+
__body["adaptive_allocations"] = adaptive_allocations
|
|
5346
5612
|
if number_of_allocations is not None:
|
|
5347
5613
|
__body["number_of_allocations"] = number_of_allocations
|
|
5348
5614
|
if not __body:
|
|
@@ -5374,16 +5640,21 @@ class MlClient(NamespacedClient):
|
|
|
5374
5640
|
wait_for_completion: t.Optional[bool] = None,
|
|
5375
5641
|
) -> ObjectApiResponse[t.Any]:
|
|
5376
5642
|
"""
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5643
|
+
.. raw:: html
|
|
5644
|
+
|
|
5645
|
+
<p>Upgrade a snapshot.
|
|
5646
|
+
Upgrade an anomaly detection model snapshot to the latest major version.
|
|
5647
|
+
Over time, older snapshot formats are deprecated and removed. Anomaly
|
|
5648
|
+
detection jobs support only snapshots that are from the current or previous
|
|
5649
|
+
major version.
|
|
5650
|
+
This API provides a means to upgrade a snapshot to the current major version.
|
|
5651
|
+
This aids in preparing the cluster for an upgrade to the next major version.
|
|
5652
|
+
Only one snapshot per anomaly detection job can be upgraded at a time and the
|
|
5653
|
+
upgraded snapshot cannot be the current snapshot of the anomaly detection
|
|
5654
|
+
job.</p>
|
|
5385
5655
|
|
|
5386
|
-
|
|
5656
|
+
|
|
5657
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ml-upgrade-job-model-snapshot.html>`_
|
|
5387
5658
|
|
|
5388
5659
|
:param job_id: Identifier for the anomaly detection job.
|
|
5389
5660
|
:param snapshot_id: A numerical character string that uniquely identifies the
|
|
@@ -5457,9 +5728,12 @@ class MlClient(NamespacedClient):
|
|
|
5457
5728
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5458
5729
|
) -> ObjectApiResponse[t.Any]:
|
|
5459
5730
|
"""
|
|
5460
|
-
|
|
5731
|
+
.. raw:: html
|
|
5732
|
+
|
|
5733
|
+
<p>Validate an anomaly detection job.</p>
|
|
5734
|
+
|
|
5461
5735
|
|
|
5462
|
-
`<https://www.elastic.co/guide/en/machine-learning/8.
|
|
5736
|
+
`<https://www.elastic.co/guide/en/machine-learning/8.18/ml-jobs.html>`_
|
|
5463
5737
|
|
|
5464
5738
|
:param analysis_config:
|
|
5465
5739
|
:param analysis_limits:
|
|
@@ -5527,9 +5801,12 @@ class MlClient(NamespacedClient):
|
|
|
5527
5801
|
pretty: t.Optional[bool] = None,
|
|
5528
5802
|
) -> ObjectApiResponse[t.Any]:
|
|
5529
5803
|
"""
|
|
5530
|
-
|
|
5804
|
+
.. raw:: html
|
|
5805
|
+
|
|
5806
|
+
<p>Validate an anomaly detection job.</p>
|
|
5807
|
+
|
|
5531
5808
|
|
|
5532
|
-
`<https://www.elastic.co/
|
|
5809
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v8>`_
|
|
5533
5810
|
|
|
5534
5811
|
:param detector:
|
|
5535
5812
|
"""
|