Membuat tugas impor. Tugas impor berisi paket impor untuk sumber data, node, dan tabel.
Deskripsi operasi
The import package must be uploaded. Example of the upload method:
Config config = new Config();
config.setAccessKeyId(accessId);
config.setAccessKeySecret(accessKey);
config.setEndpoint(popEndpoint);
config.setRegionId(regionId);
Client client = new Client(config);
CreateImportMigrationAdvanceRequest request = new CreateImportMigrationAdvanceRequest();
request.setName("test_migration_api_" + System.currentTimeMillis());
request.setProjectId(123456L);
request.setPackageType("DATAWORKS_MODEL");
request.setPackageFileObject(new FileInputStream("/home/admin/Downloads/test.zip"));
RuntimeOptions runtime = new RuntimeOptions();
CreateImportMigrationResponse response = client.createImportMigrationAdvance(request, runtime);
...
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:* |
update |
*All Resource
|
None | None |
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 ruang kerja. |
123456 |
| Name |
string |
Yes |
Nama tugas impor. Nama harus unik di dalam ruang kerja. |
test_import_001 |
| PackageType |
string |
Yes |
Tipe paket impor. Nilai valid:
|
DATAWORKS_MODEL |
| PackageFile |
string |
Yes |
Jalur paket impor. Paket impor harus diunggah. Contoh metode pengunggahan: |
/home/admin/xxx/import.zip |
| ResourceGroupMap |
string |
No |
Pemetaan antara kelompok sumber daya untuk penjadwalan dan kelompok sumber daya untuk Data Integration. Kunci dan nilai dalam pemetaan adalah pengenal kelompok sumber daya. Tentukan pemetaan dalam format berikut: |
{"SCHEDULER_RESOURCE_GROUP": {"xxx":"yyy"},"DI_RESOURCE_GROUP":{"ccc":"ddd"}} |
| WorkspaceMap |
string |
No |
Pemetaan antara awalan nama ruang kerja sumber dan ruang kerja tujuan. Saat sistem menjalankan operasi impor, awalan nama ruang kerja sumber dalam paket impor akan diganti berdasarkan pemetaan. |
{"test_workspace_src": "test_workspace_target"} |
| CalculateEngineMap |
string |
No |
Pemetaan antara instans mesin komputasi sumber dan instans mesin komputasi tujuan. Tipe instans mesin komputasi berikut didukung: MaxCompute, E-MapReduce (EMR), Hadoop CDH, dan Gudang Data Real-time. |
{ "ODPS": { "zxy_8221431_engine": "wzp_kaifazheban_engine" }, "EMR": { "aaaa": "bbb" } } |
| CommitRule |
string |
No |
Aturan yang dikonfigurasi untuk commit dan deploy otomatis pada tugas impor. Aturan ini berisi parameter berikut:
|
{ "resourceAutoCommit": false, "resourceAutoDeploy": false, "functionAutoCommit": false, "functionAutoDeploy": false, "tableAutoCommitToDev": false, "tableAutoCommitToProd": false, "ignoreLock": false, "fileAutoCommit": false, "fileAutoDeploy": false } |
| Description |
string |
No |
Deskripsi paket impor. |
test description |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Data |
integer |
The import task ID. The ID is used as an input parameter if you want the system to run the import task or you want to obtain the running progress of the import task. |
123456 |
| ErrorMessage |
string |
The error message. |
test error message |
| RequestId |
string |
The request ID. You can locate logs and troubleshoot issues based on the ID. |
ADFASDFASDFA-ADFASDF-ASDFADSDF-AFFADS |
| ErrorCode |
string |
The error code. |
110001123456 |
| Success |
boolean |
Indicates whether the request was successful. |
true |
Contoh
Respons sukses
JSONformat
{
"HttpStatusCode": 200,
"Data": 123456,
"ErrorMessage": "test error message",
"RequestId": "ADFASDFASDFA-ADFASDF-ASDFADSDF-AFFADS",
"ErrorCode": "110001123456",
"Success": true
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.