CreateImportMigration
Creates an import task. The import task contains the import packages of data sources, nodes, and tables.
Operation description
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);
...
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 log on to the DataWorks console and go to the Workspace page to obtain the workspace ID. |
123456 |
| Name |
string |
Yes |
The name of the import task. The 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 path of the import package. The import package must be uploaded. Example of the upload method: |
/home/admin/xxx/import.zip |
| ResourceGroupMap |
string |
No |
The mapping between the resource group for scheduling and the resource group for Data Integration. The keys and values in the mapping are the identifiers of the resource groups. Specify the mapping in the following format: |
{"SCHEDULER_RESOURCE_GROUP": {"xxx":"yyy"},"DI_RESOURCE_GROUP":{"ccc":"ddd"}} |
| WorkspaceMap |
string |
No |
When an import or export operation is performed, this mapping replaces the input and output workspace names in the import/export package with the mapped workspace names. For example, during import, the workspace name prefixes in inputs and outputs are replaced based on the mapping. |
{"test_workspace_src": "test_workspace_target"} |
| CalculateEngineMap |
string |
No |
The mapping between the source compute engine instance and the destination compute engine instance. The following types of compute engine instances are supported: MaxCompute, E-MapReduce (EMR), Hadoop CDH, and Hologres. |
{ "ODPS": { "zxy_8221431_engine": "wzp_kaifazheban_engine" }, "EMR": { "aaaa": "bbb" } } |
| CommitRule |
string |
No |
The rule configured for automatically committing and deploying the import task. The rule contains the following 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/export package 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 |
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.