Creates a job for a specified cluster.
Operation description
Before you use this operation, make sure that you fully understand the billing of Elastic High Performance Computing (E-HPC) and its pricing.
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 configuration information. |
|
| CommandLine |
string |
Yes |
The command or script to run the job. If you specify a command, provide the full path, such as /bin/ping. If you want to run the job by using a script, the script must have executable permissions. The cluster uses the user's home directory (~/) as the default script path. If your script is not in this directory, specify the full path in this parameter, such as /home/xxx/job.sh. In this case, if the script specifies resource requirements such as CPU and memory, the job uses the resources specified in the script. Do not specify resource requirements in the Resource parameter. Otherwise, the job may fail. If you want to run the job directly by using a command-line command, specify the absolute path of the command and add -- before it, such as -- /bin/ping -c 10 localhost. |
/home/xxx/test.job |
| RunasUser |
string |
No |
The user that submits the job. This user must be a cluster-side user. |
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 standard output file of the job. Specify the full path. |
/home/xxx/job.out |
| StderrPath |
string |
No |
The standard error output file of the job. Specify the full path. |
/home/xxx/job.err |
| JobQueue |
string |
No |
The queue to which the job belongs. |
comp |
| ArrayRequest |
string |
No |
The array job parameter. The format is X-Y:Z, where X is the minimum value (first index), Y is the maximum value (last index), and Z is the step size. For example, 2-7:2 indicates that the job queue contains three sub-jobs numbered 2, 4, and 6. |
1-5:2 |
| Variables |
string |
No |
The environment variables of the job. The value is a JSON array string. Each array element is a JSON object that contains two members: Name specifies the name of the environment variable, and Value specifies 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 running time of the job. The format is |
360:48:50 |
| Resources |
object |
No |
The resource configuration required by the job. |
|
| Nodes |
integer |
No |
The number of compute nodes to allocate for the job. |
2 |
| Cores |
integer |
No |
The number of CPU cores to allocate per compute node for the job. |
2 |
| Memory |
string |
No |
The memory size to allocate per compute node for the job. The value is a string that includes the unit: mb (megabytes) or gb (gigabytes). |
4gb |
| Gpus |
integer |
No |
The number of GPUs to allocate per compute node for the job. |
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 call was successful. |
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.