younifyd
Menu

Cancel an ongoing reindex task

Cancel an ongoing reindex task

POST/_reindex/{task_id}/_cancel

Use it in a workflow

  1. Add a step and choose the Elasticsearch connector.
  2. Pick the Cancel an ongoing reindex task action (under reindex).
  3. Fill in the fields below, then reference the result from later steps as {{cancelAnOngoingReindexTask.response.data}}.

Request

Path parameters

task_idstringrequired

The ID of the reindex task to cancel.

Query parameters

wait_for_completionboolean

If `true` (the default), the request blocks until the cancellation is complete and returns the final task state. If `false`, the request returns immediately with `acknowledged: true`.

Response

Returns 200 with an object. Read it in later steps with {{cancelAnOngoingReindexTask.response.data.<field>}}.

acknowledgedboolean

Present and `true` when `wait_for_completion=false`.

completedboolean

Whether the reindex task has completed. Present when `wait_for_completion=true`.

idany

The ID of the reindex task. The value is the ID assigned when the task was first created and remains stable across node-shutdown relocations. Present when `wait_for_completion=true`.

descriptionstring

A sanitized description of the reindex operation.

start_time_in_millisany

The time at which the reindex task started, in milliseconds since the Unix epoch.

start_timestring

The time at which the reindex task started, as an ISO 8601 formatted string.

running_timeany

The elapsed running time of the reindex task, in a human-readable format. Only present when the request includes the `?human=true` query parameter.

running_time_in_nanosany

The elapsed running time of the reindex task, in nanoseconds.

cancelledboolean

Whether the reindex task has been cancelled.

statusany

The status of the reindex operation at the time of cancellation.

errorany

The error that caused the reindex task to fail, if any.

responseany

The final result of the reindex operation, if it completed before being cancelled.

json
{
  "acknowledged": false,
  "completed": false,
  "id": null,
  "description": "string",
  "start_time_in_millis": null,
  "start_time": "string",
  "running_time": null,
  "running_time_in_nanos": null,
  "cancelled": false,
  "status": null,
  "error": null,
  "response": null
}

Need more? See the Elasticsearch guide for connection setup and behaviour shared by every action.

Cancel an ongoing reindex task — Elasticsearch — Documentation