Skip to main content

Query Task List

更新时间:2025-07-22 17:32:25
Query all tasks for this user across all statuses.
GET
https://api.alayanew.com/api/serverless-train/v1/task/list
Authorizations
AuthorizationsStringHeaderRequired

用户可通过已获取Open API Key做验证,例如:plain Credential=[YOUR_AK],Signature=[YOUR_SK]。

Query Parameters
nameString

Task name.

typeString

Task type, set to 'task'. Default value is 'task'.

statusString

Specify task status, e.g., Created, Queued, Starting, Running, Success, Terminated, Failed.

aidcIdString

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.

pageInt

Page number, defaults to 1.

sizeInt

Number of rows to query, defaults to 100.

Response
状态码:application/json
codeInt

code is a common return value format indicating the execution result of the query operation.

0 is the success identifier, indicating the operation completed successfully.
dataObject

data.countInt

Number of query results.

data.rowsArray

msgStringRequired

Returns error information when the code value is -1.

curl -X GET 'https://api.alayanew.com/api/serverless-train/v1/task/list?status=running' 
     -H 'Authorization: plain Credential=YOUR_AK,Signature=YOUR_SK'
{
    "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)流转详情如下图所示。 image