Save an edit as a new version
Replaces the graph and saves it as the next version. `expectedVersion` is the version the edit was made on; a pipeline that has moved on answers 409 `pipeline.version_conflict` with `currentVersion`. Runs under way keep the version they started on unless the pipeline's settings say they move. Stages
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
pipelineId*stringuuidIdempotency-Key?stringMakes 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.
^[A-Za-z0-9_.:-]+$1 <= length <= 255application/json- body
expectedVersion*integer1 <= valuesummary?stringWhat changed, in a sentence.
length <= 200graph*The pipeline at its new version.
application/json- response
canSkipReview*booleanThe caller's changes to this pipeline apply at once, without a review.
id*stringuuidname*stringdescription*stringteamId*stringarchived*booleanversion*The version the graph is of.
newestVersion?integerThe pipeline's newest version, which differs from version.version when an old one was asked for.
graph*apps*array<>runCounts*runTotal*integerEvery run the pipeline has had.
hasHotfix*booleancreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X PUT 'https://wardn.example.com/api/v1/pipelines/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{ "expectedVersion": 1, "graph": { "stages": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563", "arrival": "auto_promote" } ], "routes": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "fromStageId": "877db427-5907-4b80-a8b2-ab6c3e6f1fc9", "toStageId": "ccc70001-c375-49a1-b702-44689ce3757f", "kind": "main" } ] }}'{ "canSkipReview": true, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "teamId": "string", "archived": true, "version": { "version": 0, "summary": "string", "createdBy": { "id": "string", "name": "string" }, "appliedRole": "string", "draftNumber": 0, "appliedWithoutReview": true, "reviewedBy": { "id": "string", "name": "string" }, "restoredFrom": 0, "createdAt": "2019-08-24T14:15:22Z" }, "newestVersion": 0, "graph": { "stages": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563", "arrival": "auto_promote", "soakSeconds": 0, "config": { "which": "qualified", "ifSeveral": "replace", "allowRequests": true, "configOnly": true, "incoming": "all", "narrow": [ { "field": "cluster", "op": "is", "value": "string" } ], "rules": [ { "id": "string", "type": "approval", "section": "gate", "title": "string", "note": "string", "locked": true, "params": {} } ], "onReject": "keep", "onQualify": "notify", "notifyTarget": "string", "rollout": { "mode": "all", "waves": [ { "id": "string", "name": "string", "detail": "string", "targets": "string", "verify": "string", "next": "confirm", "soakSeconds": 0, "selector": { "property1": "string", "property2": "string" } } ], "onFail": "pause", "retries": "2", "timeout": "15m" }, "health": { "watchSeconds": 0, "onFail": "pause" }, "requestForm": "string", "agents": { "autonomy": "observe", "cap": "observe", "perHour": 0, "may": { "property1": true, "property2": true }, "read": { "mode": "off", "agentId": "string" } }, "preset": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "version": 1 } }, "position": 0, "environmentName": "string", "environmentClass": "string" } ], "routes": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "fromStageId": "877db427-5907-4b80-a8b2-ab6c3e6f1fc9", "toStageId": "ccc70001-c375-49a1-b702-44689ce3757f", "kind": "main", "must": "qualified", "label": "string" } ] }, "apps": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "runCounts": { "inProgress": 0, "waiting": 0, "landed": 0, "rejected": 0 }, "runTotal": 0, "hasHotfix": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Get a pipeline GET
The pipeline with the graph of one version: the newest unless `version` names another. Reading an old version is how a run's own version, a diff or a restore finds what was saved.
List the changes made to a pipeline that needed a review GET
The drafts of the pipeline, newest first, at most 50, so the list is not paged; `state` keeps one state. A draft is an edit that the pipeline's settings said needs a review before it becomes a version.