拉取镜像
此接口用于将远程仓库的镜像拉取至本地仓库。
接口描述
通信协议:HTTP
URL:POST /api/v1/image/sync
传参方式:body
请求参数
字段名 | 类型 | 是否必填 | 说明 |
---|---|---|---|
registryId | string | 是 | 远程仓库 ID |
imageName | string | 是 | 镜像名称 |
imageSize | int | 是 | 镜像大小,单位为 MB |
tag | string | 是 | 镜像版本 |
id | string | 否 | 镜像 ID |
os | string | 是 | 镜像系统,如 Linux、SylixOS |
arch | string | 是 | 镜像架构,如 arm64,amd64 |
响应参数
字段名 | 类型 | 说明 |
---|---|---|
syncId | string | 拉取任务 ID |
请求示例
curl --location --request POST 'http://localhost:3001/api/v1/image/sync' \
--header 'Referer: https://192.168.128.1/' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "1",
"imageName": "registry-ui",
"tag": "65.7",
"registryId": "5df6d066-192d-49e5-8ceb-5cfcf5a2c8fa",
"imageSize": 100,
"os": "linux",
"arch": "x86-64"
}'
响应示例
{
"status": 200,
"message": "success",
"fieldErrors": null,
"data": {
"syncId": "f6c287a5-d9cc-4877-8e50-53455b98213d"
}
}
错误码
具体请参见 错误码说明。