Last updated: 2021-01-28 19:55:23

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 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 parameters>

Output Example

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

Example2 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 parameters>

Output Example

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

5. Developer Resources


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.EnvIdMalformed Invalid compute environment ID format.
InvalidParameter.ImageIdMalformed Incorrect image ID.
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.LimitExceeded The number of filter parameter values exceeds the limit.
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.
InvalidZone.MismatchRegion The specified zone does not exist.
LimitExceeded.JobQuota Insufficient instance quota.
ResourceNotFound.ComputeEnv The specified compute environment does not exist.
UnauthorizedOperation.UserNotAllowedToUseBatch It is prohibited to use the BatchCompute service.