Last updated: 2020-07-31 11:59:43

1. API Description

Domain name for API request:

This API is used to submit a instance.

A maximum of 7 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: SubmitJob.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
Placement Yes Placement Location information of the submitted job. This parameter allows you to specify information such as the availability zone of the CVM instance with which the job is associated.
Job Yes Job Job information
ClientToken No String The string used to guarantee the idempotency of the request, which is generated by the user and must be unique for different requests. The maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed.

3. Output Parameters

Parameter Name Type Description
JobId String When a job is submitted through this API, this parameter is returned and indicates the job ID. Returning the list of job IDs does not mean that the job is parsed/executed successfully. The job state can be queried using the DescribeJob API.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Submitting a DAG-type job containing dependencies

Input Example
&Job.Tasks.0.Application.Command=echo pre_task
&Job.Tasks.1.Application.Command=echo post_task
&<Common request parameter>

Output Example

  "Response": {
    "JobId": "job-2bmv4p7o",
    "RequestId": "165dc518-52a4-4363-8ea4-14f1ee8dea1a"

Example2 Submitting a Job

Input Example
&Job.Tasks.0.Application.Command=python -c "fib=lambda n:1 if n<=2 else fib(n-1)+fib(n-2); print(fib(20))"
&<Common request parameter>

Output Example

  "Response": {
    "JobId": "job-4yn0we13",
    "RequestId": "bf2a9734-e485-423f-9d73-a93f5e6c6a0c"

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.


TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AllowedOneAttributeInEnvIdAndComputeEnv One (and only one) parameter must be specified for ComputeEnv and EnvId.
InternalError Internal error
InternalError.CallCvm An error is returned for the CVM API call.
InvalidParameter.CvmParameters Invalid CVM parameter.
InvalidParameter.JobDescriptionTooLong The instance description is too long.
InvalidParameter.JobNameTooLong The instance name is too long.
InvalidParameter.NotificationEventNameDuplicate Duplicate message notification event name.
InvalidParameter.NotificationTopicName Invalid topic name.
InvalidParameter.NotificationTopicNameTooLong The topic name is too long.
InvalidParameter.TaskName Invalid job name.
InvalidParameter.TaskNameTooLong The task name is too long.
InvalidParameterValue.ComputeEnv Compute environment parameter validation failed.
InvalidParameterValue.DependenceNotFoundTaskName The dependent task definition was not found.
InvalidParameterValue.DependenceUnfeasible Loop task dependency is prohibited.
InvalidParameterValue.LocalPath Invalid local storage path.
InvalidParameterValue.MaxRetryCount The number of retries is too large.
InvalidParameterValue.Negative Invalid negative parameter.
InvalidParameterValue.RemoteStoragePath Invalid storage path format.
InvalidParameterValue.RemoteStorageSchemeType Invalid storage type.
LimitExceeded.JobQuota Insufficient instance quota.
UnauthorizedOperation.UserNotAllowedToUseBatch It is prohibited to use the BatchCompute service.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback