全部產品
Search
文件中心

DataWorks:GetDIJob - 查看Data Integration新版任務

更新時間:Mar 21, 2026

查看Data Integration新版任務,當前支援的任務類型包括:MySQL到Hologres整庫即時解決方案。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

dataworks:*

get

*全部資源

*

請求參數

名稱

類型

必填

描述

樣本值

DIJobId

integer

任務 ID。

11588

WithDetails

boolean

是否返回詳細配置資訊,詳細配置資訊包括 TransformationRules、TableMappings、JobSettings。預設返回。

true

返回參數

名稱

類型

描述

樣本值

object

響應。

Data

object

任務資訊。

ProjectId

integer

工作空間的 ID。

22

DIJobId

integer

任務 ID。

11588

JobName

string

任務名稱。

mysql_to_holo_sync_445

Description

string

描述資訊。

Synchronize mysql to hologres

MigrationType

string

同步類型,可選的枚舉值有:

  • FullAndRealtimeIncremental(全量和即時增量)

  • RealtimeIncremental(即時增量)

  • Full(全量)

  • OfflineIncremental(離線增量)

  • FullAndOfflineIncremental(全量+離線增量)

FullAndRealtimeIncremental

SourceDataSourceType

string

源端資料來源類型,枚舉值:MySQL。

MySQL

DestinationDataSourceType

string

目標端資料來源類型,枚舉值:Hologres、Hive。

Hologres

SourceDataSourceSettings

array<object>

源端資料來源設定,目前僅支援單個資料來源。

array<object>

源端資料來源設定。

DataSourceName

string

資料來源名稱。

mysql_datasource_1

DataSourceProperties

object

資料來源屬性。

string

源端資料來源屬性。 MySQL 資料來源支援的屬性名稱包括:TimeZone(時區),Encoding(編碼)。

TimeZone

DestinationDataSourceSettings

array<object>

目標端資料來源設定,目前僅支援單個資料來源。

array<object>

目標端資料來源設定。

DataSourceName

string

資料來源名稱。

holo_datasource_1

DataSourceProperties

object

資料來源屬性。

string

目標端資料來源屬性。Hologres 資料來源暫無屬性可設定。

TimeZone

ResourceSettings

object

資源設定。

OfflineResourceSettings

object

離線同步資源。

ResourceGroupIdentifier

string

離線同步使用的Data Integration資源群組標識。

S_res_group_111_222

RealtimeResourceSettings

object

即時同步資源。

ResourceGroupIdentifier

string

即時同步使用的Data Integration資源群組標識。

S_res_group_111_222

RequestedCu

number

增全量同步任務使用的資源群組 cu。

2.0

TransformationRules

array<object>

同步對象轉換規則定義列表,列表中每個元素為一條轉換規則定義。

object

同步對象轉換規則定義。

RuleActionType

string

動作類型,可選的枚舉值:

  • DefinePrimaryKey(定義主鍵)

  • Rename(重新命名)

  • AddColumn(增加列)

  • HandleDml(DML 處理)

  • DefineIncrementalCondition(定義增量條件)

  • DefineCycleScheduleSettings(定義周期調度設定)

  • DefineRuntimeSettings(定義進階配置參數)

  • DefinePartitionKey(定義分區列)

Rename

RuleExpression

string

