获取任务列表,支持分页、排序和按条件过滤。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
paidlc:ListJobs |
get |
*全部资源
|
无 | 无 |
请求语法
GET /api/v1/jobs HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| DisplayName |
string |
否 |
任务名称,支持模糊查询,大小写不敏感,不支持通配符。 例如:输入 test,可以匹配 test-job1、job-test、job-test2 或 job-Test;但是不能匹配 job-t1。 默认为空,代表任意任务名称。 |
tf-mnist-test |
| JobType |
string |
否 |
任务类型,默认为空,代表所有类型。支持的任务类型如下:
|
TFJob |
| Status |
string |
否 |
任务运行状态,可能值:
|
Running |
| StartTime |
string |
否 |
查询区间的起始时间;使用任务的创建时间来过滤。默认值是当前时间减去 7 天,即:如果 StartTime 与 EndTime 都没有配置时,默认查询最近 7 天的任务列表。 |
2025-04-16T07:25:34Z |
| EndTime |
string |
否 |
查询区间的截止时间;使用任务的创建时间来过滤。默认值是当前时刻。 |
2025-04-16T07:26:41Z |
| PageNumber |
integer |
否 |
分页查询,指定当前需要返回的页码,起始值为 1,默认为 1。 |
1 |
| PageSize |
integer |
否 |
每页返回的任务数量。 |
50 |
| SortBy |
string |
否 |
排序字段:
|
GmtCreateTime |
| Order |
string |
否 |
排列顺序,支持:
枚举值:
|
desc |
| ShowOwn |
boolean |
否 |
是否只查询当前用户提交的任务列表。 |
true |
| WorkspaceId |
string |
否 |
工作空间 ID。如何获取工作空间 ID,请参见 ListWorkspaces 。 |
1**** |
| ResourceId |
string |
否 |
资源组 ID。如何查询专有资源组 ID,详情请参见管理资源配额。 |
r***** |
| BusinessUserId |
string |
否 |
任务关联用户 ID。 |
16**** |
| Caller |
string |
否 |
调用方。 |
local |
| Tags |
object |
否 |
用于过滤的标签。 |
|
|
string |
否 |
单个标签。 |
recommandation |
|
| PipelineId |
string |
否 |
过滤指定工作流 ID 创建的任务。 |
flow-******* |
| FromAllWorkspaces |
boolean |
否 |
是否跨工作空间获取任务列表,需要配合 |
false |
| JobId |
string |
否 |
任务 ID,不支持模糊查询,对大小写不敏感。不支持通配符。 默认为空,代表任意任务 ID。 |
dlc******** |
| UserIdForFilter |
string |
否 |
按任务提交者的用户 ID,过滤查询任务列表。 |
20************** |
| Username |
string |
否 |
按任务提交者的用户名,过滤查询任务列表。支持模糊查询,不支持通配符。默认为空,表示不过滤用户名。 |
test*** |
| ResourceQuotaName |
string |
否 |
按资源配额的名字,过滤查询任务列表。支持模糊匹配,不支持通配符。默认为空,表示不过滤资源配额。 |
quota*** |
| Accessibility |
string |
否 |
作业的可见性,取值如下:
枚举值:
|
PRIVATE |
| OversoldInfo |
string |
否 |
闲时资源信息,可能的取值
|
ForbiddenQuotaOverSold |
| PaymentType |
string |
否 |
资源类型,取值如下:
|
PostPaid |
| JobIds |
string |
否 |
任务 ID 列表,多个 ID 用英文逗号分隔。与 JobId 同时设置时,以 JobId 为准。 |
dlc123abc |
| DisplayNameSearchMode |
string |
否 |
DisplayName 搜索模式。默认为通配符匹配。 枚举值:
|
wildcard |
| ReasonSearch |
string |
否 |
在任务失败原因(reason)字段中进行全文检索,支持中英文分词。 |
OOM |
| UserCommandSearch |
string |
否 |
在用户命令(user_command)字段中进行全文检索,支持中英文分词。 |
python train.py |
| ImageSearch |
string |
否 |
在镜像(images)字段中进行全文检索,支持中英文分词。 |
pytorch |
| TimeRangeField |
string |
否 |
指定 StartTime/EndTime 筛选使用的时间字段。不填默认为创建时间。 |
GmtFinishTime |
| NumericRangeField |
string |
否 |
数值范围筛选的字段名。需配合 NumericRangeMin/NumericRangeMax 使用。 |
RequestGPU |
| NumericRangeMin |
integer |
否 |
数值范围筛选的最小值(包含)。需配合 NumericRangeField 使用。 |
4 |
| NumericRangeMax |
integer |
否 |
数值范围筛选的最大值(包含)。需配合 NumericRangeField 使用。 |
8 |
| EnableAssignNode |
string |
否 |
筛选是否启用指定节点运行的任务。 枚举值:
|
true |
| TemplateId |
string |
否 |
模板 ID,用于筛选由指定模板创建的任务。 |
tmlabc123 |
| Description |
string |
否 |
||
| ResourceIds |
string |
否 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
任务列表。 |
||
| Jobs |
array |
任务列表。 |
|
| JobItem |
单个任务。 |
||
| TotalCount |
integer |
符合过滤条件的总任务数。 |
1 |
| RequestId |
string |
请求 ID,用于诊断和答疑。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"Jobs": [
{
"JobId": "dlc-20210126170216-********",
"CredentialConfig": {
"EnableCredentialInject": true,
"AliyunEnvRoleKey": "",
"CredentialConfigItems": [
{
"Key": "",
"Type": "",
"Roles": [
{
"RoleArn": "",
"RoleType": "",
"AssumeRoleFor": "",
"Policy": "",
"AssumeUserInfo": {
"SecurityToken": "",
"AccessKeyId": "",
"Type": "",
"Id": ""
}
}
]
}
]
},
"JobType": "TFJob",
"DisplayName": "tf-mnist-test",
"UserVpc": {
"VpcId": "vpc-2zed***",
"SwitchId": "vsw-2ze6***",
"SecurityGroupId": "sg-2zeef***",
"ExtendedCidrs": [
"10.2.0.0/16"
],
"DefaultRoute": "eth0"
},
"UserId": "123456789",
"Username": "pai-dlc-role",
"Status": "Stopped",
"WorkspaceId": "268",
"WorkspaceName": "dlc-workspace",
"ResourceId": "dlc-quota",
"ResourceLevel": "L0",
"ReasonCode": "JobStoppedByUser",
"ReasonMessage": "Job is stopped by user.",
"JobSpecs": [
{
"Type": "Worker",
"Image": "registry-vpc.cn-hangzhou.aliyuncs.com/cloud-dsw/tensorflow:1.12PAI-gpu-py36-cu101-ubuntu18.04",
"ImageConfig": {
"DockerRegistry": "docker****registry.com",
"Username": " username",
"Password": "password",
"Auth": ""
},
"PodCount": 1,
"ExtraPodSpec": {
"SideCarContainers": [
{
"Name": "data-init",
"Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
"Command": [
"curl www.aliyun.com"
],
"Args": [
"-v"
],
"WorkingDir": "/root",
"Env": [
{
"Name": "ENABLE_DEBUG",
"Value": "true"
}
],
"Resources": {
"Limits": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
},
"Requests": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
}
},
"SecurityContext": {
"RunAsUser": 1000,
"RunAsGroup": 1000,
"SeccompProfile": {
"Type": "Unconfined",
"LocalhostProfile": "my-profiles/profile-allow.json"
},
"Privileged": true,
"Capabilities": {
"Add": [
""
],
"Drop": [
""
]
}
}
}
],
"InitContainers": [
{
"Name": "data-init",
"Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
"Command": [
"curl www.aliyun.com"
],
"Args": [
"-v"
],
"WorkingDir": "/root",
"Env": [
{
"Name": "ENABLE_DEBUG",
"Value": "true"
}
],
"Resources": {
"Limits": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
},
"Requests": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
}
},
"SecurityContext": {
"RunAsUser": 1000,
"RunAsGroup": 1000,
"SeccompProfile": {
"Type": "Unconfined",
"LocalhostProfile": "my-profiles/profile-allow.json"
},
"Privileged": true,
"Capabilities": {
"Add": [
""
],
"Drop": [
""
]
}
}
}
],
"PodLabels": {
"key": "example-lable"
},
"PodAnnotations": {
"key": "example-annotation"
},
"SharedVolumeMountPaths": [
"/root/share/"
],
"Lifecycle": {
"PreStop": {
"Exec": {
"Command": [
""
]
}
},
"PostStart": {
"Exec": {
"Command": [
""
]
}
}
},
"MainContainerSecurityContext": {
"RunAsUser": 1000,
"RunAsGroup": 1000,
"SeccompProfile": {
"Type": "Unconfined",
"LocalhostProfile": "my-profiles/profile-allow.json"
},
"Privileged": true,
"Capabilities": {
"Add": [
""
],
"Drop": [
""
]
}
}
},
"ResourceConfig": {
"CPU": "10",
"GPU": "3",
"Memory": "10Gi",
"SharedMemory": "5Gi",
"GPUType": "Tesla-V100-16G"
},
"UseSpotInstance": false,
"SpotSpec": {
"SpotStrategy": "SpotWithPriceLimit",
"SpotDiscountLimit": 0.8,
"SpotPriceLimit": 0.4744
},
"AssignNodeSpec": {
"EnableAssignNode": true,
"NodeNames": "lingjxxxxxxxx",
"AntiAffinityNodeNames": "lingjxxxxxxxx",
"HyperNodes": [
{
"HyperNodeName": "",
"NodeNames": ""
}
],
"AntiAffinityHyperNodes": [
{
"HyperNodeName": "",
"NodeNames": ""
}
]
},
"LocalMountSpecs": [
{
"MountMode": "",
"LocalPath": "",
"MountPath": ""
}
],
"AutoScalingSpec": {
"ScalingStrategy": "",
"MinReplicas": 0,
"MaxReplicas": 0,
"PodsToDelete": [
""
],
"AutoscalingMetricSpec": {
"MetricName": "",
"TargetValue": 0,
"StabilizationWindowSeconds": 0,
"Tolerance": ""
}
},
"ServiceSpec": {
"DefaultPort": 8080,
"ServiceMode": "PerRole",
"ExtraPorts": [
8081
]
},
"IsCheif": true,
"IsChief": true,
"RestartPolicy": "ExitCode",
"SystemDisk": {
"Size": 0,
"Category": "",
"PerformanceLevel": ""
},
"EcsSpec": "ecs.c6.large",
"QuotaId": "",
"ConsiderInSuccessPolicy": true,
"OversoldType": "",
"HyperNodeSchedulingConfig": {
"MinAvailable": 0,
"QualityPolicy": ""
},
"StartupDependencies": [
{
"Type": "",
"OnPhase": "",
"MinReplicas": ""
}
],
"ElasticSpotSpecs": [
{
"InstanceType": "",
"SpotPriceLimit": 0,
"SpotDiscountLimit": 0,
"SpotStrategy": ""
}
],
"Driver": ""
}
],
"UserCommand": "python /root/code/mnist.py",
"DataSources": [
{
"DataSourceId": "data-20210114104214-********",
"MountPath": "/mnt/data"
}
],
"CodeSource": {
"CodeSourceId": "code-20210111103721-********",
"Branch": "master",
"Commit": "44da109b59f8596152987eaa8f3b2487bb******",
"MountPath": "/mnt/data"
},
"ThirdpartyLibs": [
"numpy==1.16.1"
],
"NodeNames": [
"i-a"
],
"ThirdpartyLibDir": "/root/code/",
"Envs": {
"key": "ENABLE_DEBUG_MODE"
},
"SystemEnvs": {
"key": "ENABLE_DEBUG_MODE"
},
"GmtCreateTime": "2025-04-16T07:25:34Z",
"GmtSubmittedTime": "2025-04-16T07:26:14Z",
"GmtRunningTime": "2025-04-16T07:26:41Z",
"GmtSuccessedTime": "2025-04-16T07:28:20Z",
"GmtStoppedTime": "null",
"GmtFailedTime": "null",
"GmtFinishTime": "2025-04-16T07:28:20Z",
"GmtModifiedTime": "2025-04-16T07:28:22Z",
"Duration": 243,
"JobMaxRunningTimeMinutes": 0,
"Settings": {
"BusinessUserId": "16****",
"Caller": "SilkFlow",
"Tags": {
"key": "key:value"
},
"PipelineId": "pid-12****",
"EnableTideResource": true,
"EnableErrorMonitoringInAIMaster": false,
"ErrorMonitoringArgs": "--enable-log-hang-detection true",
"EnableRDMA": true,
"EnableOssAppend": true,
"OversoldType": "AcceptQuotaOverSold",
"AdvancedSettings": {
"test": "test",
"test2": 1
},
"Driver": "535.54.03",
"EnableSanityCheck": true,
"SanityCheckArgs": "--sanity-check-timing=AfterJobFaultTolerant --sanity-check-timeout-ops=MarkJobFail",
"JobReservedMinutes": 30,
"JobReservedPolicy": "Always",
"EnableCPUAffinity": true,
"DisableEcsStockCheck": false,
"AllocateAllRDMADevices": true,
"EnableDSWDev": true,
"DataJuicerConfig": {
"ExecutionMode": "standalone",
"CommandType": "config",
"EnableResourceEstimation": true,
"ResourceLimit": {
"CPU": "2",
"Memory": "10Gi",
"GPU": "20"
}
},
"ModelConfig": {
"ModelName": "",
"ModelTemplate": {
"ModelName": "",
"Provider": "",
"Collections": ""
}
},
"AllowUnschedulableNodes": true,
"Shell": "/bin/bash",
"TerminationGracePeriodSeconds": 0,
"ElasticSpotJobMaxRestartTimes": 0
},
"EnabledDebugger": false,
"IsDeleted": false,
"EnablePreemptibleJob": false,
"ResourceName": "my_resource_group",
"WorkingDir": "/mnt/data",
"UserScript": "ls ",
"RestartTimes": "1",
"RequestCPU": 1,
"RequestMemory": "1Gi",
"ResourceQuotaName": "test",
"RequestGPU": "1",
"NodeCount": "1",
"Priority": 1,
"SubStatus": "Restarting",
"UseOversoldResource": false,
"ResourceType": "ECS",
"Accessibility": "PUBLIC",
"ClusterId": "****1316721349****",
"TenantId": "****93955616****",
"StatusHistory": [
{
"Status": "",
"StartTime": "",
"EndTime": "",
"ReasonCode": "",
"ReasonMessage": ""
}
],
"ElasticSpec": {
"EnableElasticTraining": true,
"MinParallelism": 1,
"MaxParallelism": 8,
"AIMasterType": "",
"AIMasterDockerImage": "",
"EnablePsJobElasticWorker": true,
"EnableAIMaster": true,
"EnablePsResourceEstimate": true,
"EnablePsJobElasticPS": true,
"PSMinParallelism": 4,
"PSMaxParallelism": 10,
"ElasticStrategy": "",
"EnableEDP": true,
"EDPMaxParallelism": 16,
"EDPMinParallelism": 8
},
"Pods": [
{
"Type": "Worker",
"PodId": "dlc-20210126170216-mtl37ge7gkvdz-worker-0",
"PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
"Status": "Stopped",
"Ip": "10.0.1.2",
"GmtCreateTime": "2021-01-12T14:36:01Z",
"GmtStartTime": "2021-01-12T14:36:05Z",
"GmtFinishTime": "2021-01-12T15:36:05Z",
"HistoryPods": [
{
"Type": "Worker",
"PodId": "dlc-20210126170216-mtl37ge7gkvdz-worker-0",
"PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
"Status": "Stopped",
"Ip": "10.0.1.2",
"GmtCreateTime": "2021-01-12T14:36:01Z",
"GmtStartTime": "2021-01-12T14:36:05Z",
"GmtFinishTime": "2021-01-12T15:36:05Z",
"HistoryPods": [
{
"Type": "Worker",
"PodId": "dlc-20210126170216-mtl37ge7gkvdz-worker-0",
"PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
"Status": "Stopped",
"Ip": "10.0.1.2",
"GmtCreateTime": "2021-01-12T14:36:01Z",
"GmtStartTime": "2021-01-12T14:36:05Z",
"GmtFinishTime": "2021-01-12T15:36:05Z",
"HistoryPods": [],
"SubStatus": "",
"NodeName": "",
"PodIp": "",
"PodIps": [
{
"InterfaceName": "",
"Ip": ""
}
],
"supportedProfilingTypes": "sysom"
}
],
"SubStatus": "",
"NodeName": "",
"PodIp": "",
"PodIps": [
{
"InterfaceName": "",
"Ip": ""
}
],
"supportedProfilingTypes": "sysom"
}
],
"SubStatus": "",
"NodeName": "",
"PodIp": "",
"PodIps": [
{
"InterfaceName": "",
"Ip": ""
}
],
"supportedProfilingTypes": "sysom"
}
],
"TemplateId": "",
"TemplateName": "",
"JobReplicaStatuses": [
{
"Type": "",
"Active": 0,
"EstimatedPodCount": 0,
"EstimatedAutoScalingSpec": {
"ScalingStrategy": "",
"MinReplicas": 0,
"MaxReplicas": 0,
"PodsToDelete": [
""
],
"AutoscalingMetricSpec": {
"MetricName": "",
"TargetValue": 0,
"StabilizationWindowSeconds": 0,
"Tolerance": ""
}
},
"EstimatedResourceConfig": {
"CPU": "10",
"GPU": "3",
"Memory": "10Gi",
"SharedMemory": "5Gi",
"GPUType": "Tesla-V100-16G"
},
"Queuing": 0,
"Dequeued": 0,
"CurrentSpotInstanceType": ""
}
],
"SchedulingStrategy": "",
"RetryCount": 0,
"supportedProfilingTypes": "sysom"
}
],
"TotalCount": 1,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。