Updated on 2023-06-29 GMT+08:00

Creating a Common Task

Function

This API is used to create a common task (different from a composite task).

URI

POST /v2/{project_id}/fdi/instances/{instance_id}/tasks

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.

Minimum: 1

Maximum: 64

instance_id

Yes

String

Instance ID.

Minimum: 1

Maximum: 64

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

task

Yes

TaskBasicRequestBody object

Brief information about a task.

task_detail

Yes

String

Task details. For details about the parameter structure, see Data Integration Parameter Description > RawFormDataRequest in the Appendix.

Minimum: 1

Maximum: 2147483647

Table 4 TaskBasicRequestBody

Parameter

Mandatory

Type

Description

task_name

Yes

String

Task name. The value contains 3 to 100 characters, consisting of only letters, digits, periods (.), underscores (_), and hyphens (-). The value must start with a letter or digit.

Minimum: 3

Maximum: 100

task_type

Yes

String

Task type.

  • REALTIME (real-time)

  • TIMING (scheduled)

Minimum: 1

Maximum: 10

source_datasource_id

Yes

String

Data source ID at the source.

Minimum: 1

Maximum: 64

target_datasource_id

Yes

String

Data source ID at the destination.

Minimum: 1

Maximum: 64

description

No

String

Description.

Minimum: 1

Maximum: 1024

task_tag

No

String

Task tag, which can contain only letters, digits, hyphens (-), and underscores (_).

Minimum: 4

Maximum: 64

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

task

TaskBasicRsp object

Brief information about a task.

task_detail

String

Task details. For details about the parameter structure, see Data Integration Parameter Description > RawFormDataResponse in the Appendix.

Minimum: 1

Maximum: 2147483647

Table 6 TaskBasicRsp

Parameter

Type

Description

task_id

String

Task ID. This parameter can be left empty.

Minimum: 1

Maximum: 64

task_name

String

Task name. The value contains 3 to 100 characters, consisting of only letters, digits, periods (.), underscores (_), and hyphens (-). The value must start with a letter or digit.

Minimum: 3

Maximum: 100

task_type

String

Task type.

  • realtime (real-time)

  • timing (scheduled)

Minimum: 1

Maximum: 10

status

String

Task status.

  • stopped

  • running

Minimum: 0

Maximum: 1

project_id

String

Project ID.

Minimum: 1

Maximum: 64

source_datasource_id

String

Data source ID at the source.

Minimum: 1

Maximum: 64

target_datasource_id

String

Data source ID at the destination.

Minimum: 1

Maximum: 64

source_datasource_name

String

Name of the source data source.

Minimum: 1

Maximum: 64

target_datasource_name

String

Name of the destination data source.

Minimum: 1

Maximum: 64

source_app_id

String

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

Minimum: 1

Maximum: 64

target_app_id

String

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

Minimum: 1

Maximum: 64

source_app_name

String

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

Minimum: 1

Maximum: 64

target_app_name

String

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

Minimum: 1

Maximum: 64

created_date

Integer

Date created.

Minimum: 0

Maximum: 99999999999999999999

last_modified_date

Integer

Last modification time.

Minimum: 0

Maximum: 99999999999999999999

description

String

Description. This parameter is not displayed when the request parameter is empty.

Minimum: 1

Maximum: 1024

task_tag

String

Task tag, which can contain only letters, digits, hyphens (-), and underscores (_). This parameter is not displayed when the request parameter is empty.

Minimum: 4

Maximum: 64

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Example Requests

