Skip to main content

Get Poll Data for All Tasks

Endpoint: GET /tasks/queue/polldata/all

Gets the last poll data for all the tasks in the task queue. The filter parameters can be used to refine the request based on your requirements.

Query parameters

ParameterDescriptionTypeRequired/ Optional
workerSizeThe number of worker instances polling for all the tasks in the queue.integerOptional.
workerOptOption to filter based on the worker size. Supported values:
  • GT (Greater than)
  • LT (Less than)
stringRequired if workerSize is used.
queueSizeThe total number of tasks in the queue waiting to be executed.integerOptional.
queueOptOption to filter based on the queue size. Supported values:
  • GT (Greater than)
  • LT (Less than)
stringRequired if queueSize is used.
lastPollTimeSizeThe last polled time in Unix timestamp format.integerOptional.
lastPollTimeOptOption to filter based on the last poll time. Supported values:
  • GT (Greater than)
  • LT (Less than)
stringRequired if lassPollTimeSize is used.

Response

Returns a map containing queueData and an array of pollData.

  • queueData–Indicates the size of each task queue.
  • pollData–Includes the queueName , workerId, and lastPollTime for each task.
    • queueName–The name of the task queue. For predefined tasks, this returns the task type, such as HTTP. For user-defined tasks, it returns the name of the task definition, such as python_worker.
    • workerId–The worker name from which the task is being polled, which is the hostname of the pod where the worker is running.
    • lastPollTime–The last polled time in Unix timestamp format.

If a worker has not picked up the task, no pollData will be available and the array will be empty.

Examples

Get the last poll data for tasks with a queue size greater than 7

Request

curl -X 'GET' \
'https://<YOUR_CLUSTER>/api/tasks/queue/polldata/all?queueSize=7&queueOpt=GT' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>'

Response

{
"queueData": {
"_deciderQueue": {
"size": 31
},
"WAIT": {
"pollerCount": 1,
"size": 18
},
"_batch_upload_queue0": {
"size": 15
}
},
"pollData": [
{
"queueName": "WAIT",
"workerId": "acme-workers-deployment-5cf6957cdf-rn2pd",
"lastPollTime": 1735561620048
}
]
}

Here pollData is available only for the WAIT task as only it has been picked up by the worker and the rest of the tasks are in the queue awaiting workers.