GenerateDISyncTaskConfigForCreating
Generates an ID for an asynchronous thread that is used to create a synchronization task in Data Integration.
Operation description
DataWorks allows you to use the CreateDISyncTask operation to directly create a batch synchronization task in Data Integration. To create a real-time synchronization task or another type of synchronization task, you must first call the GenerateDISyncTaskConfigForCreating operation to generate the ID of an asynchronous thread and call the QueryDISyncTaskConfigProcessResult operation to obtain the asynchronously generated parameters based on the ID. Then, you can use the parameters as request parameters of CreateDISyncTask and call the CreateDISyncTask operation to create a real-time synchronization task or another type of synchronization task. DataWorks allows you to create real-time synchronization tasks and other types of synchronization tasks in Data Integration only in asynchronous mode.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to obtain the ID. You must configure this parameter to specify the DataWorks workspace to which the API operation is applied. |
10000 |
| TaskType |
string |
Yes |
The type of task that you want to create in Data Integration in asynchronous mode. Valid values:
DataWorks allows you to create real-time synchronization tasks and other types of synchronization tasks in Data Integration only in asynchronous mode. |
DI_REALTIME |
| TaskParam |
string |
Yes |
The script for the synchronization task. DataWorks allows you to create the following types of synchronization tasks:
The SelectedTables parameter is used to specify tables that you want to synchronize from multiple databases. The Tables parameter is used to specify tables that you want to synchronize from a single database.
The following sample code provides a script for data synchronization from MySQL to MaxCompute:
The following sample code provides a script for data synchronization from MySQL to Kafka:
The following sample code provides a script for data synchronization 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 client token that is used to ensure the idempotence of the request. This parameter is used to prevent repeated operations that are caused by multiple calls. |
ABFUOEUOTRTRJKE |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| RequestId |
string |
The request ID. |
0bc1411515937635973**** |
| Data |
object |
The information returned for the ID of the asynchronous thread. |
|
| Status |
string |
Indicates whether the ID of the asynchronous thread is generated. Valid values:
|
true |
| ProcessId |
integer |
The ID of the asynchronous thread. You can call the QueryDISyncTaskConfigProcessResult operation to obtain the asynchronously generated parameters based on the ID. The parameters are used to create a synchronization task in Data Integration. |
10 |
| Message |
string |
The reason why the ID of the asynchronous thread fails to be generated. If the ID is successfully generated, no value is returned for this parameter. |
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. | |
| 400 | Invalid.DI.Parameter.File.Existed | The file name already exists. | |
| 500 | InternalError.DI.Parameter | A DI internal error occurred. | |
| 403 | Forbidden.DI.NoPrivilege | No access. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.