Membuat versi baru dari tugas integrasi data.
Deskripsi operasi
-
This API requires DataWorks Basic Edition or a higher edition.
-
This API creates a data integration synchronization task. Key parameters include
SourceDataSourceSettings,DestinationDataSourceSettings, andMigrationType. TheTransformationRulesparameter defines transformation rules for synchronized tables, such as adding columns or replacing table names. TheTableMappingsparameter specifies which tables to synchronize and their mapping rules. TheJobSettingsparameter configures task settings, including column mapping and scheduling.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| DestinationDataSourceType |
string |
No |
Tipe sumber data tujuan. Nilai valid: |
Hologres |
| Description |
string |
No |
Deskripsi pekerjaan. |
DI Job Demo |
| SourceDataSourceType |
string |
No |
Tipe sumber data asal. Nilai valid: |
MySQL |
| ProjectId |
integer |
No |
ID ruang kerja DataWorks untuk pemanggilan API ini. Untuk mendapatkan ID ruang kerja, masuk ke Konsol DataWorks dan buka halaman Manajemen Ruang Kerja. |
10000 |
| Name |
string |
No |
Nama pekerjaan. |
mysql_to_holo_sync_8772 |
| MigrationType |
string |
No |
Tipe sinkronisasi. Nilai valid:
|
FullAndRealtimeIncremental |
| JobType |
string |
No |
Tipe pekerjaan. Nilai valid:
|
DatabaseRealtimeMigration |
| SourceDataSourceSettings |
array<object> |
No |
Pengaturan untuk sumber data asal. |
|
|
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 |
| ConnectionProperties |
string |
No |
Custom connection settings for the data source, such as instance ID, access credentials, and instance region. You must specify this parameter or This parameter applies only when the data source is configured in instance mode ( |
{ "instanceId": "rm-2ze09gn3x6xxx", "password": "xxxx", "database": "agent", "username": "zmtest" "regionId": "cn-beijing" } |
| DestinationDataSourceSettings |
array<object> |
No |
Pengaturan untuk sumber data tujuan. |
|
|
array<object> |
No |
The settings for a single destination data source. |
||
| DataSourceName |
string |
No |
The name of the data source. |
holo_datasource_1 |
| DataSourceProperties |
object |
No |
The properties of the data source. |
|
| ConnectionProperties |
string |
No |
Custom connection settings for the data source, such as instance ID, access credentials, and instance region. You must specify this parameter or This parameter applies only when the data source is configured in instance mode ( |
{ "instanceId": "rm-2ze09gn3x6xxx", "password": "xxxx", "database": "agent", "username": "zmtest" "regionId": "cn-beijing" } |
| ResourceSettings |
object |
No |
Pengaturan Sumber daya. |
|
| OfflineResourceSettings |
object |
No |
Resource settings for batch synchronization. |
|
| RequestedCu |
number |
No |
The number of CUs for 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 used for batch synchronization. |
S_res_group_111_222 |
| RealtimeResourceSettings |
object |
No |
The resources for real-time synchronization. |
|
| RequestedCu |
number |
No |
The number of CUs for 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 used for real-time synchronization. |
S_res_group_111_222 |
| ScheduleResourceSettings |
object |
No |
The scheduling resources. |
|
| RequestedCu |
number |
No |
The number of CUs for the scheduling resource group that is used for batch synchronization jobs. |
2 |
| ResourceGroupIdentifier |
string |
No |
The identifier of the scheduling resource group used for batch synchronization jobs. |
S_res_group_222_333 |
| TransformationRules |
array<object> |
No |
Daftar aturan transformasi untuk objek yang akan disinkronkan. Catatan
[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema", "RuleExpression":"{\"expression\":\"${srcDatasoureName}_${srcDatabaseName}\"}" } ]. |
|
|
object |
No |
A single transformation rule. |
||
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleExpression |
string |
No |
The rule expression, specified as a JSON string.
|
{ "expression": "${srcDatasoureName}_${srcDatabaseName}" } |
| RuleName |
string |
No |
The name of the rule. The rule name must be unique for a specific action type and target object type. Maximum length: 50 characters. |
rename_rule_1 |
| RuleTargetType |
string |
No |
The type of the object to which the action applies. Valid values:
|
Table |
| TableMappings |
array<object> |
No |
Pemetaan transformasi untuk objek yang akan disinkronkan. Setiap pemetaan menentukan aturan pemilihan untuk sekelompok objek sumber dan aturan transformasi yang akan diterapkan. Catatan
[ { "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 |
A mapping that selects a set of source objects and specifies the transformation rules to apply. |
||
| SourceObjectSelectionRules |
array<object> |
No |
Each rule can select a set of source objects to synchronize. Multiple rules combine to select one table. |
|
|
object |
No |
A rule that selects source objects of a specific type, such as a database or 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 names of the transformation rules to apply to the selected objects. |
|
|
object |
No |
The transformation rule 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 target object type. Maximum length: 50 characters. |
rename_rule_1 |
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleTargetType |
string |
No |
The type of the object to which the action applies. Valid values:
|
Table |
| JobSettings |
object |
No |
Pengaturan untuk pekerjaan sinkronisasi, termasuk kebijakan pemrosesan DDL, pemetaan tipe data antara kolom sumber dan tujuan, serta parameter waktu proses. |
|
| ChannelSettings |
string |
No |
Settings for data synchronization channels. You can configure special settings for specific channels. The following channels are supported: synchronization from Hologres to Hologres (Holo2Holo) and from Hologres to Kafka (Holo2Kafka).
|
{ "structInfo": "MANAGED", "storageType": "TEXTFILE", "writeMode": "APPEND", "partitionColumns": [ { "columnName": "pt", "columnType": "STRING", "comment": "" } ], "fieldDelimiter": "" } |
| ColumnDataTypeSettings |
array<object> |
No |
Column data type mappings. Catatan
"ColumnDataTypeSettings":[ { "SourceDataType":"Bigint", "DestinationDataType":"Text" } ] |
|
|
object |
No |
A mapping from a source data type to a destination data type. |
||
| DestinationDataType |
string |
No |
The destination data type. For example: |
text |
| SourceDataType |
string |
No |
The source data type. For example: |
bigint |
| CycleScheduleSettings |
object |
No |
The periodic scheduling settings. |
|
| CycleMigrationType |
string |
No |
The synchronization type for periodic scheduling. Valid values:
|
Full |
| ScheduleParameters |
string |
No |
The scheduling parameters. |
bizdate=$bizdate |
| DdlHandlingSettings |
array<object> |
No |
DDL handling settings. Catatan
"DDLHandlingSettings":[ { "Type":"Insert", "Action":"Normal" } ] |
|
|
object |
No |
A single 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 |
Parameter ini tidak digunakan lagi. Gunakan parameter |
mysql_to_holo_sync_8772 |
| Owner |
string |
No |
Pemilik pekerjaan. |
3726346 |
| FileSpec |
string |
No |
Kode untuk pekerjaan yang dibuat dalam mode skrip. |
{ "resourceSettings": { "realtimeResourceSettings": { "requestedCu": 2, "resourceGroupIdentifier": "Serverless_res_group_123_456" }, "offlineResourceSettings": { "requestedCu": 2, "resourceGroupIdentifier": "Serverless_res_group_123_456" } }, "tableMappings": [ { "sourceObjectSelectionRules": [ { "expression": "autotest_hologres", "action": "Include", "expressionType": "Exact", "objectType": "Datasource" }, { "expression": "auto_holo_2661647", "action": "Include", "expressionType": "Exact", "objectType": "Table" }, { "expression": "public", "action": "Include", "expressionType": "Exact", "objectType": "Schema" } ], "transformationRules": [ { "ruleTargetType": "Table", "ruleActionType": "SourceSchema", "ruleName": "SourceSchema_Table_BStf8aXPSCJjOWGe" }, { "ruleTargetType": "Schema", "ruleActionType": "Rename", "ruleName": "Rename_Schema_3qWNOIsljtInvKJy" }, { "ruleTargetType": "Table", "ruleActionType": "Rename", "ruleName": "Rename_Table_o3PVQq1aIKDGoVVW" }, { "ruleTargetType": "Table", "ruleActionType": "DefineDstTableSettings", "ruleName": "DefineDstTableSettings_Table_BhJltOmOCIc81fzi" }, { "ruleTargetType": "Table", "ruleActionType": "ColumnMapping", "ruleName": "ColumnMapping_Table_nP4hJPX1wh2W3fpo" } ] } ], "sourceDataSourceSettings": [ { "dataSourceProperties": { "timeZone": "Asia/Shanghai" }, "dataSourceName": "autotest_hologres" } ], "jobSettings": { "runtimeSettings": [ ], "ddlHandlingSettings": [ ], "columnDataTypeSettings": [ ], "cycleScheduleSettings": { }, "channelSettings": { "destinationChannelSettings": { "conflictMode": "replace", "dynamicColumnAction": "replay", "writeMode": "replay" }, "sourceChannelSettings": { } } }, "destinationDataSourceType": "Hologres", "transformationRules": [ { "ruleTargetType": "Table", "ruleName": "SourceSchema_Table_BStf8aXPSCJjOWGe", "ruleActionType": "SourceSchema", "ruleExpression": { "columns": [ { "name": "id", "category": "normal", "type": "BIGINT" }, { "name": "decimal", "category": "normal", "type": "DECIMAL" } ] } }, { "ruleTargetType": "Schema", "ruleName": "Rename_Schema_3qWNOIsljtInvKJy", "ruleActionType": "Rename", "ruleExpression": { "expression": "public" } }, { "ruleTargetType": "Table", "ruleName": "Rename_Table_o3PVQq1aIKDGoVVW", "ruleActionType": "Rename", "ruleExpression": { "expression": "auto_holo_2661647_dst" } }, { "ruleTargetType": "Table", "ruleName": "DefineDstTableSettings_Table_BhJltOmOCIc81fzi", "ruleActionType": "DefineDstTableSettings", "ruleExpression": { "ddlString": "BEGIN; CREATE TABLE IF NOT EXISTS public.auto_holo_2661647_dst ( id BIGINT PRIMARY KEY, "decimal" DECIMAL(38,18) ); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'time_to_live_in_seconds', '3153600000'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'orientation', 'column'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'binlog.level', 'replica'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'binlog.ttl', '2592000'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'bitmap_columns', '"text","char","varchar"'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'dictionary_encoding_columns', '"text":auto,"bytea":auto,"char":auto,"varchar":auto'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'distribution_key', '"id"'); COMMIT; ", "ddlType": "STRUCT" } }, { "ruleTargetType": "Table", "ruleName": "ColumnMapping_Table_nP4hJPX1wh2W3fpo", "ruleActionType": "ColumnMapping", "ruleExpression": { "columnMapping": [ { "sourceColName": "id", "dstColName": "id" }, { "sourceColName": "decimal", "dstColName": "decimal" } ] } } ], "migrationType": "FullAndRealtimeIncremental", "destinationDataSourceSettings": [ { "dataSourceProperties": { }, "dataSourceName": "autotest_hologres" } ], "sourceDataSourceType": "Hologres" } |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response schema. |
||
| Id |
integer |
The data integration job ID. |
11792 |
| RequestId |
string |
The request ID. Use this ID to locate logs and troubleshoot issues. |
4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB |
DIJobId
deprecated
|
integer |
This field is deprecated. Use the |
11792 |
Contoh
Respons sukses
JSONformat
{
"Id": 11792,
"RequestId": "4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB",
"DIJobId": 11792
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.