OpenSearch/docs/java-rest/high-level/ml/close-job.asciidoc

41 lines
1.4 KiB
Plaintext

--
:api: close-job
:request: CloseJobRequest
:response: CloseJobResponse
--
[id="{upid}-{api}"]
=== Close Job API
The Close Job API provides the ability to close {ml} jobs in the cluster.
It accepts a +{request}+ object and responds
with a +{response}+ object.
[id="{upid}-{api}-request"]
==== Close Job Request
A +{request}+ object gets created with an existing non-null `jobId`.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> Constructing a new request referencing existing job IDs
<2> Optionally used to close a failed job, or to forcefully close a job
which has not responded to its initial close request.
<3> Optionally set to ignore if a wildcard expression matches no jobs.
(This includes `_all` string or when no jobs have been specified)
<4> Optionally setting the `timeout` value for how long the
execution should wait for the job to be closed.
[id="{upid}-{api}-response"]
==== Close Job Response
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> `isClosed()` from the +{response}+ indicates if the job was successfully
closed or not.
include::../execution.asciidoc[]