Alaya NeW Cloud
查询公共镜像标签

按镜像类型查询公共镜像的标签级联树,叶节点携带可选镜像地址,用于开通或开机时选择镜像。同步返回。

POSThttps://api.alayanew.com/api/osm/v1/cci/public-image/label/list

鉴权(Authorizations)

AuthorizationString必填

用户获取Authorization请求头后,通过该请求头完成身份认证。例如:Authorization: [your-auth-header]。

Request body

aidcIdLong必填

智算中心 ID。例如:1。

imageTypeString

镜像类型:general(基础镜像)、application(业务镜像)。

Response

statusInteger

业务状态码,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": []
        }
      ]
    }
  ]
}

Last updated on