Alaya NeW Cloud

分布式训练任务资源配置列表

查询可用于分布式训练任务的资源规格(产品)列表,每一项对应一种单节点的 CPU / 内存 / GPU / 系统盘组合及其单价与库存余量。创建训练任务时,将选中规格的 productCode 填入创建接口productCode 字段。

GEThttps://api.alayanew.com/v1/product/list-for-training-task

鉴权(Authorizations)

AuthorizationString必填

用户可通过已获取的 Open API Key 做验证。例如:Bearer [YOUR_API_KEY]

Query Parameters

aidcIdInteger

智算中心 ID,用于按智算中心过滤资源规格。非必填,不传时返回全部可用规格。例如:1

Response

statusInteger

业务状态码,200 表示成功。

messageString

接口响应信息。例如:"OK"

dataArray

资源规格列表。

显示 properties
nameString必填

规格名称。例如:"无卡启动"

aidcIdInteger

所属智算中心 ID。例如:1

productCodeString

产品编码,创建训练任务时填入此值。例如:"PRD-CCI-1"

cpuCoresString

CPU 核数。例如:"2"

memoryGBString

内存大小(GB)。例如:"4"

gpuNameString

GPU 型号;无 GPU 时为 "-"null。例如:"NVIDIA-H800A-NV-80G"

gpuCountString

单节点 GPU 数量。例如:"1"

diskGBString

系统盘容量(GB)。例如:"50"

priceString

单价(不含单位),需结合 priceUnit 理解。例如:"12.5"

priceUnitInteger

价格单位,对应数据字典 unit_of_measure 的编码。例如:11

remainingCountInteger

可用资源余量(个)。例如:6

extObject

扩展字段,记录杂项信息(键值对,值均为字符串),如库存异常信息。例如:{"stockError": "XXX"}

curl -X 'GET' \
  'https://api.alayanew.com/v1/product/list-for-training-task?aidcId=1' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer [YOUR_API_KEY]'
import requests

url = "https://api.alayanew.com/v1/product/list-for-training-task"
params = {"aidcId": 1}
headers = {
    "accept": "application/json",
    "Authorization": "Bearer [YOUR_API_KEY]"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
const params = new URLSearchParams({ aidcId: '1' });

fetch(`https://api.alayanew.com/v1/product/list-for-training-task?${params}`, {
  method: 'GET',
  headers: {
    'accept': 'application/json',
    'Authorization': 'Bearer [YOUR_API_KEY]'
  }
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
{
  "status": 200,
  "message": "OK",
  "data": [
    {
      "name": "无卡启动",
      "aidcId": 1,
      "productCode": "PRD-CCI-1",
      "cpuCores": "2",
      "memoryGB": "4",
      "gpuName": "-",
      "gpuCount": "0",
      "diskGB": "50",
      "price": "12.5",
      "priceUnit": 11,
      "remainingCount": 6,
      "ext": {}
    },
    {
      "name": "分布式训练1",
      "aidcId": 1,
      "productCode": "PRD-TRAIN-1",
      "cpuCores": "18",
      "memoryGB": "200",
      "gpuName": "NVIDIA-H800A-NV-80G",
      "gpuCount": "8",
      "diskGB": "100",
      "price": "2",
      "priceUnit": 11,
      "remainingCount": 0,
      "ext": {
        "stockError": "库存不足"
      }
    }
  ]
}
{
  "status": 403,
  "message": "Forbidden",
  "data": {}
}
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}

Last updated on