OpenSearch/docs/java-rest/high-level/ml/delete-forecast.asciidoc

53 lines
1.8 KiB
Plaintext

--
:api: delete-forecast
:request: DeleteForecastRequest
:response: AcknowledgedResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Delete forecast API
The delete forecast API provides the ability to delete a {ml} job's
forecast in the cluster.
It accepts a +{request}+ object and responds
with an +{response}+ object.
[id="{upid}-{api}-request"]
==== Delete forecast request
A +{request}+ object gets created with an existing non-null `jobId`.
All other fields are optional for the request.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> Constructing a new request referencing an existing `jobId`
==== Optional arguments
The following arguments are optional.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request-options]
--------------------------------------------------
<1> Sets the specific forecastIds to delete, can be set to `_all` to indicate ALL forecasts for the given
`jobId`
<2> Set the timeout for the request to respond, default is 30 seconds
<3> Set the `allow_no_forecasts` option. When `true` no error will be returned if an `_all`
request finds no forecasts. It defaults to `true`
[id="{upid}-{api}-response"]
==== Delete forecast response
An +{response}+ contains an acknowledgement of the forecast(s) deletion
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> `isAcknowledged()` indicates if the forecast was successfully deleted or not.
include::../execution.asciidoc[]