OpenSearch/docs/java-rest/high-level/ml/open-job.asciidoc
David Roberts da5aeb8be7
[ML] Return assigned node in start/open job/datafeed response (#55570)
Adds a "node" field to the response from the following endpoints:

1. Open anomaly detection job
2. Start datafeed
3. Start data frame analytics job

If the job or datafeed is assigned to a node immediately then
this field will return the ID of that node.

In the case where a job or datafeed is opened or started lazily
the node field will contain an empty string.  Clients that want
to test whether a job or datafeed was opened or started lazily
can therefore check for this.

Backport of #55473
2020-04-22 12:06:53 +01:00

42 lines
1.5 KiB
Plaintext

--
:api: open-job
:request: OpenJobRequest
:response: OpenJobResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Open {anomaly-job} API
Opens {anomaly-jobs} in the cluster. It accepts a +{request}+ object and
responds with a +{response}+ object.
[id="{upid}-{api}-request"]
==== Open {anomaly-job} request
An +{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 an existing `jobId`
<2> Optionally setting the `timeout` value for how long the
execution should wait for the job to be opened.
[id="{upid}-{api}-response"]
==== Open {anomaly-job} response
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> `isOpened()` from the +{response}+ is always `true` if the job was
opened successfully. (An exception would be thrown instead if the job
was not opened successfully.)
<2> `getNode()` returns the node that the job was assigned to. If the
job is allowed to open lazily and has not yet been assigned to a node
then an empty string is returned. If `getNode()` returns `null` then
the server is an old version that does not return node information.
include::../execution.asciidoc[]