分布式训练任务资源配置列表
查询可用于分布式训练任务的资源规格(产品)列表,每一项对应一种单节点的 CPU / 内存 / GPU / 系统盘组合及其单价与库存余量。创建训练任务时,将选中规格的 productCode 填入创建接口的 productCode 字段。
GET
https://api.alayanew.com/v1/product/list-for-training-task鉴权(Authorizations)
bearerAuthAuthorizationString必填用户可通过已获取的 Open API Key 做验证。例如:Bearer [YOUR_API_KEY]。
Query Parameters
aidcIdInteger智算中心 ID,用于按智算中心过滤资源规格。非必填,不传时返回全部可用规格。例如:1。
Response
application/json · 200statusInteger业务状态码,200 表示成功。
messageString接口响应信息。例如:"OK"。
dataArray资源规格列表。
显示 properties
nameString必填规格名称。例如:"无卡启动"。
aidcIdInteger所属智算中心 ID。例如:1。
productCodeString产品编码,创建训练任务时填入此值。例如:"PRD-CCI-1"。
cpuCoresStringCPU 核数。例如:"2"。
memoryGBString内存大小(GB)。例如:"4"。
gpuNameStringGPU 型号;无 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
