delete-forecast.asciidoc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-delete-forecast]]
  4. = Delete forecasts API
  5. ++++
  6. <titleabbrev>Delete forecasts</titleabbrev>
  7. ++++
  8. Deletes forecasts from a {ml} job.
  9. [[ml-delete-forecast-request]]
  10. == {api-request-title}
  11. `DELETE _ml/anomaly_detectors/<job_id>/_forecast` +
  12. `DELETE _ml/anomaly_detectors/<job_id>/_forecast/<forecast_id>` +
  13. `DELETE _ml/anomaly_detectors/<job_id>/_forecast/_all`
  14. [[ml-delete-forecast-prereqs]]
  15. == {api-prereq-title}
  16. Requires the `manage_ml` cluster privilege. This privilege is included in the
  17. `machine_learning_admin` built-in role.
  18. [[ml-delete-forecast-desc]]
  19. == {api-description-title}
  20. By default, forecasts are retained for 14 days. You can specify a different
  21. retention period with the `expires_in` parameter in the
  22. <<ml-forecast,forecast jobs API>>. The delete forecast API enables you to delete
  23. one or more forecasts before they expire.
  24. NOTE: When you delete a job, its associated forecasts are deleted.
  25. For more information, see
  26. {ml-docs}/ml-overview.html#ml-forecasting[Forecasting the future].
  27. [[ml-delete-forecast-path-parms]]
  28. == {api-path-parms-title}
  29. `<forecast_id>`::
  30. (Optional, string) A comma-separated list of forecast identifiers. If you do not
  31. specify this optional parameter or if you specify `_all` or `*` the API deletes all
  32. forecasts from the job.
  33. `<job_id>`::
  34. (Required, string)
  35. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  36. [[ml-delete-forecast-query-parms]]
  37. == {api-query-parms-title}
  38. `allow_no_forecasts`::
  39. (Optional, Boolean) Specifies whether an error occurs when there are no
  40. forecasts. In particular, if this parameter is set to `false` and there are no
  41. forecasts associated with the job, attempts to delete all forecasts return an
  42. error. The default value is `true`.
  43. `timeout`::
  44. (Optional, <<time-units, time units>>) Specifies the period of time to wait
  45. for the completion of the delete operation. When this period of time elapses,
  46. the API fails and returns an error. The default value is `30s`.
  47. [[ml-delete-forecast-example]]
  48. == {api-examples-title}
  49. [source,console]
  50. --------------------------------------------------
  51. DELETE _ml/anomaly_detectors/total-requests/_forecast/_all
  52. --------------------------------------------------
  53. // TEST[skip:setup:server_metrics_openjob]
  54. If the request does not encounter errors, you receive the following result:
  55. [source,js]
  56. ----
  57. {
  58. "acknowledged": true
  59. }
  60. ----
  61. // NOTCONSOLE