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
Parameter | Description | Type | Required/ Optional |
---|---|---|---|
workerSize | The number of worker instances polling for all the tasks in the queue. | integer | Optional. |
workerOpt | Option to filter based on the worker size. Supported values:
| string | Required if workerSize is used. |
queueSize | The total number of tasks in the queue waiting to be executed. | integer | Optional. |
queueOpt | Option to filter based on the queue size. Supported values:
| string | Required if queueSize is used. |
lastPollTimeSize | The last polled time in Unix timestamp format. | integer | Optional. |
lastPollTimeOpt | Option to filter based on the last poll time. Supported values:
| string | Required 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.