Queue API Documentation

##

The queue, typically available at queue.taskcluster.net, is responsible for accepting tasks and track their state as they are executed by workers. In order ensure they are eventually resolved.

This document describes the API end-points offered by the queue. These end-points targets the following audience:

  • Schedulers, who create tasks to be executed,
  • Workers, who execute tasks, and
  • Tools, that wants to inspect the state of a task.

Queue Client

// Create Queue client instance:

const queue = new taskcluster.Queue(options);

Methods in Queue Client

// queue.task :: taskId -> Promise Result
queue.task(taskId)
// queue.status :: taskId -> Promise Result
queue.status(taskId)
// queue.listTaskGroup :: (taskGroupId -> [options]) -> Promise Result
queue.listTaskGroup(taskGroupId)
queue.listTaskGroup(taskGroupId, options)
// queue.listDependentTasks :: (taskId -> [options]) -> Promise Result
queue.listDependentTasks(taskId)
queue.listDependentTasks(taskId, options)
// queue.createTask :: (taskId -> payload) -> Promise Result
queue.createTask(taskId, payload)
// queue.defineTask :: (taskId -> payload) -> Promise Result
queue.defineTask(taskId, payload)
// queue.scheduleTask :: taskId -> Promise Result
queue.scheduleTask(taskId)
// queue.rerunTask :: taskId -> Promise Result
queue.rerunTask(taskId)
// queue.cancelTask :: taskId -> Promise Result
queue.cancelTask(taskId)
// queue.pollTaskUrls :: (provisionerId -> workerType) -> Promise Result
queue.pollTaskUrls(provisionerId, workerType)
// queue.claimWork :: (provisionerId -> workerType -> payload) -> Promise Result
queue.claimWork(provisionerId, workerType, payload)
// queue.claimTask :: (taskId -> runId -> payload) -> Promise Result
queue.claimTask(taskId, runId, payload)
// queue.reclaimTask :: (taskId -> runId) -> Promise Result
queue.reclaimTask(taskId, runId)
// queue.reportCompleted :: (taskId -> runId) -> Promise Result
queue.reportCompleted(taskId, runId)
// queue.reportFailed :: (taskId -> runId) -> Promise Result
queue.reportFailed(taskId, runId)
// queue.reportException :: (taskId -> runId -> payload) -> Promise Result
queue.reportException(taskId, runId, payload)
// queue.createArtifact :: (taskId -> runId -> name -> payload) -> Promise Result
queue.createArtifact(taskId, runId, name, payload)
// queue.completeArtifact :: (taskId -> runId -> name -> payload) -> Promise Nothing
queue.completeArtifact(taskId, runId, name, payload)
// queue.getArtifact :: (taskId -> runId -> name) -> Promise Nothing
queue.getArtifact(taskId, runId, name)
// queue.getLatestArtifact :: (taskId -> name) -> Promise Nothing
queue.getLatestArtifact(taskId, name)
// queue.listArtifacts :: (taskId -> runId -> [options]) -> Promise Result
queue.listArtifacts(taskId, runId)
queue.listArtifacts(taskId, runId, options)
// queue.listLatestArtifacts :: (taskId -> [options]) -> Promise Result
queue.listLatestArtifacts(taskId)
queue.listLatestArtifacts(taskId, options)
// queue.listProvisioners :: [options] -> Promise Result
queue.listProvisioners()
queue.listProvisioners(options)
// queue.getProvisioner :: provisionerId -> Promise Result
queue.getProvisioner(provisionerId)
// queue.declareProvisioner :: (provisionerId -> payload) -> Promise Result
queue.declareProvisioner(provisionerId, payload)
// queue.pendingTasks :: (provisionerId -> workerType) -> Promise Result
queue.pendingTasks(provisionerId, workerType)
// queue.listWorkerTypes :: (provisionerId -> [options]) -> Promise Result
queue.listWorkerTypes(provisionerId)
queue.listWorkerTypes(provisionerId, options)
// queue.getWorkerType :: (provisionerId -> workerType) -> Promise Result
queue.getWorkerType(provisionerId, workerType)
// queue.declareWorkerType :: (provisionerId -> workerType -> payload) -> Promise Result
queue.declareWorkerType(provisionerId, workerType, payload)
// queue.listWorkers :: (provisionerId -> workerType -> [options]) -> Promise Result
queue.listWorkers(provisionerId, workerType)
queue.listWorkers(provisionerId, workerType, options)
// queue.getWorker :: (provisionerId -> workerType -> workerGroup -> workerId) -> Promise Result
queue.getWorker(provisionerId, workerType, workerGroup, workerId)
// queue.quarantineWorker :: (provisionerId -> workerType -> workerGroup -> workerId -> payload) -> Promise Result
queue.quarantineWorker(provisionerId, workerType, workerGroup, workerId, payload)
// queue.declareWorker :: (provisionerId -> workerType -> workerGroup -> workerId -> payload) -> Promise Result
queue.declareWorker(provisionerId, workerType, workerGroup, workerId, payload)
// queue.ping :: () -> Promise Nothing
queue.ping()