Create a new version of a data integration task.
Operation description
To use this API, you must purchase DataWorks Basic Edition or a higher edition.
This API creates a data integration synchronization task. Key parameters include the source configuration
SourceDataSourceSettings, the destination configurationDestinationDataSourceSettings, and the supported migration typeMigrationType. TheTransformationRulesparameter defines transformation rules for synchronized tables, such as adding columns and replacing table names. TheTableMappingsparameter specifies the tables to synchronize and their corresponding mapping rules. TheJobSettingsparameter defines task settings, including column mapping and scheduling.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DestinationDataSourceType |
string |
Yes |
The type of the destination data source. Valid values: |
Hologres |
| Description |
string |
No |
The description of the job. |
DI Job Demo |
| SourceDataSourceType |
string |
Yes |
The type of the source data source. Valid values: |
MySQL |
| ProjectId |
integer |
No |
The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace ID. This parameter is used to specify the DataWorks workspace for this API call. |
10000 |
| Name |
string |
No |
The name of the job. |
mysql_to_holo_sync_8772 |
| MigrationType |
string |
Yes |
The synchronization type. Valid values:
|
FullAndRealtimeIncremental |
| JobType |
string |
No |
The job type. Valid values:
|
DatabaseRealtimeMigration |
| SourceDataSourceSettings |
array<object> |
Yes |
The settings for the source data source. |
|
|
array<object> |
No |
The settings for a single source data source. |
||
| DataSourceName |
string |
No |
The name of the data source. |
mysql_datasource_1 |
| DataSourceProperties |
object |
No |
The properties of the data source. |
|
| Encoding |
string |
No |
The database encoding format. |
UTF-8 |
| Timezone |
string |
No |
The time zone. |
Asia/Shanghai |
| DestinationDataSourceSettings |
array<object> |
Yes |
The settings for the destination data source. |
|
|
object |
No |
The settings for a single destination data source. |
||
| DataSourceName |
string |
No |
The name of the data source. |
holo_datasource_1 |
| ResourceSettings |
object |
Yes |
The resource settings. |
|
| OfflineResourceSettings |
object |
No |
The resources for batch synchronization. |
|
| RequestedCu |
number |
No |
The computing units (CUs) of the resource group for data integration that is used for batch synchronization. |
2 |
| ResourceGroupIdentifier |
string |
No |
The identifier of the resource group for data integration that is used for batch synchronization. |
S_res_group_111_222 |
| RealtimeResourceSettings |
object |
No |
The resources for real-time synchronization. |
|
| RequestedCu |
number |
No |
The CUs of the resource group for data integration that is used for real-time synchronization. |
2 |
| ResourceGroupIdentifier |
string |
No |
The identifier of the resource group for data integration that is used for real-time synchronization. |
S_res_group_111_222 |
| ScheduleResourceSettings |
object |
No |
The scheduling resources. |
|
| RequestedCu |
number |
No |
The CUs of the scheduling resource group that is used for batch synchronization jobs. |
2 |
| ResourceGroupIdentifier |
string |
No |
The identifier of the scheduling resource group that is used for batch synchronization jobs. |
S_res_group_222_333 |
| TransformationRules |
array<object> |
No |
The transformation rules for the objects to be synchronized. Note
[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema", "RuleExpression":"{"expression":"${srcDatasoureName}_${srcDatabaseName}"}" } ] |
|
|
object |
No |
A transformation rule. |
||
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleExpression |
string |
No |
The rule expression, which must be a JSON string.
|
{ "expression": "${srcDatasoureName}_${srcDatabaseName}" } |
| RuleName |
string |
No |
The name of the rule. If the action type and the object type to which the action applies are the same, the rule name must be unique. The name can be up to 50 characters in length. |
rename_rule_1 |
| RuleTargetType |
string |
No |
The type of the object to which the action applies. Valid values:
|
Table |
| TableMappings |
array<object> |
Yes |
The transformation mappings for the objects to be synchronized. Each element in the list describes a group of selection rules for source objects and the transformation rules that are applied to this group of objects. Note
[ { "SourceObjectSelectionRules":[ { "ObjectType":"Database", "Action":"Include", "ExpressionType":"Exact", "Expression":"biz_db" }, { "ObjectType":"Schema", "Action":"Include", "ExpressionType":"Exact", "Expression":"s1" }, { "ObjectType":"Table", "Action":"Include", "ExpressionType":"Exact", "Expression":"table1" } ], "TransformationRuleNames":[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema" } ] } ] |
|
|
array<object> |
No |
Each rule selects a table to be synchronized. |
||
| SourceObjectSelectionRules |
array<object> |
No |
Each rule can select a set of source objects to be synchronized. Multiple rules are combined to select a table. |
|
|
object |
No |
Each rule can select different object types of the source objects to be synchronized, such as the source database and source data table. |
||
| Action |
string |
No |
The selection action. Valid values: |
Include |
| Expression |
string |
No |
The expression. |
mysql_table_1 |
| ExpressionType |
string |
No |
The expression type. Valid values: |
Exact |
| ObjectType |
string |
No |
The object type. Valid values:
|
Table |
| TransformationRules |
array<object> |
No |
The transformation rules. Each element in the list is a transformation rule. |
|
|
object |
No |
The transformation rule that is applied to the source object. |
||
| RuleName |
string |
No |
The name of the transformation rule. The rule name must be unique for a specific action type and object type. The name can be up to 50 characters in length. |
rename_rule_1 |
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleTargetType |
string |
No |
The type of the object on which the action is performed. Valid values:
|
Table |
| JobSettings |
object |
No |
The settings of the synchronization job, including DDL processing policies, mapping policies for data types of columns in the source and destination, and runtime parameters. |
|
| ChannelSettings |
string |
No |
The settings of the channel in the synchronization job. You can configure special settings for specific channels. The following channels are supported:
|
{ "structInfo": "MANAGED", "storageType": "TEXTFILE", "writeMode": "APPEND", "partitionColumns": [ { "columnName": "pt", "columnType": "STRING", "comment": "" } ], "fieldDelimiter": "" } |
| ColumnDataTypeSettings |
array<object> |
No |
The array of data type mappings for columns. Note
["ColumnDataTypeSettings":[ { "SourceDataType":"Bigint", "DestinationDataType":"Text" } ] |
|
|
object |
No |
A data type mapping for a single column. |
||
| DestinationDataType |
string |
No |
The data type in the destination, such as bigint, boolean, string, text, datetime, timestamp, decimal, and binary. Data types vary with data sources. |
text |
| SourceDataType |
string |
No |
The data type in the source, such as bigint, boolean, string, text, datetime, timestamp, decimal, and binary. Data types vary with data sources. |
bigint |
| CycleScheduleSettings |
object |
No |
The settings for periodic scheduling. |
|
| CycleMigrationType |
string |
No |
The synchronization type that requires periodic scheduling. Valid values:
|
Full |
| ScheduleParameters |
string |
No |
The scheduling parameters. |
bizdate=$bizdate |
| DdlHandlingSettings |
array<object> |
No |
The array of DDL handling settings. Note
["DDLHandlingSettings":[ { "Type":"Insert", "Action":"Normal" } ] |
|
|
object |
No |
A DDL handling setting. |
||
| Action |
string |
No |
The handling action. Valid values:
|
Critical |
| Type |
string |
No |
The DDL type. Valid values:
|
AddColumn |
| RuntimeSettings |
array<object> |
No |
The runtime settings. |
|
|
object |
No |
A runtime setting. |
||
| Name |
string |
No |
The name of the setting. Valid values:
|
runtime.offline.concurrent |
| Value |
string |
No |
The value of the setting. |
1 |
JobName
deprecated
|
string |
No |
This parameter is deprecated. Use the |
mysql_to_holo_sync_8772 |
| Owner |
string |
No |
The owner of the job. |
3726346 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response schema. |
||
| Id |
integer |
The data integration job ID. |
11792 |
| RequestId |
string |
The request ID. Use it to locate logs and troubleshoot issues. |
4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB |
DIJobId
deprecated
|
integer |
This field is deprecated. Use the |
11792 |
Examples
Success response
JSON format
{
"Id": 11792,
"RequestId": "4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB",
"DIJobId": 11792
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.