Cancel a promotion
Code Mode: praxis.devops.promotions.cancel
HTTP: POST /devops/v1/promotions/{id}:cancel
Stop a promotion that has not finished, moving it through cancelling to cancelled and stopping the deploys it had scheduled. Use it to halt a deployment that is failing or that should no longer continue; reason is recorded as the attribution of the stop. Cancelling does not undo what already deployed: an environment whose targets were written keeps those targets, and returning them to an earlier release is a separate rollback promotion. A promotion that already reached a terminal state is refused with PROMOTION_ALREADY_FINISHED rather than silently ignored.
签名
praxis.devops.promotions.cancel(args:{path:{/** e.g. "prm_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string};body:{/** Why the promotion is being cancelled, stored on it as the attribution of the act. e.g. "superseded by a newer release." */ reason:string}}):Promise<{/** Promotion identifier used by a cancel, approve, retry or conclude call, and by the rollouts it owns. e.g. "prm_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** The resource type of this answer, always promotion. */ object:"promotion";/** RFC 3339 UTC time the promotion was created; the promotion list is ordered by it, newest first. e.g. "2026-11-03T09:20:00Z" */ createTime:string;/** RFC 3339 UTC time the promotion last changed state — a deploy step, an approval, or a verdict. e.g. "2026-11-03T09:31:00Z" */ updateTime:string;/** Canonical Console link for the project this promotion belongs to. e.g. "https://console.deepraxis.com/devops/projects/dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ viewerUrl:string;/** The project this promotion belongs to, from the project list. e.g. "dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ project:string;/** The release this promotion is carrying, from a release list or create answer. e.g. "rls_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ release:string;/** The environment this promotion deploys into, from the project's environment list. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment:string;/** How this promotion came about; it decides which gates apply, so read it before judging a refusal. e.g. "regular" */ path:"regular"|"patch"|"targeted"|"rollback";/** Present, as skip, only on a forced express: a targeted promotion created with dependencies skip deployed exactly the targets it named and added nothing. e.g. "skip" */ dependencies?:"skip";/** On a forced express only: the targets the ordinary dependency order would have added to the plan and this promotion did not deploy, for the reviewer. */ skippedDependencies?:Array<string>;/** The exact version of the deploy engine (the published @deepraxis/cli) this promotion runs with. e.g. "0.6.0" */ engineVersion?:string;/** Which engine runs this promotion (ADR-190). e.g. "queue" */ releaseEngine?:"queue"|"workflow";/** The plan this promotion executes, or null for a promotion created before a plan was recorded. */ plan:null|{/** The targets grouped by deployment layer, each group deploying only after the one before it succeeded; read it to see the order a promotion implies. */ layers:Array<Array<string>>;/** Targets this promotion will not deploy, each with the reason; an empty list means every planned target runs. */ skipped:Array<{/** The target that will not deploy in this promotion. e.g. "tgt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ target:string;/** Why it is left out, which is what tells a deliberate skip apart from an oversight. e.g. "unchanged" */ reason:"unchanged"|"newer_checkpoint"|"not_requested"|"callee_excluded"|"not_deployed_upstream"|"artifact_identical"}>;/** Targets the plan pulled in because something it deploys depends on them, though they were not asked for; empty when nothing was added. */ addedDependencies:Array<string>;/** Database migrations the plan found pending for each target; a destructive one is refused rather than listed, so these are safe to apply. */ migrations:Array<{/** The target whose migrations are pending. e.g. "tgt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ target:string;/** The migration files to apply, in the order they run; the list is a prefix of the target's migration directory, never a reordering of it. */ files:Array<string>}>;/** Configuration keys each target requires but the environment does not hold; a promotion is refused while any remain, so a plan that names some cannot run. */ configMissing:Array<{/** The target whose configuration is incomplete. e.g. "tgt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ target:string;/** The missing keys, named as the target's own schema spells them; the values are never carried here, only the names. */ keys:Array<string>}>;/** Dependency cycles in the deploy graph, each a closed loop of target ids; a cycle is reported rather than refused, and an empty list means the graph is acyclic. */ cycles:Array<Array<string>>;/** How many upstream environments must have verified the release before this promotion may run; absent means the project's default of all. e.g. "all" */ availabilityStrategy?:"all"|"any";/** The rules that refuse this promotion, each with the code that names it; an empty list means the promotion may run. */ refusals:Array<{/** Which rule refused, which is the value a caller branches on; the remaining fields carry that rule's own evidence. e.g. "NOT_DEPLOYED_UPSTREAM" */ code:"PICK_NOT_ON_MAIN"|"PICK_NOT_ON_DEVELOP"|"PICK_ALREADY_IN_PRODUCTION"|"PICK_CONFLICT"|"PATCH_HAS_MIGRATION"|"PATCH_CHANGES_BINDING"|"PATCH_CHANGES_CONTRACT"|"BASE_NOT_UNIFORM"|"NOT_DEPLOYED_UPSTREAM"|"CONFIG_MISSING"|"MISSING_PATCH_PICKS"|"RELEASE_NOT_READY"|"RELEASE_ABANDONED"|"DEADLINE_EXCEEDED"|"EXECUTOR_UNAVAILABLE"|"FEATURE_NOT_SUPPORTED";/** The commit this refusal is about, present for the pick rules; it is the pick the request carried. e.g. "c8a9a1cf2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c" */ sha?:string;/** The target this refusal is about, present for the rules that judge one target rather than the promotion as a whole. e.g. "tgt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ target?:string;/** The files that make this refusal apply, present for the patch-eligibility rules; they are what a person reads to decide whether it really is a patch. */ files?:Array<string>;/** The targets this refusal is about, present for the rules that judge a set of them, such as a non-uniform production base. */ targets?:Array<string>;/** The environment this refusal is about, present for the upstream-verification rule. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment?:string;/** The configuration keys this refusal is about, present for the missing-configuration rule; only the names are carried. */ keys?:Array<string>;/** The picks this refusal is about, present for the missing-picks rule. */ picks?:Array<string>;/** The render state the release is in, present for the release-not-ready rule. e.g. "in_progress" */ state?:"unspecified"|"in_progress"|"succeeded"|"failed";/** The release this refusal is about, present for the abandoned-release rule. e.g. "rls_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ release?:string;/** The executor that was unavailable, present for the executor-unavailable rule; the name is what support needs. e.g. "workers-builds" */ executor?:string;/** The feature the promotion asked for and the target does not support, present for the feature-not-supported rule. e.g. "canary" */ feature?:string}>};/** Where the promotion stands, which is the value a caller polls on; a terminal value never moves again. e.g. "observing" */ state:"queued"|"pending_release"|"awaiting_approval"|"deploying"|"verifying"|"observing"|"halted"|"cancelling"|"succeeded"|"failed"|"errored"|"approval_rejected"|"cancelled"|"superseded";/** The executor's own sentence about the current state, present while it is running and after it stops; it carries detail the state value cannot. e.g. "waiting for prm_01JQ8Z3M9K4V7B2N6C5X0YTRHW (observing until 2026-11-24T09:00:00Z; conclude it to release the environment)" */ stateDescription?:string;/** Only on promotions.retrieve, and only once a rollout has ended: what the rollouts really did. */ summary?:{/** Targets that were built and deployed. e.g. 2 */ deployed?:number;/** Targets skipped as artifact_identical: the built artifact is byte-for-byte what the environment already runs, as when the change was only a comment, so nothing e.g. 1 */ identical?:number;/** Targets whose rollout ended any other way (failed, cancelled, skipped for another reason). e.g. 0 */ other?:number};/** Present and true only on the answer to a validateOnly call: nothing was stored, id is the placeholder prm_validate_only and state is the one a real call would s e.g. true */ validateOnly?:boolean;approval:{/** Where the approval stands; needed is what keeps a promotion in awaiting_approval. e.g. "approved" */ state:"unspecified"|"not_needed"|"needed"|"approved"|"rejected";by?:{/** What sort of actor this is, which decides how the id should be read. e.g. "user" */ kind:"user"|"agent"|"system";/** Identifier of the actor within its kind, such as a user id for a person. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Display name for the actor at the time, so a record reads the way it did when it was written; absent when none was known. e.g. "Sean" */ label?:string};/** RFC 3339 UTC time the approval was decided; absent while it is still needed. e.g. "2026-11-03T09:22:00Z" */ time?:string;/** What the approver said when deciding, recorded verbatim; absent when they left none. e.g. "shipping the router memory fix." */ comment?:string};/** RFC 3339 UTC time the approval was decided; absent while it is still needed or was never required. e.g. "2026-11-03T09:22:00Z" */ approveTime?:string;/** The gates this promotion was allowed to skip, each with the approval that authorized it; absent when nothing was skipped. */ bypass?:Array<{/** The action the override applies to, so a bypass covers one act rather than the promotion as a whole. e.g. "create" */ action:"advance"|"approve"|"cancel"|"create"|"ignore_job"|"retry_job"|"rollback"|"terminate_jobrun";/** The gates that were skipped; each must be covered by the named approval, or the bypass is refused. */ gates:Array<"upstream_verified"|"approval"|"freeze">;/** Why the gate was skipped, recorded verbatim on the promotion; an incident reference is what makes this readable later. e.g. "incident-2026-11-03, production hotfix." */ reason:string;/** The recorded approval that authorized this bypass, from an approval create; an id that does not cover this release, environment and gate is refused. e.g. "apv_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ approval:string;/** The policies this bypass overrode, when the evaluation named them; absent when the override is unconditional. */ overriddenPolicies?:Array<string>}>;/** The verification attempts made on this promotion, newest last; absent before the first one started. */ verification?:Array<{/** Identifier of this verification attempt, so a retry can be told apart from the first try in the same list. e.g. "vrf_9f2b1c0d8e7a6b5c4d3e2f1a0b9c8d7e" */ id:string;/** Who or what ran the verification, such as the platform or an external check; the value is a name, not an actor id. e.g. "praxis-verify" */ actor:string;/** RFC 3339 UTC time the attempt started; absent before it started. e.g. "2026-11-03T09:27:00Z" */ startTime?:string;/** RFC 3339 UTC time the attempt finished; absent while it is still running. e.g. "2026-11-03T09:29:30Z" */ finishTime?:string;/** Where this attempt stands; inconclusive is a finished attempt whose result cannot be read as a pass or a failure. e.g. "successful" */ phase:"pending"|"running"|"successful"|"failed"|"error"|"aborted"|"inconclusive";/** The verifier's own sentence about this attempt, present when it has something to say beyond the phase. e.g. "4 checks passed." */ message?:string;/** The test runs that carried this verification out, when it used the platform's own runs; absent when the check was external. */ runs?:Array<string>;/** The verification's own verdict, present once it finished; it is the value a gate reads. e.g. "passed" */ result?:"pending"|"passed"|"failed"|"errored"|"cancelled"|"timed_out"}>;observation?:{/** How the deployment is doing during the window; unhealthy is what makes a rollback verdict the expected one. e.g. "healthy" */ state:"not_applicable"|"progressing"|"unknown"|"healthy"|"unhealthy";/** RFC 3339 UTC time the window opened, which is when the deploy finished. e.g. "2026-11-03T09:30:40Z" */ startTime:string;/** RFC 3339 UTC time the window closes, computed from the project's observation window length; reaching it does not conclude the promotion, it makes a verdict poss e.g. "2026-11-03T10:30:40Z" */ until:string;/** What is being watched during the window, one entry per signal; an empty list means nothing reported yet. */ signals:Array<{/** Which sort of signal this is; test_run means the entry carries a run. */ kind:"test_run";/** The test run being watched, from a run list or the run create answer. e.g. "trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ run:string;/** That run's verdict, which is what the window reads as its signal. e.g. "passed" */ result:"pending"|"passed"|"failed"|"errored"|"cancelled"|"timed_out";/** RFC 3339 UTC time the result was recorded, which orders the signals in the window. e.g. "2026-11-03T09:45:00Z" */ time:string}|{/** Which sort of signal this is; alert means the entry carries a monitoring alert. */ kind:"alert";/** Name of the alert that fired, as the monitoring source spells it. e.g. "high-error-rate" */ alert:string;/** How serious the alert is, in the monitoring source's own vocabulary. e.g. "critical" */ severity:string;/** Identifier of the check that failed, present when the source names one; it is what a person follows to the underlying rule. e.g. "chk_9f2b1c0d" */ checkId?:string;/** RFC 3339 UTC time the alert fired. e.g. "2026-11-03T09:44:00Z" */ time:string}>;/** The thresholds this window is judged against, as the project configured them; absent when the defaults applied. e.g. {"maxErrorRateDelta":0.01} */ config?:{[key:string]:unknown};/** What is wrong, present when the state is not healthy; each entry names a signal that is outside its threshold. */ issues?:Array<string>;verdict?:{by:{/** What sort of actor this is, which decides how the id should be read. e.g. "user" */ kind:"user"|"agent"|"system";/** Identifier of the actor within its kind, such as a user id for a person. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Display name for the actor at the time, so a record reads the way it did when it was written; absent when none was known. e.g. "Sean" */ label?:string};/** RFC 3339 UTC time the verdict was recorded. e.g. "2026-11-03T10:05:00Z" */ time:string;/** Which way the window was decided; keep accepts what is running and rollback closes it as unhealthy. e.g. "keep" */ action:"keep"|"rollback";/** Why the verdict went that way, recorded verbatim; it is the attribution an observation window exists to produce. e.g. "error rate back to baseline and the new memory profile holds." */ reason:string}};executor?:{/** The executor run carrying the promotion out, which is the one to look up when the promotion stops unexpectedly. e.g. "run_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ promoteRun?:string;/** Executor runs that advanced this promotion to a later phase, in the order they ran; absent when nothing has been advanced. */ advanceRuns?:Array<string>;/** Executor runs that repaired this promotion after a failure, such as a retried job. */ repairRuns?:Array<string>;/** The repair run in flight right now; absent when no repair is running. e.g. "run_01JQ8Z3M9K4V7B2N6C5X0YTRHZ" */ activeRepairRun?:string;/** Identifier of the build the promotion deploys, as the build system names it. e.g. "build_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ buildRef?:string;/** RFC 3339 UTC time the executor is waiting until, which is how a wait is distinguished from a stall. e.g. "2026-11-03T10:30:40Z" */ waitUntilTime?:string;/** RFC 3339 UTC time the run must have finished by; passing it means the run is treated as lost rather than looked for. e.g. "2026-11-03T11:00:00Z" */ expireTime?:string;/** Policies this promotion violated, each naming the rule; present when a policy refused or gated the work. */ policyViolations?:Array<{/** Name of the policy that was violated, as the delivery policy system spells it. e.g. "deploy-freeze" */ policy:string;/** Identifier of the rule inside that policy; a policy can hold several rules and this names the one that failed. e.g. "no-deploy-friday" */ ruleId:string;/** Why the rule failed, in the policy system's own words. e.g. "deployments are frozen after 15:00 on Fridays." */ failureMessage:string}>};/** The lane the promotion runs in, read-only. e.g. "async" */ lane?:"main"|"async";/** The promotion that replaced this one, present only when state is superseded; read it to follow the work to where it went. e.g. "prm_01JQ8Z3M9K4V7B2N6C5X0YTRHX" */ supersededBy?:string;/** The promotion this one is rolling back, present only for a rollback promotion. e.g. "prm_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ rollbackOf?:string;failure?:{/** The category of the failure, which is the value a caller branches on; the executor's own cause is carried alongside it. e.g. "verification_failed" */ cause:"plan_refused"|"render_failed"|"migration_failed"|"config_gate_failed"|"deploy_failed"|"verification_failed"|"observation_failed"|"execution_failed"|"executor_unavailable"|"deadline_exceeded"|"lost"|"approval_rejected"|"release_abandoned"|"feature_not_supported";/** The deploy-level cause the executor reported, present when the failure happened during a deploy job; it is finer-grained than cause. e.g. "execution_failed" */ deployFailureCause?:"execution_failed"|"executor_unavailable"|"deadline_exceeded"|"release_failed"|"release_abandoned"|"verification_config_not_found"|"request_failed"|"feature_not_supported";/** The executor's own sentence about the failure, stored verbatim; it is what a person reads first. e.g. "health check /healthz answered 503 for two minutes." */ message:string;/** The target the failure happened on, present when it is one target rather than the promotion as a whole. e.g. "tgt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ target?:string};/** RFC 3339 UTC time it entered the environment's queue, which is separate from when it started deploying. e.g. "2026-11-03T09:20:05Z" */ enqueueTime?:string;/** RFC 3339 UTC time the deploy began; absent while it is still queued or waiting for approval. e.g. "2026-11-03T09:26:00Z" */ startTime?:string;/** RFC 3339 UTC time the deploy stopped, whether it succeeded or failed; absent while it is still running. e.g. "2026-11-03T09:30:40Z" */ endTime?:string;requestedBy:{/** What sort of actor this is, which decides how the id should be read. e.g. "user" */ kind:"user"|"agent"|"system";/** Identifier of the actor within its kind, such as a user id for a person. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Display name for the actor at the time, so a record reads the way it did when it was written; absent when none was known. e.g. "Sean" */ label?:string}}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| id | path | string | 是 | The promotion identifier returned by a promotion list or create answer. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The promotion after the cancellation was accepted, in cancelling or cancelled state. |
| 400 | application/json | INVALID_PARAMS or INVALID_ARGUMENT means a field, query value or identifier violates the documented format or range — an unknown enum value, a pageSize outside 1..100, an unsupported filter or orderBy field, or an id with the wrong prefix. Correct the named input; nothing was read or written. |
| 401 | application/json | The API key is missing or invalid; send a valid Praxis API key in the Authorization header before retrying. |
| 403 | application/json | The credential carries no organization, or that organization cannot reach this project; use a key belonging to the project’s organization. No cross-organization read is possible. |
| 404 | application/json | PROMOTION_NOT_FOUND means no promotion with that id exists in this organization; list the project’s promotions and use an id from that answer. |
| 409 | application/json | PROMOTION_ALREADY_FINISHED means the promotion already ended — succeeded, failed, cancelled or superseded — so there is nothing left to stop. Read it to see how it ended; a finished deployment is reverted by a rollback promotion, not by cancelling. |
| 500 | application/json | INTERNAL means the service could not complete the request; retry once, and if it repeats report the request id. A read is safe to repeat; a write that failed this way should be re-read before it is sent again. |