Shotstash
API referenceREST referencePipeline

Register a worker

Exchanges the shared bootstrap token for a per-worker token (shown once). The manifest names the worker and its version and the kinds it processes and the contract major (1).

Try the REST routes against the public demo at https://demostash.aldyernesto.my.id. Get a read-only token (valid for 60 minutes), then paste it as the Bearer token in the console of any route.

POST
/api/v1/pipeline/workers/register

Exchanges the shared bootstrap token for a per-worker token (shown once). The manifest names the worker and its version and the kinds it processes and the contract major (1).

Authorization

WorkerBootstrapToken
headerX-Worker-Bootstrap-Token<token>

The shared WORKER_BOOTSTRAP_TOKEN of the instance; accepted by worker registration only.

Request Body

application/json
  1. body
manifest*

What the worker is and does.

Response Body

Worker registered

application/json
  1. response
workerId*string

Id of the new worker.

token*string

Per-worker token for X-Worker-Token. Shown once; keep it.

contract*number

Contract major of the server (1).

heartbeatSeconds*number

Send a heartbeat this often (seconds).

leaseSeconds*number

A claim without a heartbeat for this long is requeued (seconds).

curl -X POST "https://example.com/api/v1/pipeline/workers/register" \  -H "Content-Type: application/json" \  -d '{    "manifest": {      "name": "string",      "version": "string",      "kinds": [        "string"      ],      "contract": 0    }  }'
{  "workerId": "string",  "token": "string",  "contract": 0,  "heartbeatSeconds": 0,  "leaseSeconds": 0}