All Products
Search
Document Center

Elastic High Performance Computing:CreateJob

Last Updated:Aug 28, 2026

Creates a job for a specified E-HPC cluster.

Operation description

Before you call this operation, read the E-HPC billing overview.

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

ehpc:CreateJob

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID. You can call ListClusters to query the cluster ID.

ehpc-hz-FYUr32****

JobName

string

No

The job name.

TestJob

JobSpec

object

No

The job configurations.

CommandLine

string

Yes

The command or script to run. Specify the full path, for example, /bin/ping.

For scripts, ensure execution permissions are granted. The default script path on the cluster side is ~/. If the script is elsewhere, specify the full path, such as /home/xxx/job.sh. If the script specifies resource requirements (CPU, memory), do not set the Resources parameter. Otherwise, the job may fail to run.

To run a command directly through the CLI, prefix the absolute path with two hyphens and a space (-- ), such as -- /bin/ping -c 10 localhost.

/home/xxx/test.job

RunasUser

string

No

The cluster user that submits the job.

testuser

RunasUserPassword

string

No

The password of the RunasUser.

xxx

Priority

string

No

The job priority.

1

StdoutPath

string

No

The full path of the job standard output file.

/home/xxx/job.out

StderrPath

string

No

The full path of the job standard error file.

/home/xxx/job.err

JobQueue

string

No

The queue to which the job belongs.

comp

ArrayRequest

string

No

The array job index range. Format: X-Y:Z, where X is the minimum index, Y is the maximum index, and Z is the step size. For example, 2-7:2 runs three jobs with index values 2, 4, and 6.

1-5:2

Variables

string

No

The job environment variables in JSON array format. Each element contains Name and Value fields.

[{"Name":"x", "Value":"y"}]

PostCmdLine

string

No

The post-processing command of the job.

/bin/sleep 10

WallTime

string

No

The maximum job runtime. Format: hour:minute:second. For example, 01:00:00 means 1 hour.

360:48:50

Resources

object

No

The resource configurations of the job.

Nodes

integer

No

The number of compute nodes to be allocated to the job.

2

Cores

integer

No

The number of vCPUs to be allocated to each compute node.

2

Memory

string

No

The memory allocated to each compute node. Unit: MB or GB.

4gb

Gpus

integer

No

The number of GPUs to be allocated to each compute node.

1

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

A0A38A38-1565-555E-B597-E48A2E******

JobId

string

The job ID.

Submitted batch job 10\n

Success

string

Indicates whether the request succeeded.

true

Examples

Success response

JSON format

{
  "RequestId": "A0A38A38-1565-555E-B597-E48A2E******",
  "JobId": "Submitted batch job 10\\n",
  "Success": "true"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The specified parameter %s is invalid. The specified parameter %s is invalid.
403 InvalidClusterStatus The operation failed due to invalid cluster status. The cluster status does not support the operation.
404 ClusterNotFound The specified cluster does not exist. The specified instance does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server The request has failed due to a temporary failure of the server.
406 EcsError An error occurred while calling the ECS API operation. ECS API call error. %s
406 AgentError The agent service request failed: %s Operation unsuccessful: %s
406 AgentError.Job.SubmitFailure Failed to submit jobs: %s Failed to submit the jobs.
406 AgentError.Job.DeleteFailure Failed to delete job: %s Failed to delete the job: {}
406 AgentError.Job.InvalidContainerType Unsupported container type: %s. The container type is not supported: %s.
406 AgentError.Job.ListFailure Failed to list jobs: %s. Failed to obtain the job list: %s
406 AgentError.Job.RerunFailure Failed to run the job again: %s. Failed to run the job again: %s
406 AgentError.Job.StopFailure Failed to stop jobs: %s. Failed to stop the job: %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.