All Products
Search
Document Center

Elastic High Performance Computing:CreateJob

Last Updated:Jun 11, 2026

Membuat pekerjaan untuk kluster.

Deskripsi operasi

Before you call this operation, make sure that you understand the billing and pricing of E-HPC.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

ehpc:CreateJob

create

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

ID kluster.

Anda dapat memanggil operasi ListClusters untuk mengkueri ID kluster.

ehpc-hz-FYUr32****

JobName

string

No

Nama pekerjaan.

TestJob

JobSpec

object

No

Konfigurasi pekerjaan.

CommandLine

string

Yes

The command or script that is used to run the job. If you want to use a command, you must specify the full path of the command, for example, /bin/ping.

If you want to use a script, you must make sure that you have the execution permissions on it. By default, the user root directory ~/ is used as the default script path on the cluster side. If your script is not in that directory, you must specify the full path in this parameter, such as /home/xxx/job.sh Note that in this mode, if requirements on resources such as CPU and memory are specified in the script, the job will be run based on the resource requirements specified in the script. In this case, do not specify resource requirements in the Resource parameter. Otherwise, the job may fail to run.

If you want to run the job directly by using the CLI, you must specify the absolute path of the command and add two hyphens and a space (-- ) before the path, such as -- /bin/ping -c 10 localhost.

/home/xxx/test.job

RunasUser

string

No

The cluster-side user as which you want to submit the job.

testuser

RunasUserPassword

string

No

The password of the user specified by the RunasUser parameter.

xxx

Priority

string

No

The job priority.

1

StdoutPath

string

No

The path of the standard output file of the job. You need to specify the full path.

/home/xxx/job.out

StderrPath

string

No

The path of the standard error output file of the job. You need to specify the full path.

/home/xxx/job.err

JobQueue

string

No

The queue to which the job belongs.

comp

ArrayRequest

string

No

The jobs in the queue.

Format: X-Y:Z. X is the minimum index value. Y is the maximum index value. Z is the step size. For example, 2-7:2 indicates that three jobs need to be run and their index values are 2, 4, and 6.

1-5:2

Variables

string

No

The environment variables of the job. The value is a string in the JSON array format. Each array member is a JSON object that contains two members: Name and Value. Name indicates the name of the environment variable, and Value indicates the value of the environment variable.

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

PostCmdLine

string

No

The post-processing command of the job.

/bin/sleep 10

WallTime

string

No

The maximum duration for which the job can be run. Format: hour: minute: second. For example, 01:00:00 indicates 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 size to be allocated to each compute node. The memory size is in string format. Unit: MB or GB.

4gb

Gpus

integer

No

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

1

Elemen respons

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 was successful.

true

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

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

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.