跳转到内容
EN

Update a stage workspace

Code Mode: praxis.devops.projects.workspaces.update

HTTP: PATCH /devops/v1/projects/{project}/workspaces/{stage}

Change how a stage’s units are built and how long they live. Send the values to change inside workspace and name each one in updateMask; a field present in workspace but absent from the mask is left alone, and a mask naming a field this operation cannot change is refused with INVALID_ARGUMENT rather than ignored. Only machine.size, idleTimeoutMinutes, retentionDays, prebuild.enabled and vaults can be changed: idleTimeoutMinutes is 5 to 240 minutes, retentionDays is 1 to 30 days, and a value outside its range is refused. The change applies to the units created afterwards; a machine already running keeps the class it was created with. vaults binds the vaults (by id, at most 10) whose secrets a development unit’s machine takes as runtime environment variables the moment the machine is created; binding on the integration or runtime workspace is refused with INVALID_ARGUMENT, because those units are deployment machines and take no credentials, and every vault must exist in this organization. Values never travel through this API: a machine keeps the environment it was created with, so a changed secret takes effect once the unit is deleted and opened again.

签名

praxis.devops.projects.workspaces.update(args:{path:{/** e.g. "dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ project:string;stage:"development"|"integration"|"release"};body:{/** The fields to write, each named as in the workspace object: machine.size, idleTimeoutMinutes, retentionDays, prebuild.enabled or vaults. */ updateMask:Array<string>;workspace:{/** The machine class new units of this stage are created at; only size is read. */ machine?:{size?:"small"|"medium"|"large"|"xlarge"};/** New inactivity timeout in minutes, 5 to 240; a value outside that range is refused. e.g. 60 */ idleTimeoutMinutes?:number;/** New retention in days, 1 to 30; a value outside that range is refused. e.g. 14 */ retentionDays?:number;/** Whether this stage builds a prebuild ahead of time; only enabled is read. */ prebuild?:{/** New value for whether units of this stage start from a ready prebuild. e.g. true */ enabled?:boolean};/** The vaults (by vault id, at most 10) this stage's units take their runtime environment from. */ vaults?:Array<string>}}}):Promise<{/** The workspace identifier, one per (project, stage); a unit records the workspace it was created from. e.g. "wks_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** The resource type of this answer, always workspace. */ object:"workspace";/** RFC 3339 UTC time this stage's row was first written; the three rows are returned in stage order, not by this time. e.g. "2026-11-11T09:00:00Z" */ createTime:string;/** RFC 3339 UTC time this row last changed; an update changes only this and the masked fields. e.g. "2026-11-11T09:30:00Z" */ updateTime:string;/** Canonical Console link for this stage's workspace; use it in a message so a person can open the same row. e.g. "https://console.deepraxis.com/devops/dvp_01m6j8swzteapw2j5sh4/workspaces/development" */ viewerUrl:string;/** The project this workspace belongs to, from the project list. e.g. "dvp_01m6j8swzteapw2j5sh4" */ project:string;stage:"development"|"integration"|"release";/** Whether units of this stage are kept across sessions or are one-off. e.g. "persistent" */ unitClass:"persistent"|"ephemeral";machine:{size:"small"|"medium"|"large"|"xlarge"};prebuild:{/** Whether a unit of this stage starts from a ready prebuild instead of building the machine image itself; off means every unit builds its own, which costs time on e.g. true */ enabled:boolean;/** The prebuild a new unit of this stage would start from, or null when none is ready yet; null means units fall back to the base template. e.g. null */ current:string|null};/** Minutes of inactivity after which a persistent unit of this stage is paused, 5 to 240; the default is 30. e.g. 30 */ idleTimeoutMinutes:number;/** Days a stopped unit of this stage is kept before it is destroyed, 1 to 30; the default is 7. e.g. 7 */ retentionDays:number;/** The vaults this stage's units take their runtime environment from, by vault id (vlt_…). */ vaults:Array<string>}>;

参数

名称位置类型必填说明
projectpathstring是Identifies the project whose data you are reading, from the project list or create answer.
stagepath“development” | “integration” | “release”是The stage whose workspace you address: development, integration or release. development is the persistent stage that carries changes; integration and release hold one-off units.

请求体

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

响应

状态码内容类型说明
200application/jsonThe workspace after the update, with only the masked fields changed.
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/jsonPROJECT_NOT_FOUND means no project with that id is visible to this organization; list the projects and use an id from that answer. WORKSPACE_NOT_FOUND means the project exists but the addressed stage has no row, which happens only if its configuration rows were removed; list the project’s workspaces to see the three stages.
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.