All Products
Search
Document Center

DataWorks:GenerateDISyncTaskConfigForCreating

Last Updated:Jun 11, 2026

Menghasilkan ID untuk thread asinkron yang digunakan untuk membuat tugas sinkronisasi di Data Integration.

Deskripsi operasi

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.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

ID ruang kerja DataWorks. Anda dapat masuk ke Konsol DataWorks dan membuka halaman Ruang Kerja untuk mendapatkan ID tersebut.

Anda harus mengonfigurasi parameter ini untuk menentukan ruang kerja DataWorks tempat operasi API diterapkan.

10000

TaskType

string

Yes

Jenis tugas yang ingin Anda buat di Data Integration dalam mode asinkron. Nilai valid:

  • DI_REALTIME: tugas sinkronisasi pengatur waktu

  • DI_SOLUTION: jenis tugas sinkronisasi lainnya

DataWorks memungkinkan Anda membuat tugas sinkronisasi pengatur waktu dan jenis tugas sinkronisasi lainnya di Data Integration hanya dalam mode asinkron.

  • DI_OFFLINE

  • DI_REALTIME

  • DI_SOLUTION.

DI_REALTIME

TaskParam

string

Yes

Skrip untuk tugas sinkronisasi. DataWorks memungkinkan Anda membuat jenis tugas sinkronisasi berikut:

  • Tugas sinkronisasi yang digunakan untuk menyinkronkan data dari MySQL ke MaxCompute

  • Tugas sinkronisasi yang digunakan untuk menyinkronkan data dari MySQL ke Kafka

  • Tugas sinkronisasi yang digunakan untuk menyinkronkan data dari MySQL ke Gudang Data Real-time

Parameter SelectedTables digunakan untuk menentukan tabel yang ingin Anda sinkronkan dari beberapa database. Parameter Tables digunakan untuk menentukan tabel yang ingin Anda sinkronkan dari satu database.

  • Jika skrip berisi parameter SelectedTables, sistem akan menyinkronkan data dari tabel yang Anda tentukan di parameter SelectedTables.

  • Jika skrip berisi parameter Tables, sistem akan menyinkronkan data dari tabel yang Anda tentukan di parameter Tables.

Kode contoh berikut menyediakan skrip untuk sinkronisasi data dari MySQL ke MaxCompute:

{
  "type": "pengatur waktu",
  "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",
      "kategori": "reader"
    },
    {
      "stepType": "odps",
      "parameter": {
        "datasource": "odps_source"
      },
      "name": "Writer",
      "kategori": "writer"
    }
  ]
}

Kode contoh berikut menyediakan skrip untuk sinkronisasi data dari MySQL ke Kafka:

{
  "type": "pengatur waktu",
  "version": "1.0",
  "setting": {
    "resourceGroup": "S_res_group_280749521950784_1623033752022",
    "taskType": "oneclick_to_kafka"
  },
  "steps": [
    {
      "stepType": "mysql",
      "parameter": {
        "connection": [
          {
            "datasourceType": "mysql",
            "datasource": "pkset_test",
            "selectedTables": [
              {
                "dbName": "mysql_db",
                "schema": [
                  {
                    "tableInfos": [
                      {
                        "table": "molin_di_test_in_pk_v4"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      "name": "Reader",
      "kategori": "reader"
    },
    {
      "stepType": "kafka",
      "parameter": {
        "datasource": "azn_kafka"
      },
      "name": "Writer",
      "kategori": "writer"
    }
  ]
}

Kode contoh berikut menyediakan skrip untuk sinkronisasi data dari MySQL ke Gudang Data Real-time:

{
  "type": "pengatur waktu",
  "version": "1.0",
  "setting": {
    "resourceGroup": "S_res_group_280749521950784_1623033752022",
    "taskType": "oneclick_to_holo"
  },
  "steps": [
    {
      "stepType": "mysql",
      "parameter": {
        "connection": [
          {
            "datasourceType": "mysql",
            "datasource": "mysql_pub",
            "selectedTables": [
              {
                "dbName": "mysql_db",
                "schema": [
                  {
                    "tableInfos": [
                      {
                        "table": "molin_di_test_in2_pk_v3"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      "name": "Reader",
      "kategori": "reader"
    },
    {
      "stepType": "holo",
      "parameter": {
        "datasource": "holo"
      },
      "name": "Writer",
      "kategori": "writer"
    }
  ]
}.

{ "type": "realtime", "version": "1.0", "setting": { "resourceGroup": "S_res_group_280749521950784_1623033752022", "scheduleResgroupId": 30003913, "name": "openapi_realtime_solution_0813_1739", "taskType": "oneclick_to_odps" }, "steps": [ { "stepType": "mysql", "parameter": { "connection": [ { "datasourceType": "mysql", "datasource": "mysql_pub", "table": [ "xyx" ] } ] }, "name": "Reader", "category": "reader" }, { "stepType": "odps", "parameter": { "datasource": "odps_first" }, "name": "Writer", "category": "writer" } ] }

ClientToken

string

No

Token Klien yang digunakan untuk memastikan idempotensi permintaan. Parameter ini mencegah operasi berulang yang disebabkan oleh beberapa pemanggilan.

ABFUOEUOTRTRJKE

Elemen respons

Element

Type

Description

Example

object

The response parameters.

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

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: Valid values:

  • success: indicates that the ID of the asynchronous thread is generated.

  • fail: indicates that the ID of the asynchronous thread fails to be generated. You can view the reason for the failure and troubleshoot the issue based on the reason.

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.

Contoh

Respons sukses

JSONformat

{
  "Success": true,
  "RequestId": "0bc1411515937635973****",
  "Data": {
    "Status": "true",
    "ProcessId": 10,
    "Message": "XXX is invalid."
  }
}

Kode kesalahan

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.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.