{
  "task" : {
    "task_name" : "fdi_task_v2mysql-tomysql",
    "task_type" : "TIMING",
    "source_datasource_id" : "30969b205e8f4392a25fb321112d1753",
    "target_datasource_id" : "30969b205e8f4392a25fb321112d1753",
    "description" : "mysql",
    "task_tag" : "fdi_autotest"
  },
  "task_detail" : "{\"sourceSelectedDatasource\":{\"dataTimestamp\":1606807799782,\"isNeedPageSrcApi\":true,\"pageKeySrcApi\":\"pageNum\",\"pageSizeKeySrcApi\":\"pageSize\",\"resultTotalRootPath\":\"\",\"isUseDynamicSignal\":false,\"timeshift\":\"\",\"startTimeKey\":\"\",\"beginDateColSrcApi\":\"beginTime\",\"endDateColSrcApi\":\"endTime\",\"rootPath\":\"\",\"sourceParams\":[{\"keys\":\"pageNum\",\"value\":\"0\"},{\"keys\":\"pageSize\",\"value\":\"10\"},{\"keys\":\"beginTime\",\"value\":\"1\"},{\"keys\":\"endTime\",\"value\":\"1\"}],\"sourceHeaders\":[],\"sourceBodyType\":\"raw-json\",\"bodyRaw\":\"{\\\"pageNum\\\":\\\"1\\\",\\\"pageSize\\\":\\\"10\\\"}\",\"sourceBodyFormData\":[],\"sourceResponseType\":\"json\",\"sourceMetaData\":{\"dataSource\":[{\"index\":0,\"name\":\"name\",\"type\":\"String\",\"format\":\"\",\"path\":\"\"},{\"index\":1,\"name\":\"age\",\"type\":\"Integer\",\"format\":\"\",\"path\":\"\"}],\"mode\":\"keyValue\"},\"incr_migration_type\":\"systemDefault\",\"period_granularity\":\"\",\"period_assignment\":\"\",\"period_right_boarder\":\"\",\"pagingEndType\":\"paging-list\",\"pagingEndFieldPath\":\"\",\"pageNumLimit\":\"1\",\"servicetype\":\"None\",\"current_page_num\":\"1\",\"page_size\":\"10\",\"need_inc_migration\":true,\"date_form\":\"unix_ms\",\"timeZone\":\"GMT+08:00\",\"reset_incr_begin_time\":false,\"compensation_time\":\"0\",\"advanceStartTime\":\"0\",\"advanceStartTimeUnit\":\"day\",\"isParse\":\"true\"},\"targetSelectedDatasource\":{\"targetNeedCreateTable\":false,\"isSupportClearTab\":false,\"targetTable\":\"CDCMODEL.NODE\",\"batchNumber\":\"\",\"targetSelectedColumnList\":[{\"field_name\":\"NODE_ID\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"0\",\"unique\":\"1\"},{\"field_name\":\"AVAILABILITY_ZONE\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"CACHE_PORT\",\"field_type\":\"VARCHAR2\",\"field_length\":\"8\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"FLOATING_IP_ADDRESS\",\"field_type\":\"VARCHAR2\",\"field_length\":\"32\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"NAME\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"NODE_TYPE\",\"field_type\":\"VARCHAR2\",\"field_length\":\"255\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"PRIVATE_IP\",\"field_type\":\"VARCHAR2\",\"field_length\":\"32\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"USER_NAME\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"PRIVATE_KEY\",\"field_type\":\"VARCHAR2\",\"field_length\":\"2048\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"ROOT_PASSWORD\",\"field_type\":\"VARCHAR2\",\"field_length\":\"2048\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"SERVER_ID\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"STATUS\",\"field_type\":\"VARCHAR2\",\"field_length\":\"255\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"SUBNET_ID\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"0\",\"unique\":\"0\"},{\"field_name\":\"SUBNET_NAME\",\"field_type\":\"VARCHAR2\",\"field_length\":\"256\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"INSTANCE_ID\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"DATAVOLUME_ID\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"CACHE_ROLE\",\"field_type\":\"VARCHAR2\",\"field_length\":\"255\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"RES_SUBNET_IP\",\"field_type\":\"VARCHAR2\",\"field_length\":\"32\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"SYSTEMVOLUME_ID\",\"field_type\":\"VARCHAR2\",\"field_length\":\"64\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"SYSADMIN_PASSWORD\",\"field_type\":\"VARCHAR2\",\"field_length\":\"2048\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"NEW_ROOT_PASSWD\",\"field_type\":\"VARCHAR2\",\"field_length\":\"2048\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"NEW_SYSADMIN_PASSWD\",\"field_type\":\"VARCHAR2\",\"field_length\":\"2048\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"ROOT_PASSWORD_OVERDUE_TIME\",\"field_type\":\"TIMESTAMP(6)\",\"field_length\":\"0\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"OPERATION_MSG\",\"field_type\":\"VARCHAR2\",\"field_length\":\"2048\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"RES_SUBNET_IP_BETA\",\"field_type\":\"VARCHAR2\",\"field_length\":\"32\",\"null_able\":\"1\",\"unique\":\"0\"},{\"field_name\":\"METRIC_DATA\",\"field_type\":\"VARCHAR2\",\"field_length\":\"2048\",\"null_able\":\"1\",\"unique\":\"0\"}],\"supportPartUpdate\":false},\"mappingTable\":[],\"mappingInput\":{\"dataSource\":[{\"sourceKey\":\"name\",\"targetKey\":\"RES_SUBNET_IP_BETA\"},{\"sourceKey\":\"age\",\"targetKey\":\"METRIC_DATA\"}]},\"mappingRequired\":true,\"error_handler\":{\"path\":\"data1\",\"datasource_id\":\"79c4caaa3e1441dfb0351038fcf5f281\",\"mode\":\"OBS\",\"app_id\":\"73965e3c-72b2-40c3-8335-2154ebd6c23a\",\"stop_task_when_obs_failure\":false},\"afterImplementation\":{\"actionType\":\"KAFKA\",\"appId\":\"73965e3c-72b2-40c3-8335-2154ebd6c23a\",\"datasourceId\":\"a87a31a6288e4698865be122ae485dc0\",\"topic\":\"lgytest99\",\"messageContent\":\"success\"}}"
}

Example Responses

Status code: 200

OK

null

Status Codes

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.