All Products
Search
Document Center

Platform For AI:CreateJob

Last Updated:Feb 13, 2026

Creates a job to run in a cluster. You can specify information such as data source configurations, code source configurations, the start command, and compute resource configuration for each node where the job runs.

Operation description

Before you use this operation, review the billing methods and pricing for PAI-DLC.

Important The total length of all parameters for the CreateJob operation—including system-generated parameters—must not exceed 65,536 bytes.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

paidlc:CreateJob

create

*All Resource

*

None None

Request syntax

POST /api/v1/jobs HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body parameters.

DisplayName

string

Yes

The name of the job. The name must follow these rules:

  • The name can be up to 256 characters long.

  • It can contain digits, letters, underscores (_), periods (.), and hyphens (-).

tf-mnist-test

JobType

string

Yes

The job type. This parameter is case-sensitive. The supported job types are:

  • TFJob

  • PyTorchJob

  • MPIJob

  • XGBoostJob

  • OneFlowJob

  • ElasticBatchJob

  • SlurmJob

  • RayJob

  • DataJuicerJob

Valid values:

  • OneFlowJob :

    OneFlow

  • PyTorchJob :

    PyTorch

  • SlurmJob :

    Slurm

  • XGBoostJob :

    XGBoost

  • ElasticBatchJob :

    ElasticBatch

  • MPIJob :

    MPIJob

  • TFJob :

    Tensorflow

  • RayJob :

    Ray

TFJob

JobSpecs

array

Yes

JobSpecs describes the runtime configurations for the job, such as the registry address, start command, node resource declaration, and number of replicas.

A PAI-DLC job consists of different types of nodes. Nodes of the same type have the same configuration. This configuration is called a JobSpec. JobSpecs is an array of JobSpec objects that describes the configurations for all types of nodes.

JobSpec

No

The runtime configuration of the job.

UserCommand

string

Yes

The start command for all nodes in the job.

python /root/code/mnist.py

DataSources

array<object>

No

The list of data sources used by the job.

object

No

The list of all data sources that the job uses. Each data source is mounted to a local directory in the container of each node based on the data source configuration. The local directory is specified by the `MountPath` parameter in the data source configuration.

The process specified in the start command can then directly access the distributed file system of each data source through its `MountPath`.

DataSourceId

string

No

The ID of the data source.

d-cn9dl*******

MountPath

string

No

The path to which the data source is mounted for this job. This parameter is optional. By default, the mount path specified in the data source configuration is used.

/root/data

Uri

string

No

The path of the data source.

oss://bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/

Options

string

No

The mount properties for the custom dataset. Currently, only OSS is supported.

{ "fs.oss.download.thread.concurrency": "10", "fs.oss.upload.thread.concurrency": "10", "fs.jindo.args": "-oattr_timeout=3 -oentry_timeout=0 -onegative_timeout=0 -oauto_cache -ono_symlink" }

DataSourceVersion

string

No

MountAccess

string

No

EnableCache

boolean

No

CodeSource

object

No

The code source for the job. Before the job nodes start, PAI-DLC automatically downloads the code from the specified code source and mounts it to a local directory in the container.

CodeSourceId

string

No

The code source ID.

code-20210111103721-xxxxxxx

Branch

string

No

The branch of the code repository that the job references. This parameter is optional. By default, the branch specified in the code source configuration is used.

master

Commit

string

No

The commit ID of the code to download for the job. This parameter is optional. By default, the commit ID specified in the code source configuration is used.

44da109b5******

MountPath

string

No

The path to which the code source is mounted for this job. This parameter is optional. By default, the mount path specified in the code source configuration is used.

/root/data

UserVpc

object

No

The user's VPC configuration.

VpcId

string

No

The ID of the user's VPC.

vpc-abcdef****

SwitchId

string

No

The ID of the vSwitch. This parameter is optional.

  • If you do not specify this parameter, the system automatically selects a vSwitch based on resource availability.

  • You can also specify a vSwitch ID.

vs-abcdef****

SecurityGroupId

string

No

The ID of the security group.

sg-abcdef****

ExtendedCIDRs

array

No

The extended CIDR blocks.

  • If you do not specify a vSwitch ID, this parameter is optional. The system automatically obtains all CIDR blocks in the VPC.

  • If you specify a vSwitch ID, this parameter is required. Specify all CIDR blocks in the VPC.

string

No

An extended CIDR block.

192.168.0.1/24

DefaultRoute

string

No

The default route. Valid values:

eth0

ThirdpartyLibs

array

No

The list of third-party Python libraries to install.

string

No

Specify a third-party Python library and its version requirements, for example: numpy==1.16.1.

numpy==1.16.1

ThirdpartyLibDir

string

No

The name of the folder that contains the `requirements.txt` file for third-party Python libraries. Before PAI-DLC runs the specified `UserCommand` on each node, it retrieves the `requirements.txt` file from this folder and runs the pip install -r command to install the libraries.

/root/code/

Envs

object

No

The environment variable configuration.

string

No

An environment variable in the Key=Value format.

Important The environment variable must comply with POSIX standards.

ENABLE_DEBUG_MODE

JobMaxRunningTimeMinutes

integer

No

The maximum running time of the job in minutes.

1024

WorkspaceId

string

No

The workspace ID.

ws-20210126170216-xxxxxxx

ResourceId

string

No

The ID of the resource group. This parameter is optional.

  • If you do not specify this parameter, the job is submitted to the public resource group.

  • If a resource quota is attached to the current workspace, you can specify the corresponding resource quota ID. For more information about how to query the resource quota ID, see Manage resource quotas.

rs-xxx

Priority

integer

No

The priority of the job. This parameter is optional. The default value is 1. The value can be an integer from 1 to 9. A larger value indicates a higher priority.

  • 1 is the lowest priority.

  • 9 is the highest priority.

8

Settings JobSettings

No

Additional parameter settings for the job.

ElasticSpec

JobElasticSpec

No

This parameter is not supported. You can ignore it.

DebuggerConfigContent

string

No

This parameter is not supported. You can ignore it.

“”

Options

string

No

Additional configurations for the job. Use this parameter to adjust the behavior of mounted data sources. For example, if the job has an OSS data source mounted, you can set this parameter to fs.oss.download.thread.concurrency=4,fs.oss.download.queue.size=16 to overwrite the default parameters of JindoFS.

key1=value1,key2=value2

SuccessPolicy

string

No

The success policy for a distributed multi-node job. This is currently supported only for multi-node TensorFlow jobs.

  • ChiefWorker: If you set the policy to this value, the entire job is considered successful as long as the chief pod finishes successfully.

  • AllWorkers (default): The entire job is considered successful only after all worker pods finish successfully.

AllWorkers

CredentialConfig

CredentialConfig

No

The access credential configuration.

Accessibility

string

No

The visibility of the job. Valid values:

  • PUBLIC: The job is visible to everyone in the workspace.

  • PRIVATE: The job is visible only to you and the administrator in the workspace.

PRIVATE

CustomEnvs

array<object>

No

object

No

Key

string

No

Value

string

No

Visible

string

No

TemplateId

string

No

The ID of the job template.

tplabc1234567

TemplateVersion

integer

No

The version of the job template.

1

Response elements

Element

Type

Description

Example

object

The response is a string in the JSON format.

JobId

string

The ID of the job created by this call.

dlc7*******

RequestId

string

The ID of the request. It is used for diagnostics and support.

473469C7-AA6F-4DC5-B3DB-xxxxxxx

Examples

Success response

JSON format

{
  "JobId": "dlc7*******",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-xxxxxxx"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.