Creates a data migration task.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
odps:CreateMmsJob |
create |
*project
|
None | None |
Request syntax
POST /api/v1/mms/datasources/{sourceId}/jobs HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| sourceId |
integer |
Yes |
The ID of the data source. |
2000014 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body parameters. |
|
| sourceId |
integer |
No |
The ID of the data source. |
2000014 |
| name |
string |
No |
The name of the migration job. |
migrate_db_1 |
| sourceName |
string |
No |
The name of the data source. |
demo |
| srcDbName |
string |
No |
The name of the source database. |
src_db |
| srcSchemaName |
string |
No |
The name of the source schema. This is the schema in a Layer 3 namespace. |
default |
| dstDbName |
string |
No |
The destination MaxCompute project. |
mms_test |
| dstSchemaName |
string |
No |
The destination MaxCompute schema. |
default |
| taskType |
string |
No |
The type of the migration task. Valid values:
|
BIGQUERY |
| partitions |
array |
No |
The list of partition IDs. |
|
|
integer |
No |
The value of the partition ID. |
1232 |
|
| tables |
array |
No |
The list of table names. |
|
|
string |
No |
The table name. |
t1 |
|
| tableBlackList |
array |
No |
The blacklist of tables. |
|
|
string |
No |
The table name. |
t1 |
|
| tableWhiteList |
array |
No |
The whitelist of tables. Note: If you configure both a whitelist and a blacklist, only the blacklist takes effect. |
|
|
string |
No |
The table name. |
t1 |
|
| partitionFilters |
object |
No |
{Table name: Partition filter expression} |
|
|
string |
No |
The partition filter expression. |
例子:p1 >= '2022-03-04' and (p2 = 10 or p3 > 20) and p4 in ('abc', 'cde') 例子说明: 1. p1, p2, p3为分区名 2. 分区值只有字符串和数字两种,字符串被双引号或单引号包裹。除int/bigint类型的分区列值外,其他所有类型的分区值都只能取字符串值。 3. 比较操作符包括: >, >=, = , <, <=, <> 4. 支持"in"操作符 5. 逻辑操作符包括: and, or 6. 支持括号 |
|
| schemaOnly |
boolean |
No |
Specifies whether to migrate only metadata. |
false |
| tableMapping |
object |
No |
{Source table: Destination table} |
|
|
string |
No |
The table name. |
t1_1 |
|
| increment |
boolean |
No |
Specifies whether to perform an incremental migration. In an incremental migration, only new or changed partitions are migrated. Note that changed partitions are re-migrated. |
true |
| enableSchemaMigration |
boolean |
No |
Specifies whether to migrate table schemas. |
true |
| enableDataMigration |
boolean |
No |
Specifies whether to migrate table data. |
true |
| enableVerification |
boolean |
No |
Specifies whether to enable data verification. The current verification method is to execute SELECT COUNT(*) on the source and destination to compare the number of rows. |
false |
| columnMapping |
object |
No |
{Source column name: Destination column name} |
|
|
string |
No |
The column name. |
null |
|
| others |
object |
No |
Other configuration information. |
|
|
any |
No |
The configuration value. |
null |
|
| eta |
string |
No |
The expected completion time of the migration. Note: A smaller eta value gives the migration task higher priority. |
2025-02-04 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
ApiRes<asynctaskiddto> |
||
| requestId |
string |
The request ID. |
73207140-0FD5-588A-B11A-3CE093924196 |
| data |
object |
The returned data. |
|
| asyncTaskId |
integer |
The ID of the asynchronous task that is created for the migration job. |
100 |
Examples
Success response
JSON format
{
"requestId": "73207140-0FD5-588A-B11A-3CE093924196",
"data": {
"asyncTaskId": 100
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.