Updated on 2024-04-29 GMT+08:00

Querying Completed Tasks

Function

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

URI

  • URI format

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

  • 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.

    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.

Request Parameters

Table 2 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.

X-Auth-Token

No

String

IAM Token

Minimum length: 0

Maximum length: 4096

Response Parameters

Table 3 Parameters

Parameter

Mandatory

Type

Description

yesterday

No

array[object]

Task information of the previous day. For details, see task_record structure.

average

No

array[object]

Task information over the last seven days. For details, see task_record structure.

today

No

array[object]

Task information of the current day. For details, see task_record structure.

Table 4 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.  "
    }