規則運算式,json string 格式。

  • 重新命名規則(Rename)樣本: {"expression":"${srcDatasourceName}_${srcDatabaseName}_0922","variables":\[{"variableName":"srcDatabaseName","variableRules":\[{"from":"fromdb","to":"todb"}\]}\]}

    • expression:為重新命名轉換規則運算式,運算式內支援變數包括:
      • ${srcDatasourceName}(源端資料來源名)

      • ${srcDatabaseName}(源端庫名)

      • ${srcTableName}(源端表名)

    • variables:為重新命名轉換規則運算式中各變數的建置規則,參數預設值為對應含義在源端的原始值,可按需定義一組字串替換規則對原始值進行改寫。
      • variableName:變數名,不含${}。

      • variableRules:變數建置規則組,按順序串列執行替換,from 原始字串;to 替換後字串。

  • 在目標端增加指定列並賦值規則(AddColumn)樣本: {"columns":\[{"columnName":"my_add_column","columnValueType":"Constant","columnValue":"123"}\]}

    如不指定,預設規則為不加列不複製。

    • columnName:附加的列名稱。

    • columnValueType:附加的列取實值型別,包括 Constant(常量)、Variable(變數)。

    • columnValue:附加的列取值。
      • 當 valueType=Constant 時,value 為自訂常量,String 類型。

      • 當 valueType=Variable 時,value 為內建變數。內建變數可選值包括:EXECUTE_TIME(執行時間,Long 類型)、DB_NAME_SRC(源端資料庫名稱,String 類型)、DATASOURCE_NAME_SRC(源端資料來源名稱,String 類型)、TABLE_NAME_SRC(源端表名,String 類型)、DB_NAME_DEST(目標端資料庫名稱,String 類型)、DATASOURCE_NAME_DEST(目標端資料來源名稱,String 類型)、TABLE_NAME_DEST(目標端表名,String 類型)、DB_NAME_SRC_TRANSED(轉換後的資料庫名稱,String 類型)。

  • 指定目標端表的主鍵列列名(DefinePrimaryKey)樣本: {"columns":\["ukcolumn1","ukcolumn2"\]}

    如不指定預設使用源端主鍵列。

    • 當目標端為已有表:Data Integration系統不會修改目標端表結構,如果指定的主鍵列不在目標端的列集合中,任務啟動會報錯提示。

    • 當目標端為自動建表:Data Integration系統會自動建立目標端表結構,表結構包含定義的主鍵列。當指定的主鍵列不在目標端的列集合中時,任務啟動會報錯提示。

  • DML 處理規則(HandleDml)樣本: {"dmlPolicies":\[{"dmlType":"Delete","dmlAction":"Filter","filterCondition":"id > 1"}\]}

    如不指定,預設規則為 Insert、Update、Delete 均為 Normal。

    • dmlType:DML 操作類型,Insert(插入)、Update(更新)、Delete(刪除)。

    • dmlAction:DML 處理策略,Normal(正常處理)、Ignore(忽略)、Filter(有條件的正常處理,當 dmlType=Update/Delete 時使用)、LogicalDelete(邏輯刪除)。

    • filterCondition:DML 過濾條件,當 dmlAction=Filter 時使用。

{"expression":"${srcDatasoureName}_${srcDatabaseName}"}

RuleName

string

規則名稱,當動作類型和動作作用的目標類型相同時,規則名稱需保證唯一性。

rename_rule_1

RuleTargetType

string

動作作用的目標類型,可選的資料類型有:

  • Table(表)

  • Schema(schema)

Table

TableMappings

array<object>

同步對象轉換映射列表,列表中每個元素描述了一組源端同步對象選擇規則列表和在該組同步對象上應用的同步對象轉換規則列表。

array<object>

同步對象轉換映射。

SourceObjectSelectionRules

array<object>

源端對象選擇規則,支援多條。

object

每條規則可選擇待同步源端對象的不同物件類型,如選擇源端資料庫、源端資料表。

Expression

string

運算式。

mysql_table_1

ObjectType

string

物件類型,可選的枚舉值有:

  • Table(表)

  • Database(資料庫)

Table

TransformationRules

array<object>

源端對象上應用的轉換規則列表。

object

源端對象上應用的轉換規則。

RuleActionType

string

動作類型,可選的枚舉值:

  • DefinePrimaryKey(定義主鍵)

  • Rename(重新命名)

  • AddColumn(增加列)

  • HandleDml(DML 處理)

  • DefineIncrementalCondition(定義增量條件)

  • DefineCycleScheduleSettings(定義周期調度設定)

  • DefineRuntimeSettings(定義進階配置參數)

  • DefinePartitionKey(定義分區列)

