Docs

Type a word or a question. Esc closes the search.

Sign in Start free

Take an action lock

Takes the lock for one handler run so that only one connected machine acts, or names the machine that holds it.

POST https://app.upfour.io/v1/runner/locks
POST https://app.upfour.io/v1/runner/locks

A real request. Sending it changes data in your upfour account.

Authorization
AuthorizationA pls_ key. It stays in this browser tab. Needs runner.report.write.
Body
kindrequired
More fields2
Headers

Sent directly from your browser to https://app.upfour.io/v1. Mutating calls get an automatic Idempotency-Key when the field is empty.

Request
Responsenot sent yet
Fill in a key and press Send request (⌘↵).
The answer appears here.
scope runner.report.write stable Idempotency-Key supported returns 200

Parameters

FieldTypeDescription
X-Up4-Runner-ID required uuid header parameter · Stable UUID of the runner.
X-Up4-Runner-Name required string length 1–64 header parameter · Printable runner name.

Body

application/json optional 7 fields

event_idstringrequired

The stream event that triggers the action.

handlerstringrequired

The handler name from the CLI configuration.

hold_msintegerrequired

How long the lock holds without an end: the handler timeout plus a margin. At most one day.

keystringrequired

Opaque lock key, 1 to 128 printable characters. The CLI derives it from the lock group, the client and the target host, so one disturbance locks once.

kindstringrequired
execforwardnotify
All other fields2 fields
client_iduuid · nullable

The incident's client, null at company level. The key must reach it.

incident_iduuid · nullable

The incident the action belongs to. If the machine stops mid-run, the incident history shows the outcome unknown here.

Returns

A successful request returns 200 with application/json.

Response fields 1 top-level fields
FieldTypeDescription
data RunnerLockView
RunnerLockView · 6 fields
FieldTypeDescription
acquired boolean True: run the action. False: another machine holds the lock until expires_at, or already ran this event; then expires_at is now or earlier.
expires_at string (date-time)
holder RunnerLockHolderView Only when not acquired: the machine that holds the lock or ran this event.
RunnerLockHolderView · 2 fields
FieldTypeDescription
name string
runner_id uuid
token uuid Only when acquired. Ends the run with POST /runner/locks/{token}/finish.

Errors

Only the errors this operation can return. Every error uses the same envelope.

Status Code Meaning
400 bad_request The request is malformed or fails validation.
404 not_found The requested resource does not exist or is outside the caller's scope.
503 service_unavailable The service or a required dependency is temporarily unavailable.
400 documented response A missing key, event_id or handler, an unknown kind, or a hold_ms that is not positive or exceeds one day.
404 documented response The client is outside this key's scope, or the machine in X-Up4-Runner-ID is not connected with this key.

Every call can also return unauthorized (401), rate_limit_exceeded (429) or internal_error (500 / 502). See Responses and errors.