Tasks

Inspecting and stopping individual running task replicas.

A task is one running replica of a deployment. If a deployment has replicas: 3, there are three tasks. Each has its own state and log stream.

State lifecycle: pendingstartingrunningstoppingstopped | failed

GET /api/v1/tasks — List all

Lists tasks across all deployments and apps on the platform.

GET /api/v1/tasks/ — Get task

Fetch a single task and its current state.

curl http://localhost:47080/api/v1/tasks/$TASK_ID
{
  "id": "uuid",
  "deployment_id": "uuid",
  "node_id": "uuid",
  "state": "running",
  "published_port": 48123,
  "created_at": "...",
  "updated_at": "..."
}

POST /api/v1/tasks//stop — Stop

Requests a graceful stop. The agent stops the task; the scheduler may reschedule it depending on the deployment's replica count.

curl -X POST http://localhost:47080/api/v1/tasks/$TASK_ID/stop

GET /api/v1/tasks//logs — Stored logs

Fetch stored log entries for this task.

curl http://localhost:47080/api/v1/tasks/$TASK_ID/logs | jq '.[] | .message'

POST /api/v1/tasks//logs — Append logs

Used by zectre-agent to write log entries. Not typically called directly.

GET /api/v1/deployments//tasks

List all tasks for a specific deployment — same response shape as /api/v1/tasks but filtered.

curl http://localhost:47080/api/v1/deployments/$DEPLOY_ID/tasks

See also