镜像列表¶
接口说明¶
- 功能: 获取平台镜像列表
- 请求
URI
:/zsc/open/api/v1/image/list
- 请求方法:
GET
鉴权
该接口需要通过 Basic
认证。请查看接口鉴权文档 接口鉴权
请求参数¶
参数 | 必选 | 类型 | 说明 |
---|---|---|---|
machine_id | true | integer | 主机ID |
type | true | integer | 镜像类型 [1:基础镜像] |
name | false | string | 镜像名称,搜索过滤镜像名 |
page | false | integer | 页数,默认1 |
page_size | false | integer | 页数,默认10 |
返回字段¶
返回字段 | 字段类型 | 说明 |
---|---|---|
code | integer | 错误码 |
message | string | 返回信息 |
trace | string | 请求ID |
data.images[..].id | integer | 镜像ID |
data.images[..].name | string | 镜像名称 |
data.images[..].remark | string | 镜像备注名 |
data.images[..].type | integer | 镜像类型 [1:基础镜像] |
data.images[..].area_id | integer | 镜像可用区域ID |
data.images[..].area_name | string | 镜像可用区域名 |
data.images[..].url | string | 镜像下载地址 |
data.images[..].version | string | 镜像版本 |
data.images[..].size | integer | 镜像大小,单位:字节 |
data.images[..].count | integer | 镜像下载次数 |
data.images[..].framework_name | string | 镜像框架名 |
data.images[..].framework_version | string | 镜像版本 |
data.images[..].python_version | string | Python版本 |
data.images[..].cuda_version | string | Cuda版本 |
data.images[..].status | integer | 镜像状态[1:未就绪,2:已就绪,3:已下架] |
data.images[..].created_at | string | 镜像创建时间 |
data.totals | integer | 镜像总数 |
接口示例¶
请求参数示例:/zsc/open/api/v1/image/list?machine_id=1&type=1&page=1&page_size=10
返回示例:
{
"code": 200,
"msg": "success",
"trace": "3dcc7c30-1cbe-11ef-b705-1b340ce24d17",
"data": {
"images": [
{
"id": 32,
"name": "registry.bj.aohoo.cn/power/miniconda:cuda11.1-cudnn8-devel-ubuntu18.04-py38-zsc-32",
"remark": null,
"type": 1,
"area_id": 1,
"area_name": "北京",
"url": "registry.bj.aohoo.cn/power/miniconda:cuda11.1-cudnn8-devel-ubuntu18.04-py38-zsc-32",
"version": "1.0",
"size": 2147483648,
"count": 1,
"framework_name": "JAX",
"framework_version": "3.1.0",
"python_version": "1.0",
"cuda_version": "2.0",
"status": 1,
"created_at": "2024-05-28T14:41:19+08:00"
}
],
"totals": 1
}
}