This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.
This API stops an existing, started rollup job. If the job does not exist an exception will be thrown. Stopping an already stopped job has no action.
wait_for_completion
(optional)
false
.
timeout
(optional)
wait_for_completion=true
, the API will block for (at maximum)
the specified duration while waiting for the job to stop. If more than timeout
time has passed, the API
will throw a timeout exception. Note: even if a timeout exception is thrown, the stop request is still processing and
will eventually move the job to STOPPED
. The timeout simply means the API call itself timed out while waiting
for the status change. Defaults to 30s
You must have manage
or manage_rollup
cluster privileges to use this API.
For more information, see
Security Privileges.
If we have an already-started rollup job named sensor
, it can be stopped with:
POST _rollup/job/sensor/_stop
Which will return the response:
{ "stopped": true }
If however we try to stop a job which doesn’t exist:
POST _rollup/job/does_not_exist/_stop
A 404 resource_not_found
exception will be thrown:
{ "error" : { "root_cause" : [ { "type" : "resource_not_found_exception", "reason" : "Task for Rollup Job [does_not_exist] not found", "stack_trace": ... } ], "type" : "resource_not_found_exception", "reason" : "Task for Rollup Job [does_not_exist] not found", "stack_trace": ... }, "status": 404 }
Since only a stopped job can be deleted, it can be useful to block the StopJob API until the indexer has fully
stopped. This is accomplished with the wait_for_completion
query parameter, and optionally a timeout
:
POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
The parameter will block 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 will be thrown.
If wait_for_completion=true
is specified without a timeout
, a default timeout of 30 seconds is used.