查询列表
查询任务模板列表。
GET
https://api.alayanew.com/api/serverless-train/v1/template/list
Authorizations
Authorizations:StringHeaderRequired
用户可通过已获取Serverless API Key做验证,例如:plain Credential=[YOUR_AK],Signature=[YOUR_SK]。
Query Parameters
name:String
模板名称。
aidcId:String
智算中心ID。
page:IntRequired
页码,默认1。
size:Int
页码数量,默认10, 最大100。
Response
状态码:application/json
200
code:Int
code是一种常见的返回值形式,表示查询操作的执行结果。
0
-1
0是成功标识,表示操作成功完成。
data:object
data.count:String
查询结果数量。
data.rows:Array
msg:String
code返回值为-1时,返回异常信息。
cURL
Python
JavaScript
Go
Java
curl -X GET 'https://api.alayanew.com/api/serverless-train/v1/template/list?name=my-debug&page=2&size=20'
-H 'Authorization: plain Credential=YOUR_AK,Signature=YOUR_SK'
200
400
401
404
429
503
504
{
"code": 0,
"data": {
"count": 1,
"rows": [
{
"id": "5df0ef3c-252a-44c8-aba3-a87e23615c76",
"createAt": "2025-02-24T10:35:43.000+00:00",
"updateAt": "2025-02-28T06:45:27.000+00:00",
"aidcId": "1",
"settings": {
"cmd": [
"bash",
"-c",
"python3 main.py"
],
"args": [],
"env": {
"POD_NAME": "localhost"
},
"name": "my-debug",
"image": "registry.hd-01.alayanew.com/aladdin/python:3.13",
"vksId": "vc3jedd7crnd",
"labels": {},
"workDir": "/root/",
"replicas": 1,
"resource": {
"cpu": 2,
"gpu": {
"count": 1,
"gpuType": "nvidia.com/gpu-tesla-p4"
},
"mem": 8,
"epheneralStorage": 32
},
"namespace": "default",
"pvcMounts": [
{
"pvcName": "pvc-capacity-userdata",
"subPath": "a",
"readOnly": false,
"containerPath": "/opt/data"
}
],
"extensions": {
"tag": "3",
"orgId": "dc8e48eb-4c05-4466-8ee2-2c3f969352bf"
}
}
}
]
}
}