获取任务列表,支持分页、排序和按条件过滤。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
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 天的任务列表。 | 2020-11-08T16:00:00Z |
EndTime | string | 否 | 查询区间的截止时间;使用任务的创建时间来过滤。默认值是当前时刻。 | 2020-11-09T14:45:00Z |
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,详情请参见准备及管理 DLC 资源组集群。 | 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 |
返回参数
示例
正常返回示例
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": "vpc-1",
"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,
"EcsSpec": "ecs.c6.large",
"ExtraPodSpec": {
"SideCarContainers": [
{
"Name": "data-init",
"Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
"Command": [
"curl www.aliyun.com"
],
"Args": [
""
],
"WorkingDir": "/root",
"Env": [
{
"Name": "ENABLE_DEBUG",
"Value": "true"
}
],
"Resources": {
"Limits": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
},
"Requests": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
}
}
}
],
"InitContainers": [
{
"Name": "data-init",
"Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
"Command": [
"curl www.aliyun.com"
],
"Args": [
""
],
"WorkingDir": "/root",
"Env": [
{
"Name": "ENABLE_DEBUG",
"Value": "true"
}
],
"Resources": {
"Limits": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
},
"Requests": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
}
}
}
],
"PodLabels": {
"key": ""
},
"PodAnnotations": {
"key": ""
},
"SharedVolumeMountPaths": [
"/root/share/"
],
"Lifecycle": {
"PreStop": {
"Exec": {
"Command": [
""
]
}
},
"PostStart": {
"Exec": {
"Command": [
""
]
}
}
}
},
"ResourceConfig": {
"CPU": "10",
"GPU": "3",
"Memory": "10Gi",
"SharedMemory": "5Gi",
"GPUType": "Tesla-V100-16G"
},
"UseSpotInstance": false,
"SpotSpec": {
"SpotStrategy": "",
"SpotDiscountLimit": 0
},
"AssignNodeSpec": {
"EnableAssignNode": true,
"NodeNames": "lingjxxxxxxxx",
"AntiAffinityNodeNames": "lingjxxxxxxxx"
}
}
],
"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": "2021-01-12T14:35:01Z",
"GmtSubmittedTime": "2021-01-12T14:35:01Z",
"GmtRunningTime": "2021-01-12T14:35:01Z",
"GmtSuccessedTime": "2021-01-12T14:35:01Z",
"GmtStoppedTime": "2021-01-12T14:35:01Z",
"GmtFailedTime": "2021-01-12T14:35:01Z",
"GmtFinishTime": "2021-01-12T15:36:08Z",
"GmtModifiedTime": "2021-01-12T15:36:08Z",
"Duration": 3602,
"JobMaxRunningTimeMinutes": 1,
"Settings": {
"BusinessUserId": "16****",
"Caller": "SilkFlow",
"Tags": {
"key": ""
},
"PipelineId": "pid-123456",
"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=MarkJobFai",
"JobReservedMinutes": 30,
"JobReservedPolicy": "Always",
"DisableEcsStockCheck": false
},
"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": "",
"TenantId": "",
"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": []
}
]
}
]
}
]
}
],
"TotalCount": 2,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2024-04-09 | OpenAPI 入参发生变更 | 查看变更详情 |
2024-01-12 | OpenAPI 入参发生变更 | 查看变更详情 |
2023-12-14 | OpenAPI 入参发生变更 | 查看变更详情 |
2022-11-29 | OpenAPI 入参发生变更 | 查看变更详情 |