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

1. API Description

Domain name for API request:

This API is used to query the details of a specified task, including information of the task instances inside the task.

A maximum of 3 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: DescribeTask.
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.
JobId Yes String Instance ID
TaskName Yes String Task name
Offset No Integer Offset
Limit No Integer Number of returned results. Default value: 100. Maximum value: 1,000.
Filters.N No Array of Filter Filter as detailed below:
  • task-instance-type - String - Required: No - (Filter) Filter by task instance state. (SUBMITTED: submitted; PENDING: pending; RUNNABLE: runnable; STARTING: starting; RUNNING: running; SUCCEED: succeeded; FAILED: failed; FAILED_INTERRUPTED: instance retained after failure).
  • 3. Output Parameters

    Parameter Name Type Description
    JobId String Instance ID
    TaskName String Job name
    TaskState String Job state
    CreateTime String Creation time
    EndTime String End time
    TaskInstanceTotalCount Integer Total number of task instances
    TaskInstanceSet Array of TaskInstanceView Task instance information
    TaskInstanceMetrics TaskInstanceMetrics Task instance statistical metrics
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying task details

    Input Example
    &<Common request parameters>

    Output Example

      "Response": {
        "TaskInstanceSet": [
            "TaskInstanceIndex": 1,
            "RedirectInfo": {
              "StderrRedirectFileName": "stderr.job-97zcl3wt.A.1.log",
              "StdoutRedirectFileName": "stdout.job-97zcl3wt.A.1.log",
              "StdoutRedirectPath": "cos://",
              "StderrRedirectPath": "cos://"
            "RunningTime": "2018-02-07T09:29:55Z",
            "StateIfCreateCvmFailed": "FAILED",
            "LaunchTime": "2018-02-07T09:29:09Z",
            "StateReason": "",
            "ComputeNodeInstanceId": null,
            "EndTime": "2018-02-07T09:30:23Z",
            "TaskInstanceState": "SUCCEED",
            "CreateTime": "2018-02-07T09:29:09Z",
            "ExitCode": 0
            "TaskInstanceIndex": 0,
            "RedirectInfo": {
              "StderrRedirectFileName": "stderr.job-97zcl3wt.A.0.log",
              "StdoutRedirectFileName": "stdout.job-97zcl3wt.A.0.log",
              "StdoutRedirectPath": "cos://",
              "StderrRedirectPath": "cos://"
            "RunningTime": "2018-02-07T09:30:02Z",
            "StateIfCreateCvmFailed": "FAILED",
            "LaunchTime": "2018-02-07T09:29:09Z",
            "StateReason": "",
            "ComputeNodeInstanceId": null,
            "EndTime": "2018-02-07T09:30:31Z",
            "TaskInstanceState": "SUCCEED",
            "CreateTime": "2018-02-07T09:29:09Z",
            "ExitCode": 0
        "TaskState": "SUCCEED",
        "JobId": "job-97zcl3wt",
        "TaskInstanceMetrics": {
          "PendingCount": 0,
          "FailedCount": 0,
          "StartingCount": 0,
          "SucceedCount": 2,
          "FailedInterruptedCount": 0,
          "SubmittedCount": 0,
          "RunnableCount": 0,
          "RunningCount": 0
        "TaskInstanceTotalCount": 2,
        "TaskName": "A",
        "EndTime": "2018-02-07T09:30:31Z",
        "CreateTime": "2018-02-07T09:29:09Z",
        "RequestId": "f4723b24-e080-4599-b12d-b7eb657faefe"

    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
    InternalError Internal error.
    InvalidParameter.JobIdMalformed Invalid instance ID format.
    ResourceNotFound.Task The specified job task does not exist.