跳转到内容
EN

Get the checkout credential of a running promotion

Code Mode: praxis.devops.promotions.checkoutCredential

HTTP: POST /devops/v1/promotions/{id}:checkoutCredential

Issue the credential the deploy machine fetches a platform-Git project’s code with. The caller is the deploy machine itself, during a run: its devops/prepare step sends the API key it already holds and receives the clone URL of the project’s repository plus a pull-only credential for exactly that one repository. The credential lives 15 minutes and is issued again on every request, so it never sits in the run’s stored input or log, and a leaked copy is useless almost at once. A run that needs the code later, such as an engine checkout after a long install, asks again. It answers only while the promotion is deploying (a rollback is a promotion and deploys too) or halted; a promotion that is queued, waiting for approval, observing or finished is refused with PROMOTION_NOT_RUNNING, because no machine should be fetching code for it. A project whose code is on GitHub is refused with SOURCE_NOT_PLATFORM: its checkout uses the GitHub App token, not this. The key must belong to the promotion’s organization, the same check as reading the promotion with praxis api devops promotion get <id>. People do not need this call: to read a platform project’s code use the code browser calls instead.

签名

praxis.devops.promotions.checkoutCredential(args:{path:{/** e.g. "prm_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string}}):Promise<{/** The https clone URL of the project's repository on the platform's Git. e.g. "https://registry.deepraxis.com/git/deepractice/praxis-beta/praxis.git" */ cloneUrl:string;/** The user name git sends with the password. e.g. "x-access-token" */ username:string;/** A secret: the pull credential. e.g. "cap_example" */ password:string;/** RFC 3339 UTC time the credential stops working, 15 minutes after it was issued. e.g. "2026-11-24T10:15:00Z" */ expireTime:string}>;

参数

名称位置类型必填说明
idpathstring是The promotion identifier returned by a promotion list or create answer.

响应

状态码内容类型说明
200application/jsonThe clone URL and a pull-only credential for that repository, valid until expireTime. Treat password as a secret: hand it to git through a credential helper and never print or store it.
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/jsonPROMOTION_NOT_FOUND means no promotion with that id exists in this organization; list the project’s promotions and use an id from that answer.
409application/jsonPROMOTION_NOT_RUNNING means the promotion is not in a state where a deploy machine runs, so there is nothing to fetch for; read the promotion to see its state. SOURCE_NOT_PLATFORM means the project’s code is on GitHub, which has no checkout credential from this call.
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.
502application/jsonREGISTRY_UNAVAILABLE means the platform’s Git registry would not issue a credential just now; the machine retries the request shortly.