Update an environment
Code Mode: praxis.devops.environments.update
HTTP: PATCH /devops/v1/environments/{id}
Change an environment’s name, position, approval requirement, observation time, blocking behaviour or domain suffix. Send the new values inside environment and name the fields to write in updateMask (name, order, requireApproval, observeMinutes, blocksLater, domainSuffix); a field not named is left alone. requireApproval true makes every later promotion into this environment stop in awaiting_approval until promotions.approve lets it proceed; promotions already running are not stopped. order moves the environment within the promotion sequence and renumbers its neighbours, and a value that would break the 1..n sequence is refused with ENVIRONMENT_ORDER_INVALID. Read the environment list first to know what you are leaving unchanged.
签名
praxis.devops.environments.update(args:{path:{/** e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string};body:{/** The new values for the environment fields to change. */ environment:{/** New display name, unique within the project. e.g. "production" */ name?:string;/** New position in the promotion sequence, from 1 to the number of environments. e.g. 3 */ order?:number;/** True is not supported yet (approvals return as a step of the workflow engine): a promotion into an environment that requires approval is refused with ENGINE_UNS e.g. true */ requireApproval?:boolean;/** Kept for compatibility and no longer read (ticket-4240): promotions have no observation window, so a promotion ends when its deploy ends whatever this says. e.g. 60 */ observeMinutes?:number;/** Whether a failure here blocks promotion into the environments after it. e.g. true */ blocksLater?:boolean;/** Suffix such as -develop that this environment adds to site hostnames, or null for none. e.g. "-develop" */ domainSuffix?:string|null;/** Which stage of the path the environment belongs to: integration environments receive every merge, release environments receive promotions only. e.g. "integration" */ stage?:"integration"|"release"};/** Which environment fields to write, by name: name, order, requireApproval, observeMinutes, blocksLater, domainSuffix, stage. e.g. ["requireApproval"] */ updateMask?:Array<string>}}):Promise<{/** Environment identifier used when creating a promotion or a flag environment write. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** The resource type of this answer, always environment. */ object:"environment";/** RFC 3339 UTC time the environment was created. e.g. "2026-10-20T04:05:00Z" */ createTime:string;/** RFC 3339 UTC time the environment or its approval requirement last changed. e.g. "2026-10-28T02:00:00Z" */ updateTime:string;/** Canonical Console link for the project this environment belongs to. e.g. "https://console.deepraxis.com/devops/projects/dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ viewerUrl:string;/** The project this environment belongs to, from the project list. e.g. "dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ project:string;/** Display name of the environment, such as develop or production; a project chooses its own names. e.g. "production" */ name:string;/** What kind of environment this is, which decides how its failures are treated and how the Console presents it. e.g. "production" */ tier:"production"|"staging"|"testing"|"development"|"other";/** Which stage of the path this environment belongs to (Sean 2026-11-24: development, integration, release). e.g. "release" */ stage:"integration"|"release";/** Position in the promotion sequence, starting at 1 and contiguous. e.g. 3 */ order:number;/** Whether a promotion into this environment waits for an approval before it deploys; true is what puts a promotion in awaiting_approval. e.g. true */ requireApproval:boolean;queue:{/** Whether the environment is running a promotion right now; busy means a create will be queued behind the active one. e.g. "busy" */ state:"idle"|"busy";/** The promotion holding the queue, present only while state is busy; read it to see what the environment is doing. e.g. "prm_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ active?:string;/** How many promotions of the environment's own queue are in state queued; they run in the order they were created. e.g. 1 */ waiting:number}}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| id | path | string | 是 | The environment identifier from a project’s environment list; the tier or the display name is not an address. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json | A patch whose environment object holds only the fields to change, plus the update mask naming them. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The environment after the patch, with its queue 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 | ENVIRONMENT_NOT_FOUND means no environment with that id exists in this organization, or it belongs to another project; list the project’s environments and use an id from that answer. |
| 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. |