跳转到内容
EN

Unlock a target's OpenTofu state

Code Mode: praxis.devops.projects.environments.targets.state.deleteLock

HTTP: DELETE /devops/v1/projects/{project}/environments/{environment}/targets/{target}/state/lock

Release the lock on one target’s state; this is the DELETE that praxis devops deploy configures as OpenTofu’s unlock_method (the default UNLOCK verb on the state path works too). The lock ID is read from the lock info body, or from the ID query value. Releasing a lock that is not held succeeds; releasing it under a different ID answers 409 LOCK_CONFLICT.

签名

praxis.devops.projects.environments.targets.state.deleteLock(args:{path:{/** e.g. "dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ project:string;/** e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment:string;/** e.g. "services%2Fontology" */ target:string};query?:{/** e.g. "4c1f0a52-8f4e-9d6c-1b0e-5a7d3c2e9f10" */ ID?:string};body?:{/** Identifies the lock; every write and the unlock must carry it. e.g. "4c1f0a52-8f4e-9d6c-1b0e-5a7d3c2e9f10" */ ID:string;/** What the holder is doing, such as OperationTypeApply. e.g. "OperationTypeApply" */ Operation?:string;/** The holder, user@host, shown to the caller that finds the lock held. e.g. "ci@build-7" */ Who?:string;/** When the holder took the lock, RFC 3339. e.g. "2026-11-08T03:00:00Z" */ Created?:string;/** Where the holder keeps its working state, informational. e.g. "" */ Path?:string;[key:string]:unknown}}):Promise<unknown>;

参数

名称位置类型必填说明
projectpathstring是Identifies the project whose data you are reading, from the project list or create answer.
environmentpathstring是Identifies the DevOps environment (dve_…) whose deploy state you address, from the project’s environment list.
targetpathstring是The deploy target’s repository path, URL-encoded as one segment: services/ontology is written services%2Fontology.
IDquerystring否The ID of the lock this call holds, exactly as OpenTofu received it from the lock call. Required while a lock is held; a missing or different ID answers 409 LOCK_CONFLICT.

请求体

必填内容类型说明
否application/jsonThe lock info OpenTofu sends; only ID is read.

响应

状态码内容类型说明
200The lock is released, or was not held.
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.
404application/jsonNOT_FOUND means the project or environment does not exist for this organization, or, on a read, that the target has no state yet. Nothing is revealed about another organization’s projects. OpenTofu reads a missing state as empty.
409application/jsonLOCK_CONFLICT means the state is locked by another holder or the ID names a lock that is not held; STALE_SERIAL means the write is older than the stored state of the same lineage. Nothing changed; re-run the deploy so OpenTofu takes the lock and reads the current state.
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.