Rename

RuleName

string

規則名稱,在一種動作類型+動作作用的目標類型下規則名稱唯一。

rename_rule_1

RuleTargetType

string

動作作用的目標類型,可選的枚舉值有:

  • Table(表)

  • Schema(schema)

Table

JobSettings

object

同步任務維度設定,含 DDL 處理策略、源端和目標端列資料類型映射策略、任務運行時參數等。

ColumnDataTypeSettings

array<object>

列類型映射,支援多值。

object

列類型映射。

SourceDataType

string

源端類型。

bigint

DestinationDataType

string

目標端類型。

text

DdlHandlingSettings

array<object>

DDL 處理設定,支援多值。

object

DDL 處理設定。

Action

string

處理動作,可選的枚舉值:

  • Ignore(忽略)

  • Critical(報錯)

  • Normal(正常處理)

Critical

Type

string

DDL 類型,可選的枚舉值:

  • RenameColumn(重新命名列)

  • ModifyColumn(更新列)

  • CreateTable(建立表)

  • TruncateTable(清空表)

  • DropTable(刪除表)

  • DropColumn(刪除列)

  • AddColumn(新增列)

AddColumn

RuntimeSettings

array<object>

運行時設定,支援多值。

object

運行時設定。

Name

string

設定名稱,可選的枚舉值:

  • runtime.offline.speed.limit.mb(離線批量任務限流大小,當 runtime.offline.speed.limit.enable=true 時有效)

  • runtime.offline.speed.limit.enable(離線批量任務是否開啟限流)

  • dst.offline.connection.max(離線批量任務寫端最大串連數)

  • runtime.offline.concurrent(離線批量同步任務並發度)

  • dst.realtime.connection.max(即時任務寫端最大串連數)

  • runtime.enable.auto.create.schema(是否自動在目標端建立 schema)

  • src.offline.datasource.max.connection(離線批量任務源端最大串連數)

  • runtime.realtime.concurrent(即時任務並發度)

runtime.offline.concurrent

Value

string

設定取值。

1

CycleScheduleSettings

object

周期調度設定。

CycleMigrationType

string

需要周期調度的同步類型。取值範圍:

  • Full:全量

  • OfflineIncremental:離線增量

Full

ScheduleParameters

string

調度參數。

bizdate=$bizdate

ChannelSettings

string

通道相關任務設定,Json String 形式。

{"structInfo":"MANAGED","storageType":"TEXTFILE","writeMode":"APPEND","partitionColumns":[{"columnName":"pt","columnType":"STRING","comment":""}],"fieldDelimiter":""}

CreatedTime

integer

建立時間戳記,單位秒。

1671516776

CreatedUid

string

建立者使用者識別碼。

100000001

UpdatedTime

integer

最近一次更新時間戳記,單位秒。

1673859985

UpdatedUid

string

最近一次更新者使用者識別碼。

100000001

StartedTime

integer

最近一次啟動時間戳記,單位秒。

1673859999

StartedUid

string

最近一次啟動者使用者識別碼。

100000001

JobStatus

string

同步狀態,可選的枚舉值:

  • Finished(運行成功已結束)

  • Initialized(初始化完成)

  • Stopped(已停止)

  • Failed(運行失敗)

  • Running(運行中)

  • Stopping(停止中)

Finished

ErrorMessage

string

錯誤資訊,當 JobStatus=Failed 時使用。

error details xxx

RunStats

object

運行統計資訊

string

