Stop rollup jobs API
Deprecated in 8.11.0.
Rollups will be removed in a future version. Use downsampling instead.
Stops an existing, started rollup job.
Request
POST _rollup/job/<job_id>/_stop
Prerequisites
- If the Elasticsearch security features are enabled, you must have
manageormanage_rollupcluster privileges to use this API. For more information, see Security privileges.
Description
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.
Path parameters
-
<job_id> - (Required, string) Identifier for the rollup job.
Query parameters
-
timeout -
(Optional, TimeValue) If
wait_for_completionistrue, the API blocks for (at maximum) the specified duration while waiting for the job to stop. If more thantimeouttime has passed, the API throws a timeout exception. Defaults to30s.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. -
wait_for_completion - (Optional, Boolean) If set to
true, causes the API to block until the indexer state completely stops. If set tofalse, the API returns immediately and the indexer is stopped asynchronously in the background. Defaults tofalse.
Response codes
-
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.
Examples
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:
resp = client.rollup.stop_job(
id="sensor",
wait_for_completion=True,
timeout="10s",
)
print(resp) response = client.rollup.stop_job( id: 'sensor', wait_for_completion: true, timeout: '10s' ) puts response
const response = await client.rollup.stopJob({
id: "sensor",
wait_for_completion: "true",
timeout: "10s",
});
console.log(response); POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
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.
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-stop-job.html