tencent cloud

Feedback

TerminateTaskInstance

Last updated: 2023-05-04 15:47:07

1. API Description

Domain name for API request: batch.tencentcloudapi.com.

This API is used to terminate a task instance.
SUCCEED and FAILED task instances: No action
SUBMITTED, PENDING, and RUNNABLE task instances: Change status to FAILED.
STARTING, RUNNING and FAILED_INTERRUPTED task instances: If EnvId is not specified, the CVM instance is terminated, and then the task status goes to FAILED. If EnvId is specified, the task instance changes to FAILED, then the related CVM instance is restarted.
FAILED_INTERRUPTED task instances: The related resources and quotas will be released only after the termination actually succeeds.

A maximum of 2 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 Params. The value used for this API: TerminateTaskInstance.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region No String Common Params. This parameter is not required for this API.
JobId Yes String Job ID
TaskName Yes String Task name
TaskInstanceIndex Yes Integer Task instance index

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Terminating a task instance

Input Example

https://batch.tencentcloudapi.com/?Action=TerminateTaskInstance
&JobId=job-rybewp57
&TaskName=A
&TaskInstanceIndex=0
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "72e9a712-1fed-4b57-be72-62e71eefd4c3"
    }
}

5. Developer Resources

SDK

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
InternalError Internal error.
InvalidParameter.JobIdMalformed Invalid job ID format.
ResourceNotFound.TaskInstance The specified task instance does not exist.
UnsupportedOperation.TerminateOperationWithEnvId This operation is prohibited for the task instances in the specified compute environment.