Updated on 2025-09-18 GMT+08:00

Querying Completed Tasks

Function

This API is used to query the tasks completed on the current day, the previous day, and over the last seven days.

URI

  • URI format

    GET /v2/{project_id}/factory/monitor/task-completion-data

  • Parameter description
    Table 1 URI parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain a project ID, see Project ID and Account ID.

    Table 2 Query parameters

    Parameter

    Mandatory

    Type

    Description

    type

    No

    String

    Type of the tasks to be queried. The default value is all, indicating that all types of tasks will be queried. The following job operators are supported: Dummy, CDM Job, MRS Hive SQL, MRS Spark SQL, DLI SQL, DLI Spark, Python, DWS SQL, or Shell.

    NOTE:

    The above operators are only examples.

    This API collects successfully executed instances once an hour. A task is a job operator.

    start_day

    No

    String

    Date for obtaining the task completion status, which is in yyyy-MM-dd format. The default value is today.

    start_time

    No

    Integer

    Start time for obtaining the task completion status. The default value is 00:00. The value is on the hour and ranges from 0 to 23.

    NOTE:

    For example, if start_day is 2025-01-18, and start_time is 10:

    The tasks completed during the following time periods are returned:

    2025-01-18 10:00:00 to 2025-01-19 09:59:59: one day starting from 2025-01-18 10:00:00

    2025-01-17 10:00:00 to 2025-01-18 09:59:59: previous day

    2025-01-11 10:00:00 to 2025-01-18 09:59:59: average number of tasks completed over the last seven days

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

workspace

No

String

Workspace ID

  • If this parameter is not set, data in the default workspace is queried by default.
  • To query data in other workspaces, this header must be carried.
    NOTE:
    • You need to specify a workspace for multiple DataArts Studio instances.
    • This parameter is mandatory if no default workspace is available. If you do not set it, an error is reported.

X-Auth-Token

No

String

IAM Token

Minimum length: 0

Maximum length: 4096

Response Parameters

Table 4 Parameters

Parameter

Mandatory

Type

Description

yesterday

No

array[object]

Tasks of the previous day. For details, see the task_record structure.

average

No

array[object]

Tasks of the last seven days on average. For details, see the task_record structure.

today

No

array[object]

Tasks of the current day. For details, see the task_record structure.

Table 5 task_record parameters

Parameter

Mandatory

Type

Description

record_time

No

Long

Time point. The value is a 13-digit timestamp.

task_completion_num

No

Long

Number of tasks completed at the current time point.

Example Request

GET /v2/b384b9e9ab9b4ee8994c8633aabc9505/factory/monitor/task-completion-data?type=all

Example Response

  • Success response

    HTTP status code 200

    {
        "yesterday": [
            {
                "record_time": 1704124800000,
                "task_completion_num": 0
            },
            {
                "record_time": 1704128400000,
                "task_completion_num": 0
            },
            {
                "record_time": 1704132000000,
                "task_completion_num": 0
            }
        ],
        "average": [
            {
                "record_time": 1704124800000,
                "task_completion_num": 0
            },
            {
                "record_time": 1704128400000,
                "task_completion_num": 0
            },
            {
                "record_time": 1704132000000,
                "task_completion_num": 0
            }
        ],
        "today": [
            {
                "record_time": 1704124800000,
                "task_completion_num": 0
            },
            {
                "record_time": 1704128400000,
                "task_completion_num": 0
            },
            {
                "record_time": 1704132000000,
                "task_completion_num": 0
            }
         ]
    }
  • Failure response

    HTTP status code 400

    {
        "error_code": "DLF.3051",
        "error_msg": "The request parameter is invalid.  "
    }