Tasks

A task is the lowest unit of execution for a pipeline. A task execution is the tracking of a task, which is to say a task execution is simply the tracking of the container that is in the act of being executed.


List all task executions

GET/api/namespaces/{namespace_id}/pipelines/{pipeline_id}/runs/{run_id}/tasks

Returns a list of all task executions by run.

Path parameters

NameTypeRequiredDescription
namespace_idstringyesThe unique identifier for the target namespace.
pipeline_idstringyesThe unique identifier for the target pipeline.
run_idintegeryesThe unique identifier for the target run.

Query parameters

NameTypeRequiredDescription
include_secretbooleannoReturn credentials in plaintext instead of redacted. Admin only.

Responses

StatusBodyDescription
200ListTaskExecutionsResponsesuccessful operation
4XXErrorError
5XXErrorError

Get task execution by id

GET/api/namespaces/{namespace_id}/pipelines/{pipeline_id}/runs/{run_id}/tasks/{task_id}

Path parameters

NameTypeRequiredDescription
namespace_idstringyesThe unique identifier for the target namespace.
pipeline_idstringyesThe unique identifier for the target pipeline.
run_idintegeryesThe unique identifier for the target run.
task_idstringyesThe unique identifier for the target task execution.

Query parameters

NameTypeRequiredDescription
include_secretbooleannoReturn credentials in plaintext instead of redacted. Admin only.

Responses

StatusBodyDescription
200GetTaskExecutionResponsesuccessful operation
4XXErrorError
5XXErrorError

Cancel a task execution by id

DELETE/api/namespaces/{namespace_id}/pipelines/{pipeline_id}/runs/{run_id}/tasks/{task_id}

Path parameters

NameTypeRequiredDescription
namespace_idstringyesThe unique identifier for the target namespace.
pipeline_idstringyesThe unique identifier for the target pipeline.
run_idintegeryesThe unique identifier for the target run.
task_idstringyesThe unique identifier for the target task execution.

Query parameters

NameTypeRequiredDescription
wait_forintegeryesPeriod of time to wait the task before forcing it to cancel. 0 means send SIGKILL instantly.

Responses

StatusBodyDescription
204nonesuccessful deletion
4XXErrorError
5XXErrorError

Run command on a running task execution container

WS/api/namespaces/{namespace_id}/pipelines/{pipeline_id}/runs/{run_id}/tasks/{task_id}/attach

This allows you to run a command on a task execution container and connect to the stdin and stdout/err for said container.

Useful for debugging.

This endpoint upgrades the connection to a websocket: after the 101 response the server streams data over the socket instead of returning a body.

Path parameters

NameTypeRequiredDescription
namespace_idstringyesThe unique identifier for the target namespace.
pipeline_idstringyesThe unique identifier for the target pipeline.
run_idintegeryesThe unique identifier for the target run.
task_idstringyesThe unique identifier for the target task execution.

Query parameters

NameTypeRequiredDescription
commandstringyes

Responses

StatusBodyDescription
101noneNegotiating protocol upgrade from HTTP/1.1 to WebSocket
4XXErrorError
5XXErrorError

Retrieves logs from a task execution

WS/api/namespaces/{namespace_id}/pipelines/{pipeline_id}/runs/{run_id}/tasks/{task_id}/logs

This endpoint upgrades the connection to a websocket: after the 101 response the server streams data over the socket instead of returning a body.

Path parameters

NameTypeRequiredDescription
namespace_idstringyesThe unique identifier for the target namespace.
pipeline_idstringyesThe unique identifier for the target pipeline.
run_idintegeryesThe unique identifier for the target run.
task_idstringyesThe unique identifier for the target task execution.

Query parameters

NameTypeRequiredDescription
tailintegernoOnly send this many lines from the end of the log, then keep following it if the task is still running. Leave it out to get the whole log.

Responses

StatusBodyDescription
101noneNegotiating protocol upgrade from HTTP/1.1 to WebSocket
4XXErrorError
5XXErrorError

Removes a task execution's associated log object

DELETE/api/namespaces/{namespace_id}/pipelines/{pipeline_id}/runs/{run_id}/tasks/{task_id}/logs

This is useful for if logs mistakenly contain sensitive data.

Path parameters

NameTypeRequiredDescription
namespace_idstringyesThe unique identifier for the target namespace.
pipeline_idstringyesThe unique identifier for the target pipeline.
run_idintegeryesThe unique identifier for the target run.
task_idstringyesThe unique identifier for the target task execution.

Responses

StatusBodyDescription
204nonesuccessful deletion
4XXErrorError
5XXErrorError