原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-delete-forecast.html, 原文档版权归 www.elastic.co 所有
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Delete forecast APIedit
Deletes forecasts from a machine learning job.
Requestedit
DELETE _ml/anomaly_detectors/<job_id>/_forecast
DELETE _ml/anomaly_detectors/<job_id>/_forecast/<forecast_id>
DELETE _ml/anomaly_detectors/<job_id>/_forecast/_all
Prerequisitesedit
-
If the Elasticsearch security features are enabled, you must have
manage_ml
ormanage
cluster privileges to use this API. See Security privileges.
Descriptionedit
By default, forecasts are retained for 14 days. You can specify a different
retention period with the expires_in
parameter in the
forecast jobs API. The delete forecast API enables you to delete
one or more forecasts before they expire.
When you delete a job, its associated forecasts are deleted.
For more information, see Forecasting the future.
Path parametersedit
-
<forecast_id>
-
(Optional, string) A comma-separated list of forecast identifiers. If you do not
specify this optional parameter or if you specify
_all
, the API deletes all forecasts from the job. -
<job_id>
- (Required, string) Identifier for the anomaly detection job.
Query parametersedit
-
allow_no_forecasts
-
(Optional, boolean) Specifies whether an error occurs when there are no
forecasts. In particular, if this parameter is set to
false
and there are no forecasts associated with the job, attempts to delete all forecasts return an error. The default value istrue
. -
timeout
-
(Optional, time units) Specifies the period of time to wait
for the completion of the delete operation. When this period of time elapses,
the API fails and returns an error. The default value is
30s
.
Examplesedit
DELETE _ml/anomaly_detectors/total-requests/_forecast/_all
If the request does not encounter errors, you receive the following result:
{ "acknowledged": true }