elasticsearch 8.17.1__py3-none-any.whl → 9.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2125 -1053
- elasticsearch/_async/client/_base.py +1 -2
- elasticsearch/_async/client/async_search.py +46 -35
- elasticsearch/_async/client/autoscaling.py +32 -26
- elasticsearch/_async/client/cat.py +244 -176
- elasticsearch/_async/client/ccr.py +268 -128
- elasticsearch/_async/client/cluster.py +191 -164
- elasticsearch/_async/client/connector.py +226 -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 +351 -7
- elasticsearch/_async/client/features.py +37 -27
- elasticsearch/_async/client/fleet.py +32 -22
- elasticsearch/_async/client/graph.py +10 -9
- elasticsearch/_async/client/ilm.py +115 -77
- elasticsearch/_async/client/indices.py +1119 -772
- elasticsearch/_async/client/inference.py +1933 -84
- 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 +646 -374
- elasticsearch/_async/client/monitoring.py +6 -3
- elasticsearch/_async/client/nodes.py +52 -54
- 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 +903 -562
- 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 +454 -327
- 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 +117 -73
- elasticsearch/_async/client/xpack.py +18 -9
- elasticsearch/_async/helpers.py +1 -2
- elasticsearch/_sync/client/__init__.py +2125 -1053
- elasticsearch/_sync/client/_base.py +1 -2
- elasticsearch/_sync/client/async_search.py +46 -35
- elasticsearch/_sync/client/autoscaling.py +32 -26
- elasticsearch/_sync/client/cat.py +244 -176
- elasticsearch/_sync/client/ccr.py +268 -128
- elasticsearch/_sync/client/cluster.py +191 -164
- elasticsearch/_sync/client/connector.py +226 -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 +351 -7
- elasticsearch/_sync/client/features.py +37 -27
- elasticsearch/_sync/client/fleet.py +32 -22
- elasticsearch/_sync/client/graph.py +10 -9
- elasticsearch/_sync/client/ilm.py +115 -77
- elasticsearch/_sync/client/indices.py +1119 -772
- elasticsearch/_sync/client/inference.py +1933 -84
- 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 +646 -374
- elasticsearch/_sync/client/monitoring.py +6 -3
- elasticsearch/_sync/client/nodes.py +52 -54
- 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 +903 -562
- 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 +454 -327
- 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 -41
- elasticsearch/_sync/client/watcher.py +117 -73
- 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 +237 -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 +230 -0
- elasticsearch/dsl/_sync/update_by_query.py +45 -0
- elasticsearch/dsl/aggs.py +3734 -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 +4392 -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 +2822 -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 +1053 -0
- elasticsearch/dsl/serializer.py +34 -0
- elasticsearch/dsl/types.py +6453 -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 +144 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_async/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/strategies.py +12 -12
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/METADATA +12 -15
- elasticsearch-9.0.0.dist-info/RECORD +160 -0
- elasticsearch/transport.py +0 -57
- elasticsearch-8.17.1.dist-info/RECORD +0 -119
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.1.dist-info → elasticsearch-9.0.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/docs/api/doc/elasticsearch/v9/operation/operation-ml-clear-trained-model-deployment-cache>`_
|
|
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/docs/api/doc/elasticsearch/v9/operation/operation-ml-close-job>`_
|
|
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
|
-
|
|
162
|
+
.. raw:: html
|
|
163
|
+
|
|
164
|
+
<p>Delete a calendar.</p>
|
|
165
|
+
<p>Remove all scheduled events from a calendar, then delete it.</p>
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
|
|
168
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-calendar>`_
|
|
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>
|
|
210
|
+
|
|
207
211
|
|
|
208
|
-
`<https://www.elastic.co/
|
|
212
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-calendar-event>`_
|
|
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>
|
|
261
|
+
|
|
255
262
|
|
|
256
|
-
`<https://www.elastic.co/
|
|
263
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-calendar-job>`_
|
|
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
|
|
304
311
|
|
|
305
|
-
|
|
312
|
+
<p>Delete a data frame analytics job.</p>
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-data-frame-analytics>`_
|
|
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>
|
|
352
364
|
|
|
353
|
-
|
|
365
|
+
|
|
366
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-datafeed>`_
|
|
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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
416
|
+
.. raw:: html
|
|
417
|
+
|
|
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>
|
|
410
427
|
|
|
411
|
-
|
|
428
|
+
|
|
429
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-expired-data>`_
|
|
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>
|
|
491
|
+
|
|
471
492
|
|
|
472
|
-
`<https://www.elastic.co/
|
|
493
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-filter>`_
|
|
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>
|
|
541
|
+
|
|
517
542
|
|
|
518
|
-
`<https://www.elastic.co/
|
|
543
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-forecast>`_
|
|
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
|
-
are deleted. It is not currently possible to delete multiple jobs using wildcards
|
|
585
|
-
or a comma separated list. If you delete a job that has a datafeed, the request
|
|
586
|
-
first tries to delete the datafeed. This behavior is equivalent to calling the
|
|
587
|
-
delete datafeed API with the same timeout and force parameters as the delete
|
|
588
|
-
job request.
|
|
608
|
+
.. raw:: html
|
|
589
609
|
|
|
590
|
-
|
|
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
|
+
|
|
618
|
+
|
|
619
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-job>`_
|
|
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>
|
|
645
677
|
|
|
646
|
-
|
|
678
|
+
|
|
679
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-model-snapshot>`_
|
|
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
|
-
model that is not referenced by an ingest pipeline.
|
|
725
|
+
.. raw:: html
|
|
693
726
|
|
|
694
|
-
|
|
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
|
+
|
|
730
|
+
|
|
731
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-trained-model>`_
|
|
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>
|
|
784
|
+
|
|
740
785
|
|
|
741
|
-
`<https://www.elastic.co/
|
|
786
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-delete-trained-model-alias>`_
|
|
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>
|
|
845
|
+
|
|
797
846
|
|
|
798
|
-
`<https://www.elastic.co/
|
|
847
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-estimate-model-memory>`_
|
|
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
|
-
metrics for various types of machine learning features. This has been designed
|
|
863
|
-
for use on indexes created by data frame analytics. Evaluation requires both
|
|
864
|
-
a ground truth field and an analytics result field to be present.
|
|
910
|
+
.. raw:: html
|
|
865
911
|
|
|
866
|
-
|
|
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
|
+
|
|
918
|
+
|
|
919
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-evaluate-data-frame>`_
|
|
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>
|
|
945
1002
|
|
|
946
|
-
|
|
1003
|
+
|
|
1004
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-explain-data-frame-analytics>`_
|
|
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
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1102
|
+
.. raw:: html
|
|
1103
|
+
|
|
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>
|
|
1052
1113
|
|
|
1053
|
-
|
|
1114
|
+
|
|
1115
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-flush-job>`_
|
|
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>
|
|
1188
|
+
|
|
1123
1189
|
|
|
1124
|
-
`<https://www.elastic.co/
|
|
1190
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-forecast>`_
|
|
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
|
-
view of the records, grouped by bucket.
|
|
1270
|
+
.. raw:: html
|
|
1206
1271
|
|
|
1207
|
-
|
|
1272
|
+
<p>Get anomaly detection job results for buckets.
|
|
1273
|
+
The API presents a chronological view of the records, grouped by bucket.</p>
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-buckets>`_
|
|
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>
|
|
1301
1372
|
|
|
1302
|
-
|
|
1373
|
+
|
|
1374
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-calendar-events>`_
|
|
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/
|
|
1443
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-calendars>`_
|
|
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
|
|
1515
|
+
|
|
1516
|
+
<p>Get anomaly detection job results for categories.</p>
|
|
1517
|
+
|
|
1440
1518
|
|
|
1441
|
-
`<https://www.elastic.co/
|
|
1519
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-categories>`_
|
|
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
|
-
multiple data frame analytics jobs in a single API request by using a comma-separated
|
|
1523
|
-
list of data frame analytics jobs or a wildcard expression.
|
|
1599
|
+
.. raw:: html
|
|
1524
1600
|
|
|
1525
|
-
|
|
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>
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-data-frame-analytics>`_
|
|
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/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-data-frame-analytics-stats>`_
|
|
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>
|
|
1666
1754
|
|
|
1667
|
-
|
|
1755
|
+
|
|
1756
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-datafeed-stats>`_
|
|
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/
|
|
1820
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-datafeeds>`_
|
|
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
|
|
1882
|
+
|
|
1883
|
+
<p>Get filters.
|
|
1884
|
+
You can get a single filter or all filters.</p>
|
|
1885
|
+
|
|
1789
1886
|
|
|
1790
|
-
`<https://www.elastic.co/
|
|
1887
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-filters>`_
|
|
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
|
-
that have contributed to, or are to blame for, the anomalies. Influencer results
|
|
1852
|
-
are available only if an `influencer_field_name` is specified in the job configuration.
|
|
1947
|
+
.. raw:: html
|
|
1853
1948
|
|
|
1854
|
-
|
|
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>
|
|
1953
|
+
|
|
1954
|
+
|
|
1955
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-influencers>`_
|
|
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/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-job-stats>`_
|
|
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>
|
|
1995
2101
|
|
|
1996
|
-
|
|
2102
|
+
|
|
2103
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-jobs>`_
|
|
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/
|
|
2169
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-memory-stats>`_
|
|
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
|
|
2223
|
+
|
|
2224
|
+
<p>Get anomaly detection job model snapshot upgrade usage info.</p>
|
|
2225
|
+
|
|
2113
2226
|
|
|
2114
|
-
`<https://www.elastic.co/
|
|
2227
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-model-snapshot-upgrade-stats>`_
|
|
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
|
|
2184
2297
|
|
|
2185
|
-
|
|
2298
|
+
<p>Get model snapshots info.</p>
|
|
2299
|
+
|
|
2300
|
+
|
|
2301
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-model-snapshots>`_
|
|
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/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-overall-buckets>`_
|
|
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/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-records>`_
|
|
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.
|
|
@@ -2488,15 +2616,17 @@ class MlClient(NamespacedClient):
|
|
|
2488
2616
|
],
|
|
2489
2617
|
]
|
|
2490
2618
|
] = None,
|
|
2491
|
-
include_model_definition: t.Optional[bool] = None,
|
|
2492
2619
|
pretty: t.Optional[bool] = None,
|
|
2493
2620
|
size: t.Optional[int] = None,
|
|
2494
2621
|
tags: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
2495
2622
|
) -> ObjectApiResponse[t.Any]:
|
|
2496
2623
|
"""
|
|
2497
|
-
|
|
2624
|
+
.. raw:: html
|
|
2625
|
+
|
|
2626
|
+
<p>Get trained model configuration info.</p>
|
|
2498
2627
|
|
|
2499
|
-
|
|
2628
|
+
|
|
2629
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-trained-models>`_
|
|
2500
2630
|
|
|
2501
2631
|
:param model_id: The unique identifier of the trained model or a model alias.
|
|
2502
2632
|
You can get information for multiple trained models in a single API request
|
|
@@ -2515,8 +2645,6 @@ class MlClient(NamespacedClient):
|
|
|
2515
2645
|
:param from_: Skips the specified number of models.
|
|
2516
2646
|
:param include: A comma delimited string of optional fields to include in the
|
|
2517
2647
|
response body.
|
|
2518
|
-
:param include_model_definition: parameter is deprecated! Use [include=definition]
|
|
2519
|
-
instead
|
|
2520
2648
|
:param size: Specifies the maximum number of models to obtain.
|
|
2521
2649
|
:param tags: A comma delimited string of tags. A trained model can have many
|
|
2522
2650
|
tags, or none. When supplied, only trained models that contain all the supplied
|
|
@@ -2546,8 +2674,6 @@ class MlClient(NamespacedClient):
|
|
|
2546
2674
|
__query["human"] = human
|
|
2547
2675
|
if include is not None:
|
|
2548
2676
|
__query["include"] = include
|
|
2549
|
-
if include_model_definition is not None:
|
|
2550
|
-
__query["include_model_definition"] = include_model_definition
|
|
2551
2677
|
if pretty is not None:
|
|
2552
2678
|
__query["pretty"] = pretty
|
|
2553
2679
|
if size is not None:
|
|
@@ -2580,11 +2706,14 @@ class MlClient(NamespacedClient):
|
|
|
2580
2706
|
size: t.Optional[int] = None,
|
|
2581
2707
|
) -> ObjectApiResponse[t.Any]:
|
|
2582
2708
|
"""
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2709
|
+
.. raw:: html
|
|
2710
|
+
|
|
2711
|
+
<p>Get trained models usage info.
|
|
2712
|
+
You can get usage information for multiple trained
|
|
2713
|
+
models in a single API request by using a comma-separated list of model IDs or a wildcard expression.</p>
|
|
2714
|
+
|
|
2586
2715
|
|
|
2587
|
-
`<https://www.elastic.co/
|
|
2716
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-get-trained-models-stats>`_
|
|
2588
2717
|
|
|
2589
2718
|
:param model_id: The unique identifier of the trained model or a model alias.
|
|
2590
2719
|
It can be a comma-separated list or a wildcard expression.
|
|
@@ -2645,9 +2774,12 @@ class MlClient(NamespacedClient):
|
|
|
2645
2774
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2646
2775
|
) -> ObjectApiResponse[t.Any]:
|
|
2647
2776
|
"""
|
|
2648
|
-
|
|
2777
|
+
.. raw:: html
|
|
2778
|
+
|
|
2779
|
+
<p>Evaluate a trained model.</p>
|
|
2780
|
+
|
|
2649
2781
|
|
|
2650
|
-
`<https://www.elastic.co/
|
|
2782
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-infer-trained-model>`_
|
|
2651
2783
|
|
|
2652
2784
|
:param model_id: The unique identifier of the trained model.
|
|
2653
2785
|
:param docs: An array of objects to pass to the model for inference. The objects
|
|
@@ -2702,14 +2834,19 @@ class MlClient(NamespacedClient):
|
|
|
2702
2834
|
pretty: t.Optional[bool] = None,
|
|
2703
2835
|
) -> ObjectApiResponse[t.Any]:
|
|
2704
2836
|
"""
|
|
2705
|
-
|
|
2706
|
-
This endpoint is designed to be used by a user interface that needs to fully
|
|
2707
|
-
understand machine learning configurations where some options are not specified,
|
|
2708
|
-
meaning that the defaults should be used. This endpoint may be used to find out
|
|
2709
|
-
what those defaults are. It also provides information about the maximum size
|
|
2710
|
-
of machine learning jobs that could run in the current cluster configuration.
|
|
2837
|
+
.. raw:: html
|
|
2711
2838
|
|
|
2712
|
-
|
|
2839
|
+
<p>Get machine learning information.
|
|
2840
|
+
Get defaults and limits used by machine learning.
|
|
2841
|
+
This endpoint is designed to be used by a user interface that needs to fully
|
|
2842
|
+
understand machine learning configurations where some options are not
|
|
2843
|
+
specified, meaning that the defaults should be used. This endpoint may be
|
|
2844
|
+
used to find out what those defaults are. It also provides information about
|
|
2845
|
+
the maximum size of machine learning jobs that could run in the current
|
|
2846
|
+
cluster configuration.</p>
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-info>`_
|
|
2713
2850
|
"""
|
|
2714
2851
|
__path_parts: t.Dict[str, str] = {}
|
|
2715
2852
|
__path = "/_ml/info"
|
|
@@ -2747,14 +2884,18 @@ class MlClient(NamespacedClient):
|
|
|
2747
2884
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2748
2885
|
) -> ObjectApiResponse[t.Any]:
|
|
2749
2886
|
"""
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2887
|
+
.. raw:: html
|
|
2888
|
+
|
|
2889
|
+
<p>Open anomaly detection jobs.</p>
|
|
2890
|
+
<p>An anomaly detection job must be opened to be ready to receive and analyze
|
|
2891
|
+
data. It can be opened and closed multiple times throughout its lifecycle.
|
|
2892
|
+
When you open a new job, it starts with an empty model.
|
|
2893
|
+
When you open an existing job, the most recent model state is automatically
|
|
2894
|
+
loaded. The job is ready to resume its analysis from where it left off, once
|
|
2895
|
+
new data is received.</p>
|
|
2756
2896
|
|
|
2757
|
-
|
|
2897
|
+
|
|
2898
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-open-job>`_
|
|
2758
2899
|
|
|
2759
2900
|
:param job_id: Identifier for the anomaly detection job.
|
|
2760
2901
|
:param timeout: Refer to the description for the `timeout` query parameter.
|
|
@@ -2806,9 +2947,12 @@ class MlClient(NamespacedClient):
|
|
|
2806
2947
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2807
2948
|
) -> ObjectApiResponse[t.Any]:
|
|
2808
2949
|
"""
|
|
2809
|
-
|
|
2950
|
+
.. raw:: html
|
|
2951
|
+
|
|
2952
|
+
<p>Add scheduled events to the calendar.</p>
|
|
2953
|
+
|
|
2810
2954
|
|
|
2811
|
-
`<https://www.elastic.co/
|
|
2955
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-post-calendar-events>`_
|
|
2812
2956
|
|
|
2813
2957
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
2814
2958
|
:param events: A list of one of more scheduled events. The event’s start and
|
|
@@ -2862,11 +3006,14 @@ class MlClient(NamespacedClient):
|
|
|
2862
3006
|
reset_start: t.Optional[t.Union[str, t.Any]] = None,
|
|
2863
3007
|
) -> ObjectApiResponse[t.Any]:
|
|
2864
3008
|
"""
|
|
2865
|
-
|
|
2866
|
-
data can be accepted from only a single connection at a time. It is not currently
|
|
2867
|
-
possible to post data to multiple jobs using wildcards or a comma-separated list.
|
|
3009
|
+
.. raw:: html
|
|
2868
3010
|
|
|
2869
|
-
|
|
3011
|
+
<p>Send data to an anomaly detection job for analysis.</p>
|
|
3012
|
+
<p>IMPORTANT: For each job, data can be accepted from only a single connection at a time.
|
|
3013
|
+
It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.</p>
|
|
3014
|
+
|
|
3015
|
+
|
|
3016
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-post-data>`_
|
|
2870
3017
|
|
|
2871
3018
|
:param job_id: Identifier for the anomaly detection job. The job must have a
|
|
2872
3019
|
state of open to receive and process the data.
|
|
@@ -2927,10 +3074,13 @@ class MlClient(NamespacedClient):
|
|
|
2927
3074
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2928
3075
|
) -> ObjectApiResponse[t.Any]:
|
|
2929
3076
|
"""
|
|
2930
|
-
|
|
2931
|
-
|
|
3077
|
+
.. raw:: html
|
|
3078
|
+
|
|
3079
|
+
<p>Preview features used by data frame analytics.
|
|
3080
|
+
Preview the extracted features used by a data frame analytics config.</p>
|
|
2932
3081
|
|
|
2933
|
-
|
|
3082
|
+
|
|
3083
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-preview-data-frame-analytics>`_
|
|
2934
3084
|
|
|
2935
3085
|
:param id: Identifier for the data frame analytics job.
|
|
2936
3086
|
:param config: A data frame analytics config as described in create data frame
|
|
@@ -2990,17 +3140,20 @@ class MlClient(NamespacedClient):
|
|
|
2990
3140
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2991
3141
|
) -> ObjectApiResponse[t.Any]:
|
|
2992
3142
|
"""
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3143
|
+
.. raw:: html
|
|
3144
|
+
|
|
3145
|
+
<p>Preview a datafeed.
|
|
3146
|
+
This API returns the first "page" of search results from a datafeed.
|
|
3147
|
+
You can preview an existing datafeed or provide configuration details for a datafeed
|
|
3148
|
+
and anomaly detection job in the API. The preview shows the structure of the data
|
|
3149
|
+
that will be passed to the anomaly detection engine.
|
|
3150
|
+
IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that
|
|
3151
|
+
called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the
|
|
3152
|
+
datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials.
|
|
3153
|
+
You can also use secondary authorization headers to supply the credentials.</p>
|
|
3002
3154
|
|
|
3003
|
-
|
|
3155
|
+
|
|
3156
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-preview-datafeed>`_
|
|
3004
3157
|
|
|
3005
3158
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
3006
3159
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -3074,9 +3227,12 @@ class MlClient(NamespacedClient):
|
|
|
3074
3227
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3075
3228
|
) -> ObjectApiResponse[t.Any]:
|
|
3076
3229
|
"""
|
|
3077
|
-
|
|
3230
|
+
.. raw:: html
|
|
3231
|
+
|
|
3232
|
+
<p>Create a calendar.</p>
|
|
3233
|
+
|
|
3078
3234
|
|
|
3079
|
-
`<https://www.elastic.co/
|
|
3235
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-calendar>`_
|
|
3080
3236
|
|
|
3081
3237
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
3082
3238
|
:param description: A description of the calendar.
|
|
@@ -3128,9 +3284,12 @@ class MlClient(NamespacedClient):
|
|
|
3128
3284
|
pretty: t.Optional[bool] = None,
|
|
3129
3285
|
) -> ObjectApiResponse[t.Any]:
|
|
3130
3286
|
"""
|
|
3131
|
-
|
|
3287
|
+
.. raw:: html
|
|
3288
|
+
|
|
3289
|
+
<p>Add anomaly detection job to calendar.</p>
|
|
3290
|
+
|
|
3132
3291
|
|
|
3133
|
-
`<https://www.elastic.co/
|
|
3292
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-calendar-job>`_
|
|
3134
3293
|
|
|
3135
3294
|
:param calendar_id: A string that uniquely identifies a calendar.
|
|
3136
3295
|
:param job_id: An identifier for the anomaly detection jobs. It can be a job
|
|
@@ -3203,15 +3362,17 @@ class MlClient(NamespacedClient):
|
|
|
3203
3362
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3204
3363
|
) -> ObjectApiResponse[t.Any]:
|
|
3205
3364
|
"""
|
|
3206
|
-
|
|
3207
|
-
that performs an analysis on the source indices and stores the outcome in a destination
|
|
3208
|
-
index. By default, the query used in the source configuration is `{"match_all":
|
|
3209
|
-
{}}`. If the destination index does not exist, it is created automatically when
|
|
3210
|
-
you start the job. If you supply only a subset of the regression or classification
|
|
3211
|
-
parameters, hyperparameter optimization occurs. It determines a value for each
|
|
3212
|
-
of the undefined parameters.
|
|
3365
|
+
.. raw:: html
|
|
3213
3366
|
|
|
3214
|
-
|
|
3367
|
+
<p>Create a data frame analytics job.
|
|
3368
|
+
This API creates a data frame analytics job that performs an analysis on the
|
|
3369
|
+
source indices and stores the outcome in a destination index.
|
|
3370
|
+
By default, the query used in the source configuration is <code>{"match_all": {}}</code>.</p>
|
|
3371
|
+
<p>If the destination index does not exist, it is created automatically when you start the job.</p>
|
|
3372
|
+
<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>
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-data-frame-analytics>`_
|
|
3215
3376
|
|
|
3216
3377
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
3217
3378
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -3382,20 +3543,21 @@ class MlClient(NamespacedClient):
|
|
|
3382
3543
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3383
3544
|
) -> ObjectApiResponse[t.Any]:
|
|
3384
3545
|
"""
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3546
|
+
.. raw:: html
|
|
3547
|
+
|
|
3548
|
+
<p>Create a datafeed.
|
|
3549
|
+
Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
|
|
3550
|
+
You can associate only one datafeed with each anomaly detection job.
|
|
3551
|
+
The datafeed contains a query that runs at a defined interval (<code>frequency</code>).
|
|
3552
|
+
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>
|
|
3553
|
+
<p>When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
|
|
3554
|
+
at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
|
|
3555
|
+
those credentials are used instead.
|
|
3556
|
+
You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed
|
|
3557
|
+
directly to the <code>.ml-config</code> index. Do not give users <code>write</code> privileges on the <code>.ml-config</code> index.</p>
|
|
3558
|
+
|
|
3559
|
+
|
|
3560
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-datafeed>`_
|
|
3399
3561
|
|
|
3400
3562
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
3401
3563
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -3437,11 +3599,11 @@ class MlClient(NamespacedClient):
|
|
|
3437
3599
|
:param ignore_unavailable: If true, unavailable indices (missing or closed) are
|
|
3438
3600
|
ignored.
|
|
3439
3601
|
:param indexes: An array of index names. Wildcards are supported. If any of the
|
|
3440
|
-
indices are in remote clusters, the
|
|
3441
|
-
`remote_cluster_client` role.
|
|
3602
|
+
indices are in remote clusters, the master nodes and the machine learning
|
|
3603
|
+
nodes must have the `remote_cluster_client` role.
|
|
3442
3604
|
:param indices: An array of index names. Wildcards are supported. If any of the
|
|
3443
|
-
indices are in remote clusters, the
|
|
3444
|
-
`remote_cluster_client` role.
|
|
3605
|
+
indices are in remote clusters, the master nodes and the machine learning
|
|
3606
|
+
nodes must have the `remote_cluster_client` role.
|
|
3445
3607
|
:param indices_options: Specifies index expansion options that are used during
|
|
3446
3608
|
search
|
|
3447
3609
|
:param job_id: Identifier for the anomaly detection job.
|
|
@@ -3550,11 +3712,14 @@ class MlClient(NamespacedClient):
|
|
|
3550
3712
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3551
3713
|
) -> ObjectApiResponse[t.Any]:
|
|
3552
3714
|
"""
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3715
|
+
.. raw:: html
|
|
3716
|
+
|
|
3717
|
+
<p>Create a filter.
|
|
3718
|
+
A filter contains a list of strings. It can be used by one or more anomaly detection jobs.
|
|
3719
|
+
Specifically, filters are referenced in the <code>custom_rules</code> property of detector configuration objects.</p>
|
|
3556
3720
|
|
|
3557
|
-
|
|
3721
|
+
|
|
3722
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-filter>`_
|
|
3558
3723
|
|
|
3559
3724
|
:param filter_id: A string that uniquely identifies a filter.
|
|
3560
3725
|
:param description: A description of the filter.
|
|
@@ -3649,11 +3814,14 @@ class MlClient(NamespacedClient):
|
|
|
3649
3814
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3650
3815
|
) -> ObjectApiResponse[t.Any]:
|
|
3651
3816
|
"""
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3817
|
+
.. raw:: html
|
|
3818
|
+
|
|
3819
|
+
<p>Create an anomaly detection job.</p>
|
|
3820
|
+
<p>If you include a <code>datafeed_config</code>, you must have read index privileges on the source index.
|
|
3821
|
+
If you include a <code>datafeed_config</code> but do not provide a query, the datafeed uses <code>{"match_all": {"boost": 1}}</code>.</p>
|
|
3822
|
+
|
|
3655
3823
|
|
|
3656
|
-
`<https://www.elastic.co/
|
|
3824
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-job>`_
|
|
3657
3825
|
|
|
3658
3826
|
:param job_id: The identifier for the anomaly detection job. This identifier
|
|
3659
3827
|
can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and
|
|
@@ -3855,10 +4023,13 @@ class MlClient(NamespacedClient):
|
|
|
3855
4023
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
3856
4024
|
) -> ObjectApiResponse[t.Any]:
|
|
3857
4025
|
"""
|
|
3858
|
-
|
|
3859
|
-
|
|
4026
|
+
.. raw:: html
|
|
4027
|
+
|
|
4028
|
+
<p>Create a trained model.
|
|
4029
|
+
Enable you to supply a trained model that is not created by data frame analytics.</p>
|
|
4030
|
+
|
|
3860
4031
|
|
|
3861
|
-
`<https://www.elastic.co/
|
|
4032
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-trained-model>`_
|
|
3862
4033
|
|
|
3863
4034
|
:param model_id: The unique identifier of the trained model.
|
|
3864
4035
|
:param compressed_definition: The compressed (GZipped and Base64 encoded) inference
|
|
@@ -3958,21 +4129,28 @@ class MlClient(NamespacedClient):
|
|
|
3958
4129
|
reassign: t.Optional[bool] = None,
|
|
3959
4130
|
) -> ObjectApiResponse[t.Any]:
|
|
3960
4131
|
"""
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
4132
|
+
.. raw:: html
|
|
4133
|
+
|
|
4134
|
+
<p>Create or update a trained model alias.
|
|
4135
|
+
A trained model alias is a logical name used to reference a single trained
|
|
4136
|
+
model.
|
|
4137
|
+
You can use aliases instead of trained model identifiers to make it easier to
|
|
4138
|
+
reference your models. For example, you can use aliases in inference
|
|
4139
|
+
aggregations and processors.
|
|
4140
|
+
An alias must be unique and refer to only a single trained model. However,
|
|
4141
|
+
you can have multiple aliases for each trained model.
|
|
4142
|
+
If you use this API to update an alias such that it references a different
|
|
4143
|
+
trained model ID and the model uses a different type of data frame analytics,
|
|
4144
|
+
an error occurs. For example, this situation occurs if you have a trained
|
|
4145
|
+
model for regression analysis and a trained model for classification
|
|
4146
|
+
analysis; you cannot reassign an alias from one type of trained model to
|
|
4147
|
+
another.
|
|
4148
|
+
If you use this API to update an alias and there are very few input fields in
|
|
4149
|
+
common between the old and new trained models for the model alias, the API
|
|
4150
|
+
returns a warning.</p>
|
|
4151
|
+
|
|
4152
|
+
|
|
4153
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-trained-model-alias>`_
|
|
3976
4154
|
|
|
3977
4155
|
:param model_id: The identifier for the trained model that the alias refers to.
|
|
3978
4156
|
:param model_alias: The alias to create or update. This value cannot end in numbers.
|
|
@@ -4028,9 +4206,12 @@ class MlClient(NamespacedClient):
|
|
|
4028
4206
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4029
4207
|
) -> ObjectApiResponse[t.Any]:
|
|
4030
4208
|
"""
|
|
4031
|
-
|
|
4209
|
+
.. raw:: html
|
|
4032
4210
|
|
|
4033
|
-
|
|
4211
|
+
<p>Create part of a trained model definition.</p>
|
|
4212
|
+
|
|
4213
|
+
|
|
4214
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-trained-model-definition-part>`_
|
|
4034
4215
|
|
|
4035
4216
|
:param model_id: The unique identifier of the trained model.
|
|
4036
4217
|
:param part: The definition part number. When the definition is loaded for inference
|
|
@@ -4105,11 +4286,14 @@ class MlClient(NamespacedClient):
|
|
|
4105
4286
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4106
4287
|
) -> ObjectApiResponse[t.Any]:
|
|
4107
4288
|
"""
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4289
|
+
.. raw:: html
|
|
4290
|
+
|
|
4291
|
+
<p>Create a trained model vocabulary.
|
|
4292
|
+
This API is supported only for natural language processing (NLP) models.
|
|
4293
|
+
The vocabulary is stored in the index as described in <code>inference_config.*.vocabulary</code> of the trained model definition.</p>
|
|
4111
4294
|
|
|
4112
|
-
|
|
4295
|
+
|
|
4296
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-put-trained-model-vocabulary>`_
|
|
4113
4297
|
|
|
4114
4298
|
:param model_id: The unique identifier of the trained model.
|
|
4115
4299
|
:param vocabulary: The model vocabulary, which must not be empty.
|
|
@@ -4163,11 +4347,16 @@ class MlClient(NamespacedClient):
|
|
|
4163
4347
|
wait_for_completion: t.Optional[bool] = None,
|
|
4164
4348
|
) -> ObjectApiResponse[t.Any]:
|
|
4165
4349
|
"""
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4350
|
+
.. raw:: html
|
|
4351
|
+
|
|
4352
|
+
<p>Reset an anomaly detection job.
|
|
4353
|
+
All model state and results are deleted. The job is ready to start over as if
|
|
4354
|
+
it had just been created.
|
|
4355
|
+
It is not currently possible to reset multiple jobs using wildcards or a
|
|
4356
|
+
comma separated list.</p>
|
|
4169
4357
|
|
|
4170
|
-
|
|
4358
|
+
|
|
4359
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-reset-job>`_
|
|
4171
4360
|
|
|
4172
4361
|
:param job_id: The ID of the job to reset.
|
|
4173
4362
|
:param delete_user_annotations: Specifies whether annotations that have been
|
|
@@ -4219,15 +4408,19 @@ class MlClient(NamespacedClient):
|
|
|
4219
4408
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4220
4409
|
) -> ObjectApiResponse[t.Any]:
|
|
4221
4410
|
"""
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4411
|
+
.. raw:: html
|
|
4412
|
+
|
|
4413
|
+
<p>Revert to a snapshot.
|
|
4414
|
+
The machine learning features react quickly to anomalous input, learning new
|
|
4415
|
+
behaviors in data. Highly anomalous input increases the variance in the
|
|
4416
|
+
models whilst the system learns whether this is a new step-change in behavior
|
|
4417
|
+
or a one-off event. In the case where this anomalous input is known to be a
|
|
4418
|
+
one-off, then it might be appropriate to reset the model state to a time
|
|
4419
|
+
before this event. For example, you might consider reverting to a saved
|
|
4420
|
+
snapshot after Black Friday or a critical system failure.</p>
|
|
4421
|
+
|
|
4229
4422
|
|
|
4230
|
-
`<https://www.elastic.co/
|
|
4423
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-revert-model-snapshot>`_
|
|
4231
4424
|
|
|
4232
4425
|
:param job_id: Identifier for the anomaly detection job.
|
|
4233
4426
|
:param snapshot_id: You can specify `empty` as the <snapshot_id>. Reverting to
|
|
@@ -4285,19 +4478,24 @@ class MlClient(NamespacedClient):
|
|
|
4285
4478
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4286
4479
|
) -> ObjectApiResponse[t.Any]:
|
|
4287
4480
|
"""
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4481
|
+
.. raw:: html
|
|
4482
|
+
|
|
4483
|
+
<p>Set upgrade_mode for ML indices.
|
|
4484
|
+
Sets a cluster wide upgrade_mode setting that prepares machine learning
|
|
4485
|
+
indices for an upgrade.
|
|
4486
|
+
When upgrading your cluster, in some circumstances you must restart your
|
|
4487
|
+
nodes and reindex your machine learning indices. In those circumstances,
|
|
4488
|
+
there must be no machine learning jobs running. You can close the machine
|
|
4489
|
+
learning jobs, do the upgrade, then open all the jobs again. Alternatively,
|
|
4490
|
+
you can use this API to temporarily halt tasks associated with the jobs and
|
|
4491
|
+
datafeeds and prevent new jobs from opening. You can also use this API
|
|
4492
|
+
during upgrades that do not require you to reindex your machine learning
|
|
4493
|
+
indices, though stopping jobs is not a requirement in that case.
|
|
4494
|
+
You can see the current value for the upgrade_mode setting by using the get
|
|
4495
|
+
machine learning info API.</p>
|
|
4496
|
+
|
|
4299
4497
|
|
|
4300
|
-
`<https://www.elastic.co/
|
|
4498
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-set-upgrade-mode>`_
|
|
4301
4499
|
|
|
4302
4500
|
:param enabled: When `true`, it enables `upgrade_mode` which temporarily halts
|
|
4303
4501
|
all job and datafeed tasks and prohibits new job and datafeed tasks from
|
|
@@ -4341,18 +4539,23 @@ class MlClient(NamespacedClient):
|
|
|
4341
4539
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4342
4540
|
) -> ObjectApiResponse[t.Any]:
|
|
4343
4541
|
"""
|
|
4344
|
-
|
|
4345
|
-
stopped multiple times throughout its lifecycle. If the destination index does
|
|
4346
|
-
not exist, it is created automatically the first time you start the data frame
|
|
4347
|
-
analytics job. The `index.number_of_shards` and `index.number_of_replicas` settings
|
|
4348
|
-
for the destination index are copied from the source index. If there are multiple
|
|
4349
|
-
source indices, the destination index copies the highest setting values. The
|
|
4350
|
-
mappings for the destination index are also copied from the source indices. If
|
|
4351
|
-
there are any mapping conflicts, the job fails to start. If the destination index
|
|
4352
|
-
exists, it is used as is. You can therefore set up the destination index in advance
|
|
4353
|
-
with custom settings and mappings.
|
|
4542
|
+
.. raw:: html
|
|
4354
4543
|
|
|
4355
|
-
|
|
4544
|
+
<p>Start a data frame analytics job.
|
|
4545
|
+
A data frame analytics job can be started and stopped multiple times
|
|
4546
|
+
throughout its lifecycle.
|
|
4547
|
+
If the destination index does not exist, it is created automatically the
|
|
4548
|
+
first time you start the data frame analytics job. The
|
|
4549
|
+
<code>index.number_of_shards</code> and <code>index.number_of_replicas</code> settings for the
|
|
4550
|
+
destination index are copied from the source index. If there are multiple
|
|
4551
|
+
source indices, the destination index copies the highest setting values. The
|
|
4552
|
+
mappings for the destination index are also copied from the source indices.
|
|
4553
|
+
If there are any mapping conflicts, the job fails to start.
|
|
4554
|
+
If the destination index exists, it is used as is. You can therefore set up
|
|
4555
|
+
the destination index in advance with custom settings and mappings.</p>
|
|
4556
|
+
|
|
4557
|
+
|
|
4558
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-start-data-frame-analytics>`_
|
|
4356
4559
|
|
|
4357
4560
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
4358
4561
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -4402,19 +4605,20 @@ class MlClient(NamespacedClient):
|
|
|
4402
4605
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4403
4606
|
) -> ObjectApiResponse[t.Any]:
|
|
4404
4607
|
"""
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4608
|
+
.. raw:: html
|
|
4609
|
+
|
|
4610
|
+
<p>Start datafeeds.</p>
|
|
4611
|
+
<p>A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped
|
|
4612
|
+
multiple times throughout its lifecycle.</p>
|
|
4613
|
+
<p>Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs.</p>
|
|
4614
|
+
<p>If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped.
|
|
4615
|
+
If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.</p>
|
|
4616
|
+
<p>When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or
|
|
4617
|
+
update it had at the time of creation or update and runs the query using those same roles. If you provided secondary
|
|
4618
|
+
authorization headers when you created or updated the datafeed, those credentials are used instead.</p>
|
|
4416
4619
|
|
|
4417
|
-
|
|
4620
|
+
|
|
4621
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-start-datafeed>`_
|
|
4418
4622
|
|
|
4419
4623
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
4420
4624
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -4460,11 +4664,14 @@ class MlClient(NamespacedClient):
|
|
|
4460
4664
|
path_parts=__path_parts,
|
|
4461
4665
|
)
|
|
4462
4666
|
|
|
4463
|
-
@_rewrite_parameters(
|
|
4667
|
+
@_rewrite_parameters(
|
|
4668
|
+
body_fields=("adaptive_allocations",),
|
|
4669
|
+
)
|
|
4464
4670
|
async def start_trained_model_deployment(
|
|
4465
4671
|
self,
|
|
4466
4672
|
*,
|
|
4467
4673
|
model_id: str,
|
|
4674
|
+
adaptive_allocations: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
4468
4675
|
cache_size: t.Optional[t.Union[int, str]] = None,
|
|
4469
4676
|
deployment_id: t.Optional[str] = None,
|
|
4470
4677
|
error_trace: t.Optional[bool] = None,
|
|
@@ -4479,15 +4686,22 @@ class MlClient(NamespacedClient):
|
|
|
4479
4686
|
wait_for: t.Optional[
|
|
4480
4687
|
t.Union[str, t.Literal["fully_allocated", "started", "starting"]]
|
|
4481
4688
|
] = None,
|
|
4689
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4482
4690
|
) -> ObjectApiResponse[t.Any]:
|
|
4483
4691
|
"""
|
|
4484
|
-
|
|
4485
|
-
|
|
4692
|
+
.. raw:: html
|
|
4693
|
+
|
|
4694
|
+
<p>Start a trained model deployment.
|
|
4695
|
+
It allocates the model to every machine learning node.</p>
|
|
4486
4696
|
|
|
4487
|
-
|
|
4697
|
+
|
|
4698
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-start-trained-model-deployment>`_
|
|
4488
4699
|
|
|
4489
4700
|
:param model_id: The unique identifier of the trained model. Currently, only
|
|
4490
4701
|
PyTorch models are supported.
|
|
4702
|
+
:param adaptive_allocations: Adaptive allocations configuration. When enabled,
|
|
4703
|
+
the number of allocations is set based on the current load. If adaptive_allocations
|
|
4704
|
+
is enabled, do not set the number of allocations manually.
|
|
4491
4705
|
:param cache_size: The inference cache size (in memory outside the JVM heap)
|
|
4492
4706
|
per node for the model. The default value is the same size as the `model_size_bytes`.
|
|
4493
4707
|
To disable the cache, `0b` can be provided.
|
|
@@ -4497,7 +4711,8 @@ class MlClient(NamespacedClient):
|
|
|
4497
4711
|
model in memory but use a separate set of threads to evaluate the model.
|
|
4498
4712
|
Increasing this value generally increases the throughput. If this setting
|
|
4499
4713
|
is greater than the number of hardware threads it will automatically be changed
|
|
4500
|
-
to a value less than the number of hardware threads.
|
|
4714
|
+
to a value less than the number of hardware threads. If adaptive_allocations
|
|
4715
|
+
is enabled, do not set this value, because it’s automatically set.
|
|
4501
4716
|
:param priority: The deployment priority.
|
|
4502
4717
|
:param queue_capacity: Specifies the number of inference requests that are allowed
|
|
4503
4718
|
in the queue. After the number of requests exceeds this value, new requests
|
|
@@ -4517,6 +4732,7 @@ class MlClient(NamespacedClient):
|
|
|
4517
4732
|
__path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
|
|
4518
4733
|
__path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_start'
|
|
4519
4734
|
__query: t.Dict[str, t.Any] = {}
|
|
4735
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
4520
4736
|
if cache_size is not None:
|
|
4521
4737
|
__query["cache_size"] = cache_size
|
|
4522
4738
|
if deployment_id is not None:
|
|
@@ -4541,12 +4757,20 @@ class MlClient(NamespacedClient):
|
|
|
4541
4757
|
__query["timeout"] = timeout
|
|
4542
4758
|
if wait_for is not None:
|
|
4543
4759
|
__query["wait_for"] = wait_for
|
|
4760
|
+
if not __body:
|
|
4761
|
+
if adaptive_allocations is not None:
|
|
4762
|
+
__body["adaptive_allocations"] = adaptive_allocations
|
|
4763
|
+
if not __body:
|
|
4764
|
+
__body = None # type: ignore[assignment]
|
|
4544
4765
|
__headers = {"accept": "application/json"}
|
|
4766
|
+
if __body is not None:
|
|
4767
|
+
__headers["content-type"] = "application/json"
|
|
4545
4768
|
return await self.perform_request( # type: ignore[return-value]
|
|
4546
4769
|
"POST",
|
|
4547
4770
|
__path,
|
|
4548
4771
|
params=__query,
|
|
4549
4772
|
headers=__headers,
|
|
4773
|
+
body=__body,
|
|
4550
4774
|
endpoint_id="ml.start_trained_model_deployment",
|
|
4551
4775
|
path_parts=__path_parts,
|
|
4552
4776
|
)
|
|
@@ -4565,10 +4789,14 @@ class MlClient(NamespacedClient):
|
|
|
4565
4789
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
4566
4790
|
) -> ObjectApiResponse[t.Any]:
|
|
4567
4791
|
"""
|
|
4568
|
-
|
|
4569
|
-
|
|
4792
|
+
.. raw:: html
|
|
4793
|
+
|
|
4794
|
+
<p>Stop data frame analytics jobs.
|
|
4795
|
+
A data frame analytics job can be started and stopped multiple times
|
|
4796
|
+
throughout its lifecycle.</p>
|
|
4797
|
+
|
|
4570
4798
|
|
|
4571
|
-
`<https://www.elastic.co/
|
|
4799
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-stop-data-frame-analytics>`_
|
|
4572
4800
|
|
|
4573
4801
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
4574
4802
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -4631,10 +4859,14 @@ class MlClient(NamespacedClient):
|
|
|
4631
4859
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4632
4860
|
) -> ObjectApiResponse[t.Any]:
|
|
4633
4861
|
"""
|
|
4634
|
-
|
|
4635
|
-
|
|
4862
|
+
.. raw:: html
|
|
4863
|
+
|
|
4864
|
+
<p>Stop datafeeds.
|
|
4865
|
+
A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped
|
|
4866
|
+
multiple times throughout its lifecycle.</p>
|
|
4867
|
+
|
|
4636
4868
|
|
|
4637
|
-
`<https://www.elastic.co/
|
|
4869
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-stop-datafeed>`_
|
|
4638
4870
|
|
|
4639
4871
|
:param datafeed_id: Identifier for the datafeed. You can stop multiple datafeeds
|
|
4640
4872
|
in a single API request by using a comma-separated list of datafeeds or a
|
|
@@ -4694,9 +4926,12 @@ class MlClient(NamespacedClient):
|
|
|
4694
4926
|
pretty: t.Optional[bool] = None,
|
|
4695
4927
|
) -> ObjectApiResponse[t.Any]:
|
|
4696
4928
|
"""
|
|
4697
|
-
|
|
4929
|
+
.. raw:: html
|
|
4698
4930
|
|
|
4699
|
-
|
|
4931
|
+
<p>Stop a trained model deployment.</p>
|
|
4932
|
+
|
|
4933
|
+
|
|
4934
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-stop-trained-model-deployment>`_
|
|
4700
4935
|
|
|
4701
4936
|
:param model_id: The unique identifier of the trained model.
|
|
4702
4937
|
:param allow_no_match: Specifies what to do when the request: contains wildcard
|
|
@@ -4759,9 +4994,12 @@ class MlClient(NamespacedClient):
|
|
|
4759
4994
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4760
4995
|
) -> ObjectApiResponse[t.Any]:
|
|
4761
4996
|
"""
|
|
4762
|
-
|
|
4997
|
+
.. raw:: html
|
|
4998
|
+
|
|
4999
|
+
<p>Update a data frame analytics job.</p>
|
|
4763
5000
|
|
|
4764
|
-
|
|
5001
|
+
|
|
5002
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-update-data-frame-analytics>`_
|
|
4765
5003
|
|
|
4766
5004
|
:param id: Identifier for the data frame analytics job. This identifier can contain
|
|
4767
5005
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -4867,13 +5105,16 @@ class MlClient(NamespacedClient):
|
|
|
4867
5105
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
4868
5106
|
) -> ObjectApiResponse[t.Any]:
|
|
4869
5107
|
"""
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
5108
|
+
.. raw:: html
|
|
5109
|
+
|
|
5110
|
+
<p>Update a datafeed.
|
|
5111
|
+
You must stop and start the datafeed for the changes to be applied.
|
|
5112
|
+
When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at
|
|
5113
|
+
the time of the update and runs the query using those same roles. If you provide secondary authorization headers,
|
|
5114
|
+
those credentials are used instead.</p>
|
|
4875
5115
|
|
|
4876
|
-
|
|
5116
|
+
|
|
5117
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-update-datafeed>`_
|
|
4877
5118
|
|
|
4878
5119
|
:param datafeed_id: A numerical character string that uniquely identifies the
|
|
4879
5120
|
datafeed. This identifier can contain lowercase alphanumeric characters (a-z
|
|
@@ -5034,10 +5275,13 @@ class MlClient(NamespacedClient):
|
|
|
5034
5275
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5035
5276
|
) -> ObjectApiResponse[t.Any]:
|
|
5036
5277
|
"""
|
|
5037
|
-
|
|
5038
|
-
|
|
5278
|
+
.. raw:: html
|
|
5279
|
+
|
|
5280
|
+
<p>Update a filter.
|
|
5281
|
+
Updates the description of a filter, adds items, or removes items from the list.</p>
|
|
5282
|
+
|
|
5039
5283
|
|
|
5040
|
-
`<https://www.elastic.co/
|
|
5284
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-update-filter>`_
|
|
5041
5285
|
|
|
5042
5286
|
:param filter_id: A string that uniquely identifies a filter.
|
|
5043
5287
|
:param add_items: The items to add to the filter.
|
|
@@ -5125,10 +5369,13 @@ class MlClient(NamespacedClient):
|
|
|
5125
5369
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5126
5370
|
) -> ObjectApiResponse[t.Any]:
|
|
5127
5371
|
"""
|
|
5128
|
-
|
|
5129
|
-
|
|
5372
|
+
.. raw:: html
|
|
5373
|
+
|
|
5374
|
+
<p>Update an anomaly detection job.
|
|
5375
|
+
Updates certain properties of an anomaly detection job.</p>
|
|
5376
|
+
|
|
5130
5377
|
|
|
5131
|
-
`<https://www.elastic.co/
|
|
5378
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-update-job>`_
|
|
5132
5379
|
|
|
5133
5380
|
:param job_id: Identifier for the job.
|
|
5134
5381
|
:param allow_lazy_open: Advanced configuration option. Specifies whether this
|
|
@@ -5254,9 +5501,13 @@ class MlClient(NamespacedClient):
|
|
|
5254
5501
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5255
5502
|
) -> ObjectApiResponse[t.Any]:
|
|
5256
5503
|
"""
|
|
5257
|
-
|
|
5504
|
+
.. raw:: html
|
|
5258
5505
|
|
|
5259
|
-
|
|
5506
|
+
<p>Update a snapshot.
|
|
5507
|
+
Updates certain properties of a snapshot.</p>
|
|
5508
|
+
|
|
5509
|
+
|
|
5510
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-update-model-snapshot>`_
|
|
5260
5511
|
|
|
5261
5512
|
:param job_id: Identifier for the anomaly detection job.
|
|
5262
5513
|
:param snapshot_id: Identifier for the model snapshot.
|
|
@@ -5301,12 +5552,13 @@ class MlClient(NamespacedClient):
|
|
|
5301
5552
|
)
|
|
5302
5553
|
|
|
5303
5554
|
@_rewrite_parameters(
|
|
5304
|
-
body_fields=("number_of_allocations"
|
|
5555
|
+
body_fields=("adaptive_allocations", "number_of_allocations"),
|
|
5305
5556
|
)
|
|
5306
5557
|
async def update_trained_model_deployment(
|
|
5307
5558
|
self,
|
|
5308
5559
|
*,
|
|
5309
5560
|
model_id: str,
|
|
5561
|
+
adaptive_allocations: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
5310
5562
|
error_trace: t.Optional[bool] = None,
|
|
5311
5563
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
5312
5564
|
human: t.Optional[bool] = None,
|
|
@@ -5315,18 +5567,25 @@ class MlClient(NamespacedClient):
|
|
|
5315
5567
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5316
5568
|
) -> ObjectApiResponse[t.Any]:
|
|
5317
5569
|
"""
|
|
5318
|
-
|
|
5570
|
+
.. raw:: html
|
|
5571
|
+
|
|
5572
|
+
<p>Update a trained model deployment.</p>
|
|
5319
5573
|
|
|
5320
|
-
|
|
5574
|
+
|
|
5575
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-update-trained-model-deployment>`_
|
|
5321
5576
|
|
|
5322
5577
|
:param model_id: The unique identifier of the trained model. Currently, only
|
|
5323
5578
|
PyTorch models are supported.
|
|
5579
|
+
:param adaptive_allocations: Adaptive allocations configuration. When enabled,
|
|
5580
|
+
the number of allocations is set based on the current load. If adaptive_allocations
|
|
5581
|
+
is enabled, do not set the number of allocations manually.
|
|
5324
5582
|
:param number_of_allocations: The number of model allocations on each node where
|
|
5325
5583
|
the model is deployed. All allocations on a node share the same copy of the
|
|
5326
5584
|
model in memory but use a separate set of threads to evaluate the model.
|
|
5327
5585
|
Increasing this value generally increases the throughput. If this setting
|
|
5328
5586
|
is greater than the number of hardware threads it will automatically be changed
|
|
5329
|
-
to a value less than the number of hardware threads.
|
|
5587
|
+
to a value less than the number of hardware threads. If adaptive_allocations
|
|
5588
|
+
is enabled, do not set this value, because it’s automatically set.
|
|
5330
5589
|
"""
|
|
5331
5590
|
if model_id in SKIP_IN_PATH:
|
|
5332
5591
|
raise ValueError("Empty value passed for parameter 'model_id'")
|
|
@@ -5343,6 +5602,8 @@ class MlClient(NamespacedClient):
|
|
|
5343
5602
|
if pretty is not None:
|
|
5344
5603
|
__query["pretty"] = pretty
|
|
5345
5604
|
if not __body:
|
|
5605
|
+
if adaptive_allocations is not None:
|
|
5606
|
+
__body["adaptive_allocations"] = adaptive_allocations
|
|
5346
5607
|
if number_of_allocations is not None:
|
|
5347
5608
|
__body["number_of_allocations"] = number_of_allocations
|
|
5348
5609
|
if not __body:
|
|
@@ -5374,16 +5635,21 @@ class MlClient(NamespacedClient):
|
|
|
5374
5635
|
wait_for_completion: t.Optional[bool] = None,
|
|
5375
5636
|
) -> ObjectApiResponse[t.Any]:
|
|
5376
5637
|
"""
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5638
|
+
.. raw:: html
|
|
5639
|
+
|
|
5640
|
+
<p>Upgrade a snapshot.
|
|
5641
|
+
Upgrade an anomaly detection model snapshot to the latest major version.
|
|
5642
|
+
Over time, older snapshot formats are deprecated and removed. Anomaly
|
|
5643
|
+
detection jobs support only snapshots that are from the current or previous
|
|
5644
|
+
major version.
|
|
5645
|
+
This API provides a means to upgrade a snapshot to the current major version.
|
|
5646
|
+
This aids in preparing the cluster for an upgrade to the next major version.
|
|
5647
|
+
Only one snapshot per anomaly detection job can be upgraded at a time and the
|
|
5648
|
+
upgraded snapshot cannot be the current snapshot of the anomaly detection
|
|
5649
|
+
job.</p>
|
|
5385
5650
|
|
|
5386
|
-
|
|
5651
|
+
|
|
5652
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-upgrade-job-snapshot>`_
|
|
5387
5653
|
|
|
5388
5654
|
:param job_id: Identifier for the anomaly detection job.
|
|
5389
5655
|
:param snapshot_id: A numerical character string that uniquely identifies the
|
|
@@ -5457,9 +5723,12 @@ class MlClient(NamespacedClient):
|
|
|
5457
5723
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
5458
5724
|
) -> ObjectApiResponse[t.Any]:
|
|
5459
5725
|
"""
|
|
5460
|
-
|
|
5726
|
+
.. raw:: html
|
|
5727
|
+
|
|
5728
|
+
<p>Validate an anomaly detection job.</p>
|
|
5729
|
+
|
|
5461
5730
|
|
|
5462
|
-
`<https://www.elastic.co/guide/en/machine-learning/
|
|
5731
|
+
`<https://www.elastic.co/guide/en/machine-learning/9.0/ml-jobs.html>`_
|
|
5463
5732
|
|
|
5464
5733
|
:param analysis_config:
|
|
5465
5734
|
:param analysis_limits:
|
|
@@ -5527,9 +5796,12 @@ class MlClient(NamespacedClient):
|
|
|
5527
5796
|
pretty: t.Optional[bool] = None,
|
|
5528
5797
|
) -> ObjectApiResponse[t.Any]:
|
|
5529
5798
|
"""
|
|
5530
|
-
|
|
5799
|
+
.. raw:: html
|
|
5800
|
+
|
|
5801
|
+
<p>Validate an anomaly detection job.</p>
|
|
5802
|
+
|
|
5531
5803
|
|
|
5532
|
-
`<https://www.elastic.co/
|
|
5804
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/v9/>`_
|
|
5533
5805
|
|
|
5534
5806
|
:param detector:
|
|
5535
5807
|
"""
|