跳到主要内容

检查点:创建检查点

路由 URL​

POST https://playcanvas.com/api/checkpoints

说明​

启动为分支创建检查点的任务。检查点保存分支当前状态,以便以后恢复。

请求会立即返回任务详情。可以按 ID 轮询任务,直至状态为 complete 或 error。完成后,任务数据将包含创建的检查点。

示例​

curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"projectId": {projectId}, "branchId": "{branchId}", "description": "My checkpoint"}' "https://playcanvas.com/api/checkpoints"

HTTP 请求

POST https://playcanvas.com/api/checkpoints
Authorization: Bearer {accessToken}
Content-Type: application/json

{
"projectId": {projectId},
"branchId": "{branchId}",
"description": "My checkpoint"
}

参数​

名称类型必需说明
projectIdnumber✔️项目 ID。
branchIdstring✔️分支 ID。
descriptionstring✔️检查点描述,不能为空,且不得超过 10,000 个字符。

响应结构​

Status: 201 Created
{
"id": int,
"created_at": date,
"modified_at": date,
"status": "running" | "complete" | "error",
"messages": list of strings,
"data": {
"type": "checkpoint_create",
"project_id": int,
"branch_id": string,
"user_id": int,
"user": {
"id": int,
"fullName": string,
"username": string
},
"description": string
}
}

任务完成时,data 字段包含创建的检查点:

{
"id": string,
"user": {
"id": int,
"fullName": string,
"username": string
},
"createdAt": date,
"description": string
}

错误​

状态码说明
400请求无效
401未通过身份验证
403禁止访问
404未找到项目/分支
429请求过多

请求限流​

此路由采用普通限流。