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);
...
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dataworks:* | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ProjectId | long | 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 | The mapping between the prefixes for the names of the source and destination workspaces. When the system performs the import operation, the prefix for the name of the source workspace in the import package is replaced based on the mapping. | {"test_workspace_src": "test_workspace_target"} |
CalculateEngineMap | string | Yes | 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 | Yes | 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 parameters
Examples
Sample success responses
JSON
format
{
"HttpStatusCode": 200,
"Data": 123456,
"ErrorMessage": "test error message",
"RequestId": "ADFASDFASDFA-ADFASDF-ASDFADSDF-AFFADS",
"ErrorCode": "110001123456",
"Success": true
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-10-10 | The internal configuration of the API is changed, but the call is not affected | View Change Details |