Deployments
Preview

Claim a shared deployment

Takes a shared deployment nobody holds: it follows the branch asked for until the claim ends. The deployment is pointed at the branch and rendered. Answers 409 `deployment.claimed` when someone holds it, which the web app turns into a request to use it, 409 `share.not_shared` for a deployment that i

POST
/deployments/{deploymentId}/share/claims
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

deploymentId*string
Formatuuid
Idempotency-Key?string

Makes retries safe. A repeated key with the same request returns the first result and sets Idempotent-Replayed: true. The same key with a different request answers 409 idempotency.key_reused, and while the first request is still running 409 idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack of sign-in or permission are not kept, so a retry runs again.

Match^[A-Za-z0-9_.:-]+$
Length1 <= length <= 255
application/json
  1. body
branch*string

The branch the deployment follows while the claim lasts.

minutes*integer

How long, from 15 minutes up to the deployment's longest claim.

note?string
Lengthlength <= 280
resetFirst?boolean

Run the hand-over reset jobs before taking it, rather than keeping what the last holder left.

Response Body

The claim.

application/json
  1. response
id*string
Formatuuid
deploymentId*string
Formatuuid
holder*
branch*string
note*string
claimedAt*string
Formatdate-time
until*string
Formatdate-time
minutes*integer

The length first asked for, which an extension adds once.

extended*boolean
state*string
Value in"active""ended"
endedAt?string
Formatdate-time
endReason?string
Value in"released""expired""handed_over""taken_over""given_back"
endedBy?
reason?string

Why an admin took the deployment over.

resetFirst*boolean
migration?

What the migration check could tell, from file names in git and from the names of the jobs that run. not_checked says it could not look.

migrationKept?boolean

The holder chose to keep the database as it is.

handoverJobs?array<>

The hand-over jobs that ran during the claim, in the history.

Example Request
curl -X POST 'https://wardn.example.com/api/v1/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/share/claims' \  -H 'Content-Type: application/json' \  -d '{  "branch": "string",  "minutes": 0}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "deploymentId": "a73c85a1-d857-491e-a6b2-51dce05de7a2",  "holder": {    "id": "string",    "name": "string"  },  "branch": "string",  "note": "string",  "claimedAt": "2019-08-24T14:15:22Z",  "until": "2019-08-24T14:15:22Z",  "minutes": 0,  "extended": true,  "state": "active",  "endedAt": "2019-08-24T14:15:22Z",  "endReason": "released",  "endedBy": {    "id": "string",    "name": "string"  },  "reason": "string",  "resetFirst": true,  "migration": {    "state": "not_checked",    "apps": [      {        "appId": "string",        "appName": "string",        "state": "not_checked",        "folder": "string",        "onlyRunning": [          "string"        ],        "onlyIncoming": [          "string"        ],        "reason": "string"      }    ],    "jobs": [      "string"    ],    "statusJob": true,    "reason": "string"  },  "migrationKept": true,  "handoverJobs": [    {      "name": "string",      "succeeded": true    }  ]}