擷取遷移作業列表
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
odps:ListMmsJobs |
list |
*project
|
無 | 無 |
請求文法
GET /api/v1/mms/datasources/{sourceId}/jobs HTTP/1.1
路徑參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| sourceId |
integer |
是 |
資料來源 ID |
2000002 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| name |
string |
否 |
資料來源名稱 |
demo |
| srcDbName |
string |
否 |
源庫名 |
test_db_1 |
| srcTableName |
string |
否 |
源表名 |
test_table_1 |
| dstDbName |
string |
否 |
目標 MaxCompute 專案 |
mms_test |
| dstTableName |
string |
否 |
目標 MaxcCompute 表 |
test_table_1 |
| status |
string |
否 |
遷移計劃狀態 枚舉值:
|
DOING |
| stopped |
integer |
否 |
作業是否被停止 |
false |
| timerId |
integer |
否 |
timer id |
1 |
| pageNum |
integer |
否 |
頁碼 |
1 |
| pageSize |
integer |
否 |
分頁大小 |
10 |
| sorter.status |
string |
否 |
按照狀態排序 枚舉值:
|
desc |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回資料 |
||
| requestId |
string |
請求 ID。 |
1112E7C7-C65F-57A2-A7C7-3B178AA257B6 |
| data |
object |
返回資料詳細資料 |
|
| total |
integer |
總記錄數。 |
100 |
| objectList |
array<object> |
遷移作業列表 |
|
|
array<object> |
遷移工作物件 |
||
| id |
integer |
遷移作業 ID |
18 |
| name |
string |
遷移作業名字 |
migrate_db_1 |
| sourceId |
integer |
資料來源 ID |
2000015 |
| dbId |
integer |
源庫 ID |
196 |
| sourceName |
string |
資料來源名 |
demo |
| srcDbName |
string |
源庫名 |
test_db_1 |
| srcSchemaName |
string |
源 schema name-三層命名空間中的 schema |
test_table_1 |
| dstDbName |
string |
目標 MaxCompute 專案 |
mms_test |
| dstSchemaName |
string |
目標 MaxCompute Schema |
test_table_1 |
| status |
string |
遷移作業狀態 枚舉值:
|
DONE |
| type |
string |
遷移範圍:Database, Tables, Partitions 枚舉值:
|
Tables |
| taskNum |
integer |
包含的遷移任務數量 |
10 |
| stopped |
boolean |
遷移作業是否被停止 |
false |
| createTime |
string |
遷移作業是否被停止 |
2024-12-17 15:44:17 |
| taskDone |
integer |
遷移任務完成數 |
10 |
| config |
object |
遷移作業的配置 |
|
| partitions |
array |
當 type=Partitions 時, 通過該參數指定要遷移表的分區 ID 列表 |
|
|
integer |
要遷移表的分區 ID |
[123, 132] |
|
| tables |
array |
當 type=Tables 時, 通過該參數指定要遷移的表的名稱列表 |
|
|
string |
要遷移的表的名稱 |
["student", "scores"] |
|
| taskType |
string |
Depcreated; 可以指定的值有 MOCK, HIVE: hive udtf task, HIVE_DATAX: hive datax task, COPY_TASK: odps Copy Task, ODPS_INSERT_OVERWRITE: odps simple insert overwrite task, MC2MC_VERIFY, OSS, HIVE_OSS, HIVE_SPARK, BIGQUERY |
BIGQUERY |
| tableBlackList |
array |
當 type=Database 時, 通過 tableBlackList 指定排除哪些表不遷移 |
|
|
string |
當 type=Database 時, 要排查的表 |
["student", "scores"] |
|
| tableWhiteList |
array |
當 type=Database 時, 指定的要遷移的表列表。如果沒有指定 tableWhiteList,則遷移對應 Database 下的所有表 |
|
|
string |
當 type=Database 時, 指定的要遷移的表。 |
["student", "scores"] |
|
| partitionFilters |
object |
分區過濾運算式。 配置指定"表"對應的"分區過濾運算式" |
|
|
string |
分區過濾運算式。例如:p1 >= '2022-03-04' and (p2 = 10 or p3 > 20) and p4 in ('abc', 'cde'),介紹如下: p1、p2 和 p3 均為分區名。 分區值僅包含字串和數字,字串被雙引號或單引號包裹。 除 INT 和 BIGINT 類型的分區列值外,其他類型的分區值都只能取字串值。 比較操作符包括:>、>=、= 、<、<=、<>。 分區過濾運算式支援 IN 操作符。 邏輯操作符包括:AND 和 OR。 支援使用括弧。 |
{ "student": "p1 >= '2022-03-04' and (p2 = 10 or p3 > 20) and p4 in ('abc', 'cde')" } |
|
| schemaOnly |
boolean |
Depcreated |
false |
| tableMapping |
object |
源表名->目標名 映射 |
|
|
string |
源表名->目標名 映射 |
{'a': 'a1'} |
|
| increment |
boolean |
增量遷移:只遷移新分區或有變動的分區,注意有變動的分區會被重遷 |
true |
| enableVerification |
boolean |
開啟校正,目前校正方式是在源和目標端執行 select count,對比行數 |
true |
| tunnelQuota |
string |
Depcreated |
Depcreated |
| columnMapping |
object |
{源列名:目標列名} |
|
|
string |
{源列名:目標列名} |
{"c-1": "c_1"} |
|
| others |
object |
其他配置資訊 |
{"spark.executor.mem": "2g"} |
| eta |
string |
期望的遷移完成時間. 注意:eta 值越小,遷移任務的優先順序會越高 |
2025-05-06 |
| pageNum |
integer |
頁碼 |
1 |
| pageSize |
integer |
分頁大小 |
10 |
樣本
正常返回樣本
JSON格式
{
"requestId": "1112E7C7-C65F-57A2-A7C7-3B178AA257B6",
"data": {
"total": 100,
"objectList": [
{
"id": 18,
"name": "migrate_db_1",
"sourceId": 2000015,
"dbId": 196,
"sourceName": "demo",
"srcDbName": "test_db_1",
"srcSchemaName": "test_table_1",
"dstDbName": "mms_test",
"dstSchemaName": "test_table_1",
"status": "DONE",
"type": "Tables",
"taskNum": 10,
"stopped": false,
"createTime": "2024-12-17 15:44:17\n",
"taskDone": 10,
"config": {
"partitions": [
0
],
"tables": [
"[\"student\", \"scores\"]"
],
"taskType": "BIGQUERY",
"tableBlackList": [
"[\"student\", \"scores\"]"
],
"tableWhiteList": [
"[\"student\", \"scores\"]"
],
"partitionFilters": {
"key": "{\n\"student\": \"p1 >= '2022-03-04' and (p2 = 10 or p3 > 20) and p4 in ('abc', 'cde')\" \n}"
},
"schemaOnly": false,
"tableMapping": {
"key": "{'a': 'a1'}"
},
"increment": true,
"enableVerification": true,
"tunnelQuota": "Depcreated",
"columnMapping": {
"key": "{\"c-1\": \"c_1\"}"
},
"others": {
"spark.executor.mem": "2g"
}
},
"eta": "2025-05-06"
}
],
"pageNum": 1,
"pageSize": 10
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。