Query Task List
Query all tasks for this user across all statuses.
GET
https://api.alayanew.com/api/serverless-train/v1/task/list
Authorizations
Authorizations:StringHeaderRequired
用户可通过已获取Open API Key做验证,例如:plain Credential=[YOUR_AK],Signature=[YOUR_SK]。
Query Parameters
name:String
Task name.
type:String
Task type, set to 'task'. Default value is 'task'.
status:String
Specify task status, e.g., Created, Queued, Starting, Running, Success, Terminated, Failed.
aidcId:String
Intelligent Computing Center ID.
extensions.<key>:String
Must be in extensions.<key>:value format; used to retrieve tasks where specific extension fields were specified during task creation.
page:Int
Page number, defaults to 1.
size:Int
Number of rows to query, defaults to 100.
Response
状态码:application/json
200
code:Int
code is a common return value format indicating the execution result of the query operation.
0
-1
0 is the success identifier, indicating the operation completed successfully.
data:Object
data.count:Int
Number of query results.
data.rows:Array
msg:StringRequired
Returns error information when the code value is -1.
cURL
Python
JavaScript
Go
Java
curl -X GET 'https://api.alayanew.com/api/serverless-train/v1/task/list?status=running'
-H 'Authorization: plain Credential=YOUR_AK,Signature=YOUR_SK'
200
400
401
403
404
500
{
"code": 0,
"data": {
"count": 2,
"rows": [
{
"id": "506927a1-1883-4413-abad-0de1ff309023",
"name": "rungroup11",
"createAt": "2025-02-21T02:51:53.000+00:00",
"updateAt": "2025-02-24T02:44:28.000+00:00",
"type": "task",
"aidcId": "1",
"status": "running",
"reason": "",
"config": {
"cmd": [
"python3",
"a.py"
],
"env": {},
"args": [],
"image": "registry.hd-01.alayanew.com/aladdin/python:3.13",
"vksId": "vc3jedd7crnd",
"labels": {},
"workDir": "/root/",
"replicas": 1,
"resource": {
"cpu": 2,
"gpu": {
"count": 0,
"gpuType": ""
},
"mem": 8,
"epheneralStorage": 32
},
"namespace": "default",
"pvcMounts": null,
"runAsUser": null,
"extensions": {
"cpu": "2",
"env": "",
},
"imagePullSecret": {
"password": "[password]",
"registry": "https://registry.hd-01.alayanew.com:8443",
"username": "[username]"
}
}
},
{
"id": "bc195a3a-d06e-4923-984e-c2c3b8c960db",
"name": "runtask2",
"createAt": "2025-02-20T06:59:53.000+00:00",
"updateAt": null,
"type": "task",
"aidcId": "1",
"status": "running",
"reason": "",
"config": {
"cmd": [
"python3",
"a.py"
],
"env": {},
"args": [],
"image": "registry.hd-01.alayanew.com/aladdin/python:3.12",
"vksId": "vc3jedd7crnd",
"labels": {},
"workDir": "/root/",
"replicas": 1,
"resource": {
"cpu": 2,
"gpu": {
"count": 0,
"gpuType": ""
},
"mem": 8,
"epheneralStorage": 32
},
"namespace": "default",
"extensions": {
"cpu": "2",
"env": "",
"mem": "8G"
},
"imagePullSecret": {
"password": "[password]",
"registry": "https://registry.hd-01.alayanew.com",
"username": "[username]"
}
}
}
]
}
}
任务状态
任务状态(status)流转详情如下图所示。
