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
Test
RAM authorization
|
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: |
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.