查询公共镜像标签列表
按镜像类型查询公共镜像的标签分组列表,用于创建任务时选择镜像。同步返回。创建分布式训练任务时,创建接口中的 imageType 与 image 取值即来源于本接口返回的标签与镜像地址。
POST
https://api.alayanew.com/api/osm/v1/cci/public-image/label/list鉴权(Authorizations)
bearerAuthAuthorizationString必填用户获取Authorization请求头后,通过该请求头完成身份认证。例如:Authorization: [your-auth-header]。
Request body
application/jsonaidcIdLong必填智算中心 ID。例如:1。
imageTypeString镜像类型:general(基础镜像)、application(应用镜像)。不传或值非法时返回空列表。
Response
application/json · 200statusInteger业务状态码,200 表示成功。
messageString接口响应信息。例如:"OK"。
dataArray标签分组列表。
显示 properties
labelString标签名称。例如:"框架"。
valueString标签值。例如:"pytorch"。
imageUrlArray该标签下的镜像地址列表。例如:["registry.example.com/public/pytorch:2.3.0-cuda12.1"]。
childrenArray子标签列表,元素结构与本层一致(包含 label、value、imageUrl,可继续嵌套 children)。无子标签时不返回或为空数组。
显示 properties
labelString标签名称。例如:"版本"。
valueString标签值。例如:"2.3.0"。
imageUrlArray该标签下的镜像地址列表。例如:["registry.example.com/public/pytorch:2.3.0-cuda12.1"]。
curl -X 'POST' \
'https://api.alayanew.com/api/osm/v1/cci/public-image/label/list' \
-H 'accept: application/json' \
-H 'Authorization: [your-auth-header]' \
-H 'Content-Type: application/json' \
-d '{"aidcId": 1, "imageType": "general"}'import requests
url = "https://api.alayanew.com/api/osm/v1/cci/public-image/label/list"
payload = {"aidcId": 1, "imageType": "general"}
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "[your-auth-header]"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())fetch('https://api.alayanew.com/api/osm/v1/cci/public-image/label/list', {
method: 'POST',
headers: {
'accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': '[your-auth-header]'
},
body: JSON.stringify({ aidcId: 1, imageType: 'general' })
})
.then(res => res.json())
.then(console.log)
.catch(console.error);{
"status": 200,
"message": "OK",
"data": [
{
"label": "框架",
"value": "pytorch",
"imageUrl": [
"registry.example.com/public/pytorch:2.3.0-cuda12.1"
],
"children": [
{
"label": "版本",
"value": "2.3.0",
"imageUrl": [
"registry.example.com/public/pytorch:2.3.0-cuda12.1"
]
}
]
}
]
}最后更新于