運行統計資訊詳情。

  • StructureMigrationTotalTables:結構同步表總數

  • StructureMigrationSuccessTables:結構同步表成功數

  • StructureMigrationFailedTables:結構同步表失敗數

  • StructureMigrationStatus:結構同步狀態,Waiting、Running、Finished、Failed、Stopped

  • StructureMigrationErrorMessage:結構同步錯誤資訊

  • FullMigrationTotalTables:全量同步表總數

  • FullMigrationSuccessTables:全量同步表成功數

  • FullMigrationFailedTables:全量同步表失敗數

  • FullMigrationStatus:全量同步狀態

  • FullMigrationErrorMessage:全量同步錯誤資訊

  • RealtimeMigrationMaxDelay:即時同步延遲時間長度,單位毫秒

  • RealtimeMigrationStatus:即時同步狀態

  • RealtimeMigrationErrorMessage:即時已同步錯誤資訊

StructureMigrationTotalTables

RequestId

string

請求 ID。

0000-ABCD-EFG****

樣本

正常返回樣本

JSON格式

{
  "Data": {
    "ProjectId": 22,
    "DIJobId": 11588,
    "JobName": "mysql_to_holo_sync_445",
    "Description": "Synchronize mysql to hologres\n",
    "MigrationType": "FullAndRealtimeIncremental",
    "SourceDataSourceType": "MySQL",
    "DestinationDataSourceType": "Hologres",
    "SourceDataSourceSettings": [
      {
        "DataSourceName": "mysql_datasource_1",
        "DataSourceProperties": {
          "key": "TimeZone"
        }
      }
    ],
    "DestinationDataSourceSettings": [
      {
        "DataSourceName": "holo_datasource_1",
        "DataSourceProperties": {
          "key": "TimeZone"
        }
      }
    ],
    "ResourceSettings": {
      "OfflineResourceSettings": {
        "ResourceGroupIdentifier": "S_res_group_111_222"
      },
      "RealtimeResourceSettings": {
        "ResourceGroupIdentifier": "S_res_group_111_222"
      },
      "RequestedCu": 2
    },
    "TransformationRules": [
      {
        "RuleActionType": "Rename",
        "RuleExpression": "{\"expression\":\"${srcDatasoureName}_${srcDatabaseName}\"}",
        "RuleName": "rename_rule_1",
        "RuleTargetType": "Table"
      }
    ],
    "TableMappings": [
      {
        "SourceObjectSelectionRules": [
          {
            "Expression": "mysql_table_1",
            "ObjectType": "Table"
          }
        ],
        "TransformationRules": [
          {
            "RuleActionType": "Rename",
            "RuleName": "rename_rule_1",
            "RuleTargetType": "Table"
          }
        ]
      }
    ],
    "JobSettings": {
      "ColumnDataTypeSettings": [
        {
          "SourceDataType": "bigint",
          "DestinationDataType": "text"
        }
      ],
      "DdlHandlingSettings": [
        {
          "Action": "Critical",
          "Type": "AddColumn"
        }
      ],
      "RuntimeSettings": [
        {
          "Name": "runtime.offline.concurrent",
          "Value": "1"
        }
      ],
      "CycleScheduleSettings": {
        "CycleMigrationType": "Full",
        "ScheduleParameters": "bizdate=$bizdate"
      },
      "ChannelSettings": "{\"structInfo\":\"MANAGED\",\"storageType\":\"TEXTFILE\",\"writeMode\":\"APPEND\",\"partitionColumns\":[{\"columnName\":\"pt\",\"columnType\":\"STRING\",\"comment\":\"\"}],\"fieldDelimiter\":\"\"}\n"
    },
    "CreatedTime": 1671516776,
    "CreatedUid": "100000001",
    "UpdatedTime": 1673859985,
    "UpdatedUid": "100000001",
    "StartedTime": 1673859999,
    "StartedUid": "100000001",
    "JobStatus": "Finished",
    "ErrorMessage": "error details xxx",
    "RunStats": {
      "key": "StructureMigrationTotalTables"
    }
  },
  "RequestId": "0000-ABCD-EFG****"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

500 InternalError.System An internal system error occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later.
429 Throttling.Api The request for this resource has exceeded your available limit.
429 Throttling.System The DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情