GenerateDISyncTaskConfigForCreating
Asynchronously generates the JSON configuration for a synchronization task.
Operation description
Call CreateDISyncTask directly to create a Data Integration batch synchronization task. For real-time and other synchronization tasks, first call GenerateDISyncTaskConfigForCreating, then call QueryDISyncTaskConfigProcessResult to obtain the asynchronously generated configuration. Pass that configuration to CreateDISyncTask to create the task. Real-time and other synchronization tasks can only be created using this asynchronous workflow.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
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 specifies the DataWorks workspace for the current API call. |
10000 |
| TaskType |
string |
Yes |
The type of the Data Integration synchronization task to be created by using the asynchronous method. Valid values:
Only the asynchronous method is supported for generating real-time synchronization tasks and other types of synchronization tasks. Valid values:
|
DI_REALTIME |
| TaskParam |
string |
Yes |
The script of the Data Integration synchronization task. The following synchronization task types are supported:
SelectedTables is used to select synchronization tables in multi-database mode, and Tables is used to select synchronization tables in single-database mode.
The following example shows the script for synchronizing data from MySQL to MaxCompute:
The following example shows the script for synchronizing data from MySQL to Kafka:
The following example shows the script for synchronizing data from MySQL to Hologres: |
{ "type": "realtime", "version": "1.0", "setting": { "resourceGroup": "S_res_group_280749521950784_1623033752022", "taskType": "oneclick_to_odps" }, "steps": [{ "stepType": "mysql", "parameter": { "connection": [ { "datasourceType": "mysql", "datasource": "mysql_pub1", "selectedTables": [ { "dbName": "mysql_db", "schema": [ { "tableInfos": [ { "table": "molin_di_test_in_pk_v4" }] } ] } ] } ] }, "name": "Reader", "category": "reader" }, { "stepType": "odps", "parameter": { "datasource": "odps_source" }, "name": "Writer", "category": "writer" } ] } |
| ClientToken |
string |
No |
The idempotency token. This parameter prevents duplicate operations caused by multiple calls. |
ABFUOEUOTRTRJKE |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response structure. |
||
| Success |
boolean |
Indicates whether the request is successful. Valid values:
|
true |
| RequestId |
string |
The request ID. You can use this ID to locate logs and troubleshoot issues. |
0bc1411515937635973**** |
| Data |
object |
The generation result of the asynchronous thread ID. |
|
| Status |
string |
The status of the asynchronous thread ID generation. Valid values:
|
true |
| ProcessId |
integer |
The asynchronous operation ID. Use it to call QueryDISyncTaskConfigProcessResult and obtain the generated configuration. Pass that configuration when you create the Data Integration synchronization task. |
10 |
| Message |
string |
The description of the cause for the failure to generate the asynchronous thread ID. If the asynchronous thread ID is generated, this parameter is left empty. |
XXX is invalid. |
Examples
Success response
JSON format
{
"Success": true,
"RequestId": "0bc1411515937635973****",
"Data": {
"Status": "true",
"ProcessId": 10,
"Message": "XXX is invalid."
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Invalid.DI.Parameter | The parameter is invalid. | The parameter is invalid. |
| 400 | Invalid.DI.Parameter.File.Existed | The file name already exists. | The parameter is invalid. The file name already exists. |
| 500 | InternalError.DI.Parameter | A DI internal error occurred. | A Data Integration internal business error occurred. |
| 403 | Forbidden.DI.NoPrivilege | No access. | Access denied. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.