2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-flush-job]]
|
2017-12-14 13:52:49 -05:00
|
|
|
=== Flush Jobs API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Flush Jobs</titleabbrev>
|
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The flush job API forces any buffered data to be processed by the job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Request
|
2017-04-11 21:52:47 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`POST _xpack/ml/anomaly_detectors/<job_id>/_flush`
|
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Description
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
The flush job API is only applicable when sending data for analysis using the
|
|
|
|
<<ml-post-data,post data API>>. Depending on the content of the buffer, then it
|
|
|
|
might additionally calculate new results.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-18 18:13:21 -04:00
|
|
|
Both flush and close operations are similar, however the flush is more efficient
|
2017-04-25 17:08:29 -04:00
|
|
|
if you are expecting to send more data for analysis. When flushing, the job
|
|
|
|
remains open and is available to continue analyzing data. A close operation
|
|
|
|
additionally prunes and persists the model state to disk and the job must be
|
|
|
|
opened again before analyzing further data.
|
2017-04-18 18:13:21 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Path Parameters
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`job_id` (required)::
|
2017-04-25 17:08:29 -04:00
|
|
|
(string) Identifier for the job
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Query Parameters
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
`advance_time`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Specifies that no data prior to the date `advance_time` is expected.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`end`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) When used in conjunction with `calc_interim`, specifies the range
|
2017-04-11 21:52:47 -04:00
|
|
|
of buckets on which to calculate interim results.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
`calc_interim`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(boolean) If true, calculates the interim results for the most recent bucket
|
2017-04-11 21:52:47 -04:00
|
|
|
or all buckets within the latency period.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
`start`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) When used in conjunction with `calc_interim`, specifies the range of
|
2017-04-11 21:52:47 -04:00
|
|
|
buckets on which to calculate interim results.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Authorization
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
You must have `manage_ml`, or `manage` cluster privileges to use this API.
|
2017-06-19 21:23:58 -04:00
|
|
|
For more information, see {xpack-ref}/security-privileges.html[Security Privileges].
|
|
|
|
//<<privileges-list-cluster>>.
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Examples
|
2017-04-06 10:56:46 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The following example flushes the `farequote` job:
|
2017-04-06 10:56:46 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST _xpack/ml/anomaly_detectors/farequote/_flush
|
|
|
|
{
|
|
|
|
"calc_interim": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
|
|
|
When the operation succeeds, you receive the following results:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-06 10:56:46 -04:00
|
|
|
----
|
|
|
|
{
|
|
|
|
"flushed": true
|
|
|
|
}
|
|
|
|
----
|