獲取任務列表,支持分頁、排序和按條件過濾。
調試
您可以在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 |
OversoldInfo | string | 否 | 閑時資源信息,可能的取值
| ForbiddenQuotaOverSold |
返回參數
示例
正常返回示例
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": [
"-v"
],
"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": [
"-v"
],
"WorkingDir": "/root",
"Env": [
{
"Name": "ENABLE_DEBUG",
"Value": "true"
}
],
"Resources": {
"Limits": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
},
"Requests": {
"key": "{'cpu': '1', 'memory': '1000Mi'}"
}
}
}
],
"PodLabels": {
"key": "example-lable"
},
"PodAnnotations": {
"key": "example-annotation"
},
"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,
"SpotPriceLimit": 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": "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=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-11-21 | OpenAPI 入參發生變更 | 查看變更詳情 |
2024-04-09 | OpenAPI 入參發生變更 | 查看變更詳情 |
2024-01-12 | OpenAPI 入參發生變更 | 查看變更詳情 |
2023-12-14 | OpenAPI 入參發生變更 | 查看變更詳情 |
2022-11-29 | OpenAPI 入參發生變更 | 查看變更詳情 |