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 body parameters

Parameter

Mandatory

Type

Description

task

No

TaskBasicRequestBody object

Brief information about a task.

task_detail

No

String

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

Minimum: 1

Maximum: 2147483647

Table 3 TaskBasicRequestBody

Parameter

Mandatory

Type

Description

task_name

No

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

No

String

Task type.

  • REALTIME (real-time)

  • TIMING (scheduled)

Minimum: 1

Maximum: 10

source_datasource_id

No

String

Data source ID at the source.

Minimum: 1

Maximum: 64

target_datasource_id

No

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 4 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 5 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.

Minimum: 1

Maximum: 1024

task_tag

String

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

Minimum: 4

Maximum: 64

created_by

String

Task creator.

Minimum: 1

Maximum: 10000

Status code: 400

Table 6 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 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: 500

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

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

  • Example 1

    null
  • Example 2

    {
      "task_id" : "1db6229e0bb34d25ac3fef142d823a7d",
      "task_name" : "fdi_task",
      "task_type" : "timing",
      "project_id" : "c53626012ba84727b938ca8bf03108ef",
      "source_datasource_id" : "525e17795b23431fbe303b90b79c9893",
      "target_datasource_id" : "525e17795b23431fbe303b90b79c9893",
      "source_datasource_name" : "fdi_ds_mysqldingshi",
      "target_datasource_name" : "fdi_ds_mysqldingshi",
      "source_app_id" : "1dfad5a7-464c-40ef-93bd-66a24b12880d",
      "target_app_id" : "1dfad5a7-464c-40ef-93bd-66a24b12880d",
      "status" : "stop",
      "created_date" : 1619404588565
    }
  • Example 3

    "{\"needAPI\":false,\"targetDsId\":\"525e17795b23431fbe303b90b79c9893\",\"sourceSelectedDatasource\":{\"extend_meta_data\":[],\"orderType\":\"ASC\",\"sourceDateColumn\":\"\",\"dataTimestamp\":\"\",\"sourceTable\":\"gaoxin_test.test_source\",\"sourceSelectedColumnList\":[{\"null_able\":\"0\",\"unique\":\"1\",\"field_length\":\"11\",\"field_type\":\"INT\",\"field_name\":\"id\"},{\"null_able\":\"1\",\"unique\":\"0\",\"field_length\":\"255\",\"field_type\":\"VARCHAR\",\"field_name\":\"name\"},{\"null_able\":\"1\",\"unique\":\"0\",\"field_length\":\"50\",\"field_type\":\"VARCHAR\",\"field_name\":\"picihao\"},{\"null_able\":\"1\",\"unique\":\"0\",\"field_length\":\"19\",\"field_type\":\"DATETIME\",\"field_name\":\"date\"}],\"isParse\":\"true\",\"querySql\":\"\",\"whereOptions\":[],\"instanceId\":\"05173009-2e5f-4773-8303-8e05cc9c9302\",\"sourceMetaData\":{\"dataSource\":[]},\"isAddSql\":false,\"meta_data\":[],\"where\":[],\"need_inc_migration\":false,\"textInputValue\":\"\",\"orderColumn\":\"\",\"isTextInput\":false},\"targetDatasource\":\"fdi_ds_mysqldingshi\",\"needEmailNew\":false,\"description\":\"\",\"mappingTableProperties\":[{\"sourceNullable\":\"0\",\"sourceUnique\":\"1\",\"targetUnique\":\"1\",\"targetNullable\":\"0\"},{\"sourceNullable\":\"1\",\"sourceUnique\":\"0\",\"targetUnique\":\"0\",\"targetNullable\":\"0\"},{\"sourceNullable\":\"1\",\"sourceUnique\":\"0\",\"targetUnique\":\"0\",\"targetNullable\":\"1\"}],\"sourceDatasourceType\":\"MYSQL\",\"taskType\":2,\"sourceDatasource\":\"fdi_ds_mysqldingshi\",\"targetDatasourceType\":\"MYSQL\",\"mappingSourceTextOrNot\":[{\"flag\":false},{\"flag\":false},{\"flag\":false}],\"mappingTable\":[{\"targetColumnType\":\"INT\",\"isAddDateMapping\":false,\"targetColumnLength\":\"11\",\"isAddMapping\":false,\"isAddBooleanMapping\":false,\"sourceColumnLength\":\"11\",\"targetColumn\":\"id\",\"sourceColumnType\":\"Int\",\"isAddFDIUUIDMapping\":false,\"sourceColumn\":\"id\"},{\"targetColumnType\":\"VARCHAR\",\"isAddDateMapping\":false,\"targetColumnLength\":\"255\",\"isAddMapping\":false,\"isAddBooleanMapping\":false,\"sourceColumnLength\":\"255\",\"targetColumn\":\"name\",\"sourceColumnType\":\"Varchar\",\"isAddFDIUUIDMapping\":false,\"sourceColumn\":\"name\"},{\"targetColumnType\":\"TIMESTAMP\",\"isAddDateMapping\":false,\"targetColumnLength\":\"19\",\"isAddMapping\":false,\"isAddBooleanMapping\":false,\"sourceColumnLength\":\"19\",\"targetColumn\":\"date\",\"sourceColumnType\":\"Datetime\",\"isAddFDIUUIDMapping\":false,\"sourceColumn\":\"date\"}],\"targetSelectedDatasource\":{\"targetNeedCreateTable\":false,\"targetSelectedColumnList\":[{\"null_able\":\"0\",\"unique\":\"1\",\"field_length\":\"11\",\"field_type\":\"INT\",\"field_name\":\"id\"},{\"null_able\":\"0\",\"unique\":\"0\",\"field_length\":\"255\",\"field_type\":\"VARCHAR\",\"field_name\":\"name\"},{\"null_able\":\"1\",\"unique\":\"0\",\"field_length\":\"19\",\"field_type\":\"TIMESTAMP\",\"field_name\":\"date\"}],\"supportPartUpdate\":false,\"targetTable\":\"gaoxin_test.test_target\",\"instanceId\":\"05173009-2e5f-4773-8303-8e05cc9c9302\",\"batch_number_style\":\"UUID\",\"isSupportClearTab\":false,\"batchNumber\":\"\"},\"taskName\":\"fdi_task_testaaa_1619433388307\",\"sourceDsId\":\"525e17795b23431fbe303b90b79c9893\",\"projectId\":\"c53626012ba84727b938ca8bf03108ef\",\"needMQS\":false,\"mappingInput\":{},\"mappingRequired\":true}"

Status Codes

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.