delete-forecast.asciidoc 2.5 KB

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