查询公共镜像标签
按镜像类型查询公共镜像的标签级联树,叶节点携带可选镜像地址,用于开通或开机时选择镜像。同步返回。
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标签值。例如:"framework"。
childrenArray子标签列表,结构同本元素,逐级下钻;无子标签时为 []。
显示 properties
labelString标签名称。例如:"PyTorch"。
valueString标签值。例如:"pytorch"。
imageUrlArray该标签下的镜像地址列表。例如:["hub.example.com/public/pytorch:2.3-cuda12.1"]。
childrenArray子标签列表,结构同本元素;叶节点为 []。
curl -X 'POST' \
'https://api.alayanew.com/api/osm/v1/cci/public-image/label/list' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: [your-auth-header]' \
-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": "framework",
"children": [
{
"label": "PyTorch",
"value": "pytorch",
"imageUrl": [
"hub.example.com/public/pytorch:2.3-cuda12.1"
],
"children": []
}
]
}
]
}最后更新于
