Creates an import task that contains data sources, nodes, and tables.
Operation description
Upload the import package as shown:
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);
...
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:* |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The DataWorks workspace ID. You can obtain it from the Workspace page in the DataWorks console. |
123456 |
| Name |
string |
Yes |
The import task name. Must be unique within the workspace. |
test_import_001 |
| PackageType |
string |
Yes |
The type of the import package. Valid values:
|
DATAWORKS_MODEL |
| PackageFile |
string |
Yes |
The import package file path. Upload the package as shown:
|
/home/admin/xxx/import.zip |
| ResourceGroupMap |
string |
No |
The resource group mapping between scheduling and Data Integration. Keys and values are resource group identifiers. Format:
|
{"SCHEDULER_RESOURCE_GROUP": {"xxx":"yyy"},"DI_RESOURCE_GROUP":{"ccc":"ddd"}} |
| WorkspaceMap |
string |
No |
The workspace name prefix mapping. During import, source workspace name prefixes are replaced with the mapped destination prefixes. |
{"test_workspace_src": "test_workspace_target"} |
| CalculateEngineMap |
string |
No |
The compute engine instance mapping from source to destination. Supported engines: MaxCompute, E-MapReduce (EMR), Hadoop CDH, and Hologres. |
{ "ODPS": { "zxy_8221431_engine": "wzp_kaifazheban_engine" }, "EMR": { "aaaa": "bbb" } } |
| CommitRule |
string |
No |
The auto-commit and auto-deploy rule for the import task. Parameters:
|
{ "resourceAutoCommit": false, "resourceAutoDeploy": false, "functionAutoCommit": false, "functionAutoDeploy": false, "tableAutoCommitToDev": false, "tableAutoCommitToProd": false, "ignoreLock": false, "fileAutoCommit": false, "fileAutoDeploy": false } |
| Description |
string |
No |
The description of the import package. |
test description |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Data |
integer |
The import task ID. Use this ID to run the import task or query its progress. |
123456 |
| ErrorMessage |
string |
The error message. |
test error message |
| RequestId |
string |
The request ID for troubleshooting. |
ADFASDFASDFA-ADFASDF-ASDFADSDF-AFFADS |
| ErrorCode |
string |
The error code. |
110001123456 |
| Success |
boolean |
Whether the request was successful. |
true |
Examples
Success response
JSON format
{
"HttpStatusCode": 200,
"Data": 123456,
"ErrorMessage": "test error message",
"RequestId": "ADFASDFASDFA-ADFASDF-ASDFADSDF-AFFADS",
"ErrorCode": "110001123456",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.