跳转到主要内容
POST
/
v2
/
enterprise
/
organizations
/
{org_id}
/
clone
克隆仓库
curl --request POST \
  --url https://api.devin.ai/v2/enterprise/organizations/{org_id}/clone \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "repo_path": "<string>",
  "pull_repo_commands": [
    "<string>"
  ],
  "repo_note": "<string>",
  "run_lint_commands": [
    "<string>"
  ],
  "run_project_commands": [
    "<string>"
  ],
  "run_tests_commands": [
    "<string>"
  ],
  "update_dependencies_commands": [
    "<string>"
  ]
}
'
{
  "created_at": "2023-11-07T05:31:56Z",
  "org_id": "<string>",
  "snapshot_id": "<string>",
  "status": "<string>",
  "ami_id": "<string>"
}
需要 Enterprise 管理员的个人 API key。 在组织中克隆一个 Git 代码仓库,并生成一个新的快照版本。

授权

Authorization
string
header
必填

仅供 Enterprise 管理员使用的个人 API Key(apk_user_*)

路径参数

org_id
string
必填

请求体

application/json
repo_path
string
必填

按“owner/repo_name”格式输入仓库路径(例如:“acme/my-project”)

示例:

"owner/repo_name"

pull_repo_commands
string[] | null

用于拉取仓库的命令。建议留空,交由系统自动生成。

repo_note
string | null
run_lint_commands
string[] | null
run_project_commands
string[] | null
run_tests_commands
string[] | null
update_dependencies_commands
string[] | null

响应

成功的响应

创建快照的响应。

created_at
string<date-time>
必填

快照创建时间戳

org_id
string
必填

快照所属组织的 ID

snapshot_id
string
必填

已创建的快照 ID

status
string
必填

快照状态(例如:pending、available)

ami_id
string | null

快照的 AMI ID(如果仍在创建中,可能为 null)