跳转到内容
EN

Create a progressive rollout

Code Mode: praxis.devops.progressiveRollouts.create

HTTP: POST /devops/v1/progressive-rollouts

Start a staged rollout of one variation of a flag in one environment: the steps are percentages with a hold time each, and the guard says which signals are watched and whether a bad reading pauses the rollout or rolls it back. Use it instead of turning a flag fully on, so a bad variation is caught at a small percentage. bucketBy names the context attribute that decides which bucket a caller falls into, so the same caller stays in the same bucket across steps. One progressive rollout runs per flag and environment; a second one while the first is active is refused with ROLLOUT_ALREADY_ACTIVE.

签名

praxis.devops.progressiveRollouts.create(args:{body:{/** The flag to ramp; it must not be archived, its environment must already be on, and its configuration must exist there. e.g. "flg_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ flag:string;/** The environment to ramp in; the flag must be on there already, because ramping an off environment would serve nobody. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment:string;/** The variation to ramp up; it must be one of the flag's variations and must not be the off variation, which is what the rest of the callers already get. e.g. "on" */ variation:string;/** Which context attribute decides a caller's bucket; omit it to bucket by the targeting key, which keeps one caller on one side. e.g. "targetingKey" */ bucketBy?:string;/** The steps to walk, at least one; percentages must be whole numbers from 0 to 100 that never decrease, and the first step takes effect immediately. */ steps:Array<{/** The share of callers served the variation at this step, as a whole percentage; the steps must not decrease. e.g. 25 */ percent:number;/** How many minutes this step is held before the next one starts; a hold of zero moves on immediately, which leaves no time to watch it. e.g. 60 */ holdMinutes:number}>;guard:{/** The signals watched between steps; only test_runs can actually be evaluated today, and alerts or error_rate are refused at create time rather than accepted and */ signals:Array<"test_runs"|"alerts"|"error_rate">;/** What a bad reading does to the rollout; pausing leaves the decision to a person, while rollback acts on its own. e.g. "pause" */ onBad:"pause"|"rollback";/** How far above its baseline the error rate may go before the reading counts as bad; give it when an error rate is watched. e.g. 0.01 */ errorRateDelta?:number}}}):Promise<{/** Progressive rollout identifier used by the pause, resume and rollback calls. e.g. "prr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** The resource type of this answer, always progressive_rollout. */ object:"progressive_rollout";/** RFC 3339 UTC time the rollout was created; it starts running at its first step immediately. e.g. "2026-11-03T09:00:00Z" */ createTime:string;/** RFC 3339 UTC time the rollout last moved, which is when a step advanced or an operator acted on it. e.g. "2026-11-03T15:00:00Z" */ updateTime:string;/** Canonical Console link for the project the flag belongs to. e.g. "https://console.deepraxis.com/devops/projects/dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ viewerUrl:string;/** The flag being ramped, from a flag list or create answer. e.g. "flg_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ flag:string;/** The environment being ramped; the flag must already be on there, because a rollout ramps a fallthrough and an off environment serves nobody. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment:string;/** The variation being ramped up; the rest of the callers keep getting the variation the environment served before the rollout started. e.g. "on" */ variation:string;/** Which context attribute decides a caller's bucket; it is fixed for the whole rollout, so a caller stays on the same side as the share widens. e.g. "targetingKey" */ bucketBy:string;/** The percentage steps this rollout walks, in order; each holds for its own time before the next one starts. */ steps:Array<{/** The share of callers served the variation at this step, as a whole percentage; the steps must not decrease. e.g. 25 */ percent:number;/** How many minutes this step is held before the next one starts; a hold of zero moves on immediately, which leaves no time to watch it. e.g. 60 */ holdMinutes:number}>;guard:{/** The signals watched between steps; only test_runs can actually be evaluated today, and alerts or error_rate are refused at create time rather than accepted and */ signals:Array<"test_runs"|"alerts"|"error_rate">;/** What a bad reading does to the rollout; pausing leaves the decision to a person, while rollback acts on its own. e.g. "pause" */ onBad:"pause"|"rollback";/** How far above its baseline the error rate may go before the reading counts as bad; give it when an error rate is watched. e.g. 0.01 */ errorRateDelta?:number};/** Where the rollout stands; paused is a state an operator put it in or a bad signal did, and both can be resumed or rolled back. e.g. "running" */ state:"scheduled"|"running"|"paused"|"completed"|"rolled_back";/** Index of the step in effect, counting from zero; read steps with it to see the percentage currently served. e.g. 1 */ currentStep:number;/** RFC 3339 UTC time the next step starts, absent while the rollout is paused or finished. e.g. "2026-11-03T16:00:00Z" */ nextStepTime?:string;/** Every move this rollout made, oldest first, each with who made it and why; an empty list means it has not moved since it started. */ history:Array<{/** RFC 3339 UTC time the move happened, which orders the history. e.g. "2026-11-03T15:00:00Z" */ time:string;/** The step index in effect after the move, counting from zero. e.g. 2 */ step:number;/** The share of callers served the variation after the move, as a whole percentage. e.g. 50 */ percent:number;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};/** Why the move happened, present for a move an operator made or a guard forced; absent for the scheduled advance. e.g. "guard paused the rollout: a test run failed." */ reason?:string}>}>;

请求体

必填内容类型说明
是application/json

响应

状态码内容类型说明
200application/jsonThe created progressive rollout, scheduled at its first step.
400application/jsonINVALID_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.
401application/jsonThe API key is missing or invalid; send a valid Praxis API key in the Authorization header before retrying.
403application/jsonThe 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.
404application/jsonFLAG_NOT_FOUND means no flag with that id exists in this organization; list the project’s flags and use an id from that answer. An archived flag is still readable by id — it is the list that hides it.
409application/jsonROLLOUT_ALREADY_ACTIVE means this flag already has a running progressive rollout in that environment; pause or conclude the running one first. ROLLOUT_WEIGHTS_INVALID means a step percentage is outside 0..100 or the steps are not increasing.
500application/jsonINTERNAL 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.