跳到主要内容

查询列表

查询任务模板列表。
GET
https://api.alayanew.com/api/serverless-train/v1/template/list
Authorizations
AuthorizationsStringHeaderRequired

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

Query Parameters
nameString

模板名称。

aidcIdString

智算中心ID。

pageIntRequired

页码,默认1。

sizeInt

页码数量,默认10, 最大100。

Response
状态码:application/json
codeInt

code是一种常见的返回值形式,表示查询操作的执行结果。

0是成功标识,表示操作成功完成。
dataobject

data.countString

查询结果数量。

data.rowsArray

msgString

code返回值为-1时,返回异常信息。

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'
{
    "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"
                    }
                }
            }
        ]
    }
}