2018-02-23 17:10:37 -05:00
|
|
|
[role="xpack"]
|
2018-08-31 13:50:43 -04:00
|
|
|
[testenv="basic"]
|
2018-02-23 17:10:37 -05:00
|
|
|
[[rollup-stop-job]]
|
2019-07-10 18:12:32 -04:00
|
|
|
=== Stop {rollup-jobs} API
|
|
|
|
[subs="attributes"]
|
2018-02-23 17:10:37 -05:00
|
|
|
++++
|
2019-07-10 18:12:32 -04:00
|
|
|
<titleabbrev>Stop {rollup-jobs}</titleabbrev>
|
2018-02-23 17:10:37 -05:00
|
|
|
++++
|
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
Stops an existing, started {rollup-job}.
|
2018-06-13 15:42:20 -04:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
experimental[]
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-stop-job-request]]
|
|
|
|
==== {api-request-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2018-12-11 19:43:17 -05:00
|
|
|
`POST _rollup/job/<job_id>/_stop`
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-stop-job-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
2018-11-13 16:37:17 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
* You must have `manage` or `manage_rollup` cluster privileges to use this API.
|
2018-02-23 17:10:37 -05:00
|
|
|
For more information, see
|
2019-07-10 18:12:32 -04:00
|
|
|
{stack-ov}/security-privileges.html[Security privileges].
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-stop-job-desc]]
|
|
|
|
===== {api-description-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
If you try to stop a job that does not exist, an exception occurs. If you try
|
|
|
|
to stop a job that is already stopped, nothing happens.
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-stop-job-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
`<job_id>`::
|
|
|
|
(string) Required. Identifier for the {rollup-job}.
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-stop-job-query-parms]]
|
|
|
|
==== {api-query-parms-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
`timeout`::
|
|
|
|
(TimeValue) Optional. If `wait_for_completion` is `true`, the API blocks for
|
|
|
|
(at maximum) the specified duration while waiting for the job to stop. If more
|
|
|
|
than `timeout` time has passed, the API throws a timeout exception. Defaults
|
|
|
|
to `30s`.
|
|
|
|
+
|
|
|
|
--
|
|
|
|
NOTE: Even if a timeout exception is thrown, the stop request is still
|
|
|
|
processing and eventually moves the job to `STOPPED`. The timeout simply means
|
|
|
|
the API call itself timed out while waiting for the status change.
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
--
|
|
|
|
|
|
|
|
`wait_for_completion`::
|
|
|
|
(boolean) Optional. If set to `true`, causes the API to block until the
|
|
|
|
indexer state completely stops. If set to `false`, the API returns immediately
|
|
|
|
and the indexer is stopped asynchronously in the background. Defaults to
|
|
|
|
`false`.
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-stop-job-response-codes]]
|
|
|
|
==== {api-response-codes-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
`404` (Missing resources)::
|
|
|
|
This code indicates that there are no resources that match the request. It
|
|
|
|
occurs if you try to stop a job that doesn't exist.
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-stop-job-examples]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
|
|
Since only a stopped job can be deleted, it can be useful to block the API until
|
|
|
|
the indexer has fully stopped. This is accomplished with the
|
|
|
|
`wait_for_completion` query parameter, and optionally a `timeout`:
|
2018-11-13 16:37:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-12-11 19:43:17 -05:00
|
|
|
POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
|
2018-11-13 16:37:17 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[setup:sensor_started_rollup_job]
|
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
The parameter blocks the API call from returning until either the job has moved
|
|
|
|
to `STOPPED` or the specified time has elapsed. If the specified time elapses
|
|
|
|
without the job moving to `STOPPED`, a timeout exception is thrown.
|