All Products
Search
Document Center

Platform For AI:ListJobs

Last Updated:Mar 14, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Queries a list of jobs and supports pagination, sorting, and filtering by conditions.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
paidlc:ListJobsget
*All Resources
*
    none
none

Request syntax

GET /api/v1/jobs HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
DisplayNamestringNo

The job name. Fuzzy query is supported. The name is case-insensitive. Wildcards are not supported. For example, if you enter test, test-job1, job-test, job-test2, or job-test can be matched, and job-t1 cannot be matched. The default value null indicates any job name.

tf-mnist-test
JobTypestringNo

The job type. You can query any job type. The default value null indicates any job type. Valid values:

  • TFJob
  • PyTorchJob
  • XGBoostJob
  • OneFlowJob
  • ElasticBatchJob
TFJob
StatusstringNo

The job status. Valid values:

  • Creating
  • Queuing
  • Bidding (only available for spot jobs that use Lingjun resources)
  • EnvPreparing
  • SanityChecking
  • Running
  • Restarting
  • Stopping
  • SucceededReserving
  • FailedReserving
  • Succeeded
  • Failed
  • Stopped
Running
StartTimestringNo

The start time of the query. Use the job creation time to filter data. The default value is the current time minus seven days. In other words, if you do not configure the StartTime and EndTime parameters, the system queries the job list in the last seven days.

2020-11-08T16:00:00Z
EndTimestringNo

The end time of the query. Use the job creation time to filter data. The default value is the current time.

2020-11-09T14:45:00Z
PageNumberintegerNo

The number of the page to return for the current query. Minimum value: 1. Default value: 1.

1
PageSizeintegerNo

The number of entries per page.

50
SortBystringNo

The sorting field in the returned job list. Valid values:

  • DisplayName
  • JobType
  • Status
  • GmtCreateTime
  • GmtFinishTime
GmtCreateTime
OrderstringNo

The sorting order. Valid values:

  • desc (default)
  • asc
desc
ShowOwnbooleanNo

Specifies whether to query only the jobs submitted by the current user.

true
WorkspaceIdstringNo

The workspace ID.

1****
ResourceIdstringNo

The resource group ID. For information about how to obtain the ID of a dedicated resource group, see Manage resource quota.

r*****
BusinessUserIdstringNo

The ID of the user associated with the job.

16****
CallerstringNo

The caller.

local
TagsobjectNo

The tags.

stringNo

The tag.

recommandation
PipelineIdstringNo

The specific pipeline ID used to filter jobs.

flow-*******
FromAllWorkspacesbooleanNo

Specifies whether to query a list of jobs across workspaces. This parameter must be used together with ShowOwn=true. You can use this parameter to query a list of jobs recently submitted by the current user.

false
JobIdstringNo

The job ID. Fuzzy query is supported. The name is case-insensitive. Wildcards are not supported. The default value null indicates any job ID.

dlc********
UserIdForFilterstringNo

The user ID used to filter jobs.

20**************
UsernamestringNo

The username used to filter jobs. Fuzzy search is supported. Wildcards are not supported. The default value null indicates that jobs are not filtered by username.

test***
ResourceQuotaNamestringNo

The resource quota name used to filter jobs. Fuzzy search is supported. Wildcards are not supported. The default value null indicates that jobs are not filtered by resource quota name.

quota***
AccessibilitystringNo

The job visibility. Valid values:

  • PUBLIC: The job is visible to all members in the workspace.
  • PRIVATE: The job is visible only to you and the administrator of the workspace.
PRIVATE
OversoldInfostringNo

The Idle resource information. Valid values:

  • ForbiddenQuotaOverSold
  • ForceQuotaOverSold
  • AcceptQuotaOverSold-true (true indicates that the job uses idle resources.)
  • AcceptQuotaOverSold-false (false indicates that the job uses guaranteed resources.)
ForbiddenQuotaOverSold

Response parameters

ParameterTypeDescriptionExample
object

The jobs.

Jobsarray

The jobs.

JobsJobItem

The job.

TotalCountlong

The total number of jobs that meet the filter conditions.

2
RequestIdstring

The request ID used to troubleshoot issues.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "Jobs": [
    {
      "JobId": "dlc-20210126170216-mtl37ge7gkvdz",
      "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.cn-hangzhou.aliyuncs.com/pai-dlc/tensorflow-training:1.12.2PAI-cpu-py27-ubuntu16.04",
          "ImageConfig": {
            "DockerRegistry": "registry.cn-hangzhou.aliyuncs.com",
            "Username": "",
            "Password": "",
            "Auth": ""
          },
          "PodCount": 1,
          "EcsSpec": "ecs.c6.large",
          "ExtraPodSpec": {
            "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": ""
                  },
                  "Requests": {
                    "key": ""
                  }
                }
              }
            ],
            "PodAnnotations": {
              "key": ""
            },
            "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": ""
                  },
                  "Requests": {
                    "key": ""
                  }
                }
              }
            ],
            "Lifecycle": {
              "PreStop": {
                "Exec": {
                  "Command": [
                    ""
                  ]
                }
              },
              "PostStart": {
                "Exec": {
                  "Command": [
                    ""
                  ]
                }
              }
            },
            "MainContainerSecurityContext": {
              "RunAsUser": 1000,
              "RunAsGroup": 1000,
              "SeccompProfile": {
                "Type": "Unconfined",
                "LocalhostProfile": "my-profiles/profile-allow.json"
              }
            },
            "SharedVolumeMountPaths": [
              "/root/share/"
            ],
            "PodLabels": {
              "key": ""
            }
          },
          "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-vf9lowjt3pso",
          "MountPath": "/mnt/data"
        }
      ],
      "CodeSource": {
        "CodeSourceId": "code-20210111103721-85qz78ia96lu",
        "Branch": "master",
        "Commit": "44da109b59f8596152987eaa8f3b2487bb72ea63",
        "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": "166924",
        "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",
        "EnableCPUAffinity": true,
        "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": [
        {
          "Status": "Stopped",
          "GmtFinishTime": "2021-01-12T15:36:05Z",
          "HistoryPods": [
            {
              "Status": "Stopped",
              "GmtFinishTime": "2021-01-12T15:36:05Z",
              "HistoryPods": [
                {
                  "Status": "Stopped",
                  "GmtFinishTime": "2021-01-12T15:36:05Z",
                  "HistoryPods": [],
                  "Type": "Worker",
                  "GmtStartTime": "2021-01-12T14:36:05Z",
                  "PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
                  "NodeName": "",
                  "Ip": "10.0.1.2",
                  "PodId": "dlc-20210126170216-mtl37ge7gkvdz-worker-0",
                  "SubStatus": "",
                  "GmtCreateTime": "2021-01-12T14:36:01Z"
                }
              ],
              "Type": "Worker",
              "GmtStartTime": "2021-01-12T14:36:05Z",
              "PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
              "NodeName": "",
              "Ip": "10.0.1.2",
              "PodId": "dlc-20210126170216-mtl37ge7gkvdz-worker-0",
              "SubStatus": "",
              "GmtCreateTime": "2021-01-12T14:36:01Z"
            }
          ],
          "Type": "Worker",
          "GmtStartTime": "2021-01-12T14:36:05Z",
          "PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
          "NodeName": "",
          "Ip": "10.0.1.2",
          "PodId": "dlc-20210126170216-mtl37ge7gkvdz-worker-0",
          "SubStatus": "",
          "GmtCreateTime": "2021-01-12T14:36:01Z"
        }
      ]
    }
  ],
  "TotalCount": 2,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-01-09The request parameters of the API has changedView Change Details
2024-11-21The request parameters of the API has changedView Change Details
2024-04-09The request parameters of the API has changedView Change Details
2024-01-12The request parameters of the API has changedView Change Details
2023-12-14The request parameters of the API has changedView Change Details
2022-11-29The request parameters of the API has changedView Change Details