Get the pending cluster tasks
- GET /_cluster/pending_tasks
Get information about cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet taken effect.
NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the task management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API.
- Cluster privileges:
monitor
Query Parameters
-
localboolean · default: false If
true, the request retrieves information from the local node only. Iffalse, information is retrieved from the master node.-
master_timeoutstring Duration · default: 30s Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
Response
-
tasksPendingTaskrequired -
executingbooleanrequired -
Indicates whether the pending tasks are currently executing or not.
-
insert_ordernumberrequired -
The number that represents when the task has been inserted into the task queue.
-
prioritystringrequired -
The priority of the pending task. The valid priorities in descending priority order are:
IMMEDIATE>URGENT>HIGH>NORMAL>LOW>LANGUID. -
sourcestringrequired -
A general description of the cluster task that may include a reason and origin.
-
time_in_queuestring Duration -
The time since the task is waiting for being performed.
-
time_in_queue_millisDurationValueUnitMillisrequired -
The time expressed in milliseconds since the task is waiting for being performed.