Updated on 2025-03-26 GMT+08:00

Querying the Task Monitoring Information List

Function

This API is used to query the monitoring information about all tasks.

URI

GET /v2/{project_id}/fdi/instances/{instance_id}/task-monitors

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Appendix > Obtaining a Project ID in the ROMA Connect API Reference.

instance_id

Yes

String

Instance ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Offset, where the query starts. The value starts from 1 (the value 0 is treated as 1).

limit

No

Integer

Number of records displayed on each page. The maximum value is 999. Excessive records are not returned.

task_name

No

String

Name of the task to be searched for. Fuzzy search is supported. This parameter is case sensitive and optional. If this parameter is left empty, the system searches for all tasks.

execute_status

No

String

Execution status of the task to be searched for. This parameter is optional. If it is left empty, the system searches for all tasks.

  • UNSTARTED

  • WAITING

  • RUNNING

  • SUCCESS

  • CANCELLED

  • ERROR

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Total number.

size

Integer

Number of monitoring records on the current page.

entities

Array of TaskMonitorInfo objects

Elements on the current page of task monitoring information.

Table 5 TaskMonitorInfo

Parameter

Type

Description

task_id

String

Task ID.

task_name

String

Task name.

task_type

String

Task type.

  • REALTIME (real-time)

  • TIMING (scheduled)

status

Integer

Task status:

  • 0 (stopped)

  • 1 (running)

last_execute_time

Integer

Latest time when a task is executed. The value is in the format of timestamp(ms) and uses the UTC time zone.

use_quartz_cron

Boolean

Whether a task uses the Quartz expression. This parameter is available only for scheduled tasks.

cron

String

Cron expression. This parameter is available only when the scheduled task is used and use_quartz_cron is set to true.

period

String

Unit of the scheduling period, such as day and hour. This parameter is available only for scheduled tasks and when use_quartz_cron is set to false.

  • MIN (minute)

  • HOUR (hour)

  • DAY (day)

  • WEEK (week)

  • MON (month)

dispatch_interval

Integer

Scheduling period, which is used together with the period field to determine the scheduling interval. This parameter is available only when the scheduled task is used and use_quartz_cron is set to false.

position

String

Phase to which the latest task is executed.

  • ADAPTER (initialization phase)

  • READER (reader phase)

  • WRITER (writer phase)

execute_status

String

Last execution status of a task.

  • UNSTARTED

  • WAITING

  • RUNNING

  • SUCCESS

  • CANCELLED

  • ERROR

source_app_id

String

ID of the application to which the source data source of the task belongs.

source_app_name

String

Name of the application to which the source data source of the task belongs.

source_instance_id

String

ID of the instance to which the source data source of the task belongs.

target_app_id

String

ID of the application to which the destination data source belongs.

target_app_name

String

Name of the application to which the destination data source belongs.

target_instance_id

String

ID of the instance to which the destination data source belongs.

ext_type

String

Extended task type. If the current task is a CDC composite task, the value of this field is CDC. Otherwise, the value is null.

enterprise_project_id

String

ID of the enterprise project to which the task belongs. The default value is 0.

task_tag

String

Task tag.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "total" : 99999,
  "size" : 99999,
  "entities" : [ {
    "task_id" : "id123456789",
    "task_name" : "fdi_task_name",
    "task_type" : "TIMING",
    "status" : 0,
    "last_execute_time" : 1603243428000,
    "use_quartz_cron" : false,
    "cron" : "0 */15 * * * ?",
    "period" : "DAY",
    "dispatch_interval" : 1,
    "position" : "READER",
    "execute_status" : "RUNNING",
    "source_app_id" : "28f61af50fc9452aa0ed5ea25c3cc3d3",
    "source_app_name" : "source-app",
    "source_instance_id" : "source-instance",
    "target_app_id" : "28f61af50fc9452aa0ed5ea25c3cc3d3",
    "target_app_name" : "target-app",
    "target_instance_id" : "target-instance",
    "ext_type" : "CDC",
    "enterprise_project_id" : "string",
    "task_tag" : "string"
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.