GetDIJob

Updated at:

Queries a data integration task.

Operation description

You must purchase DataWorks Basic Edition or higher to use this feature.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

Id

integer

No

The ID of the data integration synchronization task. You can obtain the ID from the PagingInfo.DIJobs[].Id parameter returned by the ListDIJobs operation.

11588

WithDetails

boolean

No

Specifies whether to return detailed configuration information. The detailed configuration information includes TransformationRules, TableMappings, and JobSettings. Default value: true.

true

ProjectId

integer

No

The ID of the DataWorks workspace. You can call the ListProjects operation to obtain the workspace ID.

10000

DIJobId deprecated

integer

No

[Deprecated] This field is deprecated. Use the Id field instead.

11588

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. You can use the ID to locate logs and troubleshoot issues.

C99E2BE6-9DEA-5C2E-8F51-1DDCFEADE490

PagingInfo

object

The configuration details of the synchronization task.

Id

integer

The ID of the task.

32601

Description

string

The description.

description

DestinationDataSourceSettings

array<object>

The list of destination data source properties.

object

The properties of a single destination data source.

DataSourceName

string

The name of the destination data source.

dw_mysql

DestinationDataSourceType

string

The type of the destination data source. Valid values: Hologres, OSS-HDFS, OSS, MaxCompute, LogHub, StarRocks, DataHub, AnalyticDB_For_MySQL, Kafka, and Hive.

Hologres

JobName

string

The name of the task.

imp_ods_dms_det_dealer_info_df

JobSettings

object

The runtime settings.

ChannelSettings

string

The channel-related task settings. You can configure specific channels. Currently, Holo2Holo (synchronization from Hologres to Hologres) and Holo2Kafka (synchronization from Hologres to Kafka) are supported.

  1. Holo2Kafka

  • Example: {"destinationChannelSettings":{"kafkaClientProperties":[{"key":"linger.ms","value":"100"}],"keyColumns":["col3"],"writeMode":"canal"}}

  • kafkaClientProperties: the Kafka producer parameters used when writing data to Kafka.

  • keyColumns: the Kafka columns to which data is written.

  • writeMode: the format in which data is written to Kafka. Valid values: json and canal.

  1. Holo2Holo

  • Example: {"destinationChannelSettings":{"conflictMode":"replace","dynamicColumnAction":"replay","writeMode":"replay"}}

  • conflictMode: the conflict handling policy when writing data to Hologres. Valid values: replace (overwrite) and ignore (ignore).

  • writeMode: the method used to write data to Hologres. Valid values: replay (replay) and insert (insert).

  • dynamicColumnAction: the method used to write dynamic columns to Hologres. Valid values: replay (replay), insert (insert), and ignore (ignore).

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

ColumnDataTypeSettings

array<object>

The column type mappings.

object

The column type mappings.

DestinationDataType

string

The destination data type, such as bigint, boolean, string, text, datetime, timestamp, decimal, or binary. Data types vary based on the data source type.

text

SourceDataType

string

The source data type, such as bigint, boolean, string, text, datetime, timestamp, decimal, or binary. Data types vary based on the data source type.

bigint

CycleScheduleSettings

object

The periodic scheduling settings.

CycleMigrationType

string

The synchronization type that requires periodic scheduling. Valid values:

  • Full: full data synchronization.

  • OfflineIncremental: batch incremental data synchronization.

Full

ScheduleParameters

string

The scheduling parameters.

bizdate=$bizdate

DdlHandlingSettings

array<object>

The array of DDL handling settings, which includes a list of DDL types to be handled and their corresponding rules.

object

A single DDL handling rule.

Action

string

The handling action. Valid values:

  • Ignore: ignores the DDL statement.

  • Critical: reports an error.

  • Normal: handles the DDL statement normally.

Ignore

Type

string

The DDL type. Valid values:

  • RenameColumn: renames a column.

  • ModifyColumn: modifies a column.

  • CreateTable: creates a table.

  • TruncateTable: truncates a table.

  • DropTable: drops a table.

CreateTable

RuntimeSettings

array<object>

The runtime settings.

object

The runtime settings.

Name

string

The name of the setting. Valid values:

  • src.offline.datasource.max.connection: the maximum number of connections to the source for batch tasks.

  • dst.offline.truncate: specifies whether to truncate the destination table.

  • runtime.offline.speed.limit.enable: specifies whether to enable throttling for batch tasks.

  • runtime.offline.concurrent: the concurrency of batch synchronization tasks.

  • runtime.enable.auto.create.schema: specifies whether to automatically create a schema at the destination.

  • runtime.realtime.concurrent: the concurrency of real-time tasks.

  • runtime.realtime.failover.minute.dataxcdc: the wait time in minutes before restarting after a failover failure.

  • runtime.realtime.failover.times.dataxcdc: the number of restart attempts after a failover failure.

runtime.offline.concurrent

Value

string

The value of the setting.

1

MigrationType

string

The synchronization type. Valid values:

  • FullAndRealtimeIncremental: full and real-time incremental data synchronization (real-time synchronization for the entire database).

  • RealtimeIncremental: real-time incremental data synchronization (real-time synchronization for a single table).

  • Full: full data synchronization (batch synchronization for the entire database).

  • OfflineIncremental: batch incremental data synchronization (batch synchronization for the entire database).

  • FullAndOfflineIncremental: full and batch incremental data synchronization (batch synchronization for the entire database).

FullAndRealtimeIncremental

JobType

string

The task type. Valid values:

  • DatabaseRealtimeMigration: real-time synchronization for the entire database. Synchronizes multiple tables from multiple source databases in streaming mode. Supports full data only, incremental data only, or both full and incremental data.

  • DatabaseOfflineMigration: batch synchronization for the entire database. Synchronizes multiple tables from multiple source databases in batch mode. Supports full data only, incremental data only, or both full and incremental data.

  • SingleTableRealtimeMigration: real-time synchronization for a single table. Synchronizes a single source table in streaming mode.

DatabaseRealtimeMigration

ProjectId

integer

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the workspace configuration page to obtain the workspace ID.

This parameter specifies the DataWorks workspace for the current API operation.

98330

ResourceSettings

object

The resource settings.

OfflineResourceSettings

object

The batch synchronization resources.

RequestedCu

number

The number of compute units (CUs) of the scheduling resource group used by the batch synchronization task.

2.0

ResourceGroupIdentifier

string

The name of the data integration resource group used for batch synchronization.

di_resourcegroup_v1

RealtimeResourceSettings

object

The real-time synchronization resources.

RequestedCu

number

The number of CUs of the data integration resource group used for real-time synchronization.

2.0

ResourceGroupIdentifier

string

The name of the data integration resource group used by the real-time task.

di_resourcegroup_v1

ScheduleResourceSettings

object

The scheduling resources.

RequestedCu

number

The number of CUs of the data integration resource group used by the batch scheduling task.

2.0

ResourceGroupIdentifier

string

The name of the scheduling resource group used by the batch scheduling task.

schedual_resourcegroup_v1

SourceDataSourceSettings

array<object>

The array of source data source settings.

array<object>

The settings of a single source data source.

DataSourceName

string

The name of the data source.

dw_mysql

DataSourceProperties

object

The properties of the data source.

Encoding

string

The database encoding.

UTF-8

Timezone

string

The time zone.

GMT+8

SourceDataSourceType

string

The type of the source data source. Valid values: PolarDB, MySQL, Kafka, LogHub, Hologres, Oracle, OceanBase, MongoDB, RedShift, Hive, SQLServer, Doris, and ClickHouse.

Mysql

TableMappings

array<object>

The list of transformation mappings for synchronization objects. Each element in the list describes a set of source object selection rules and a list of transformation rules applied to the selected synchronization objects.

Note

[ { "SourceObjectSelectionRules":[ { "ObjectType":"Database", "Action":"Include", "ExpressionType":"Exact", "Expression":"biz_db" }, { "ObjectType":"Schema", "Action":"Include", "ExpressionType":"Exact", "Expression":"s1" }, { "ObjectType":"Table", "Action":"Include", "ExpressionType":"Exact", "Expression":"table1" } ], "TransformationRuleNames":[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema" } ] } ]

array<object>

Each rule represents a table selected for synchronization.

SourceObjectSelectionRules

array<object>

Each rule selects a set of source objects to be synchronized. Multiple rules combine to select a single table.

object

Each rule can select different object types of the source objects to be synchronized, such as source databases or source tables.

Action

string

The selection action. Valid values: Include and Exclude.

Include

Expression

string

The expression.

mysql_table_1

ExpressionType

string

The expression type. Valid values: Exact and Regex.

Exact

ObjectType

string

The object type. Valid values:

  • Table: table.

  • Schema: schema.

  • Database: database.

Table

TransformationRules

array<object>

The list of transformation rule definitions for synchronization objects. Each element in the list is a transformation rule definition.

object

The transformation rule applied to the source object.

RuleName

string

The name of the rule. The rule name must be unique when the action type and the target type of the action are the same.

rename_rule_1

RuleActionType

string

The action type. Valid values:

  • DefinePrimaryKey: defines the primary key.

  • Rename: renames the object.

  • AddColumn: adds a column.

  • HandleDml: handles DML operations.

AddColumn

RuleTargetType

string

The target type of the action. Valid values:

  • Table: table.

  • Schema: schema.

  • Database: database.

Table

TransformationRules

array<object>

The list of transformation rule definitions for synchronization objects.

Note

[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema", "RuleExpression":"{"expression":"${srcDatasoureName}_${srcDatabaseName}"}" } ]

object

The list of transformation rule definitions for synchronization objects. Each element in the list is a transformation rule definition.

RuleActionType

string

The action type. Valid values:

  • DefinePrimaryKey: defines the primary key.

  • Rename: renames the object.

  • AddColumn: adds a column.

  • HandleDml: handles DML operations.

  • DefineIncrementalCondition: defines the incremental condition.

  • DefineCycleScheduleSettings: defines the periodic scheduling settings.

  • DefinePartitionKey: defines the partition key.

Rename

RuleExpression

string

The rule expression in JSON string format.

  1. Rename rule (Rename)

  • Example: {"expression":"${srcDatasourceName}_${srcDatabaseName}_0922" }

  • expression: the expression for the rename transformation rule. Supported variables in the expression include: ${srcDatasourceName} (source data source name), ${srcDatabaseName} (source database name), and ${srcTableName} (source table name).

  1. Add column rule (AddColumn)

  • Example: {"columns":[{"columnName":"my_add_column","columnValueType":"Constant","columnValue":"123"}]}

  • If not specified, the default rule is to add no columns and perform no replication.

  • columnName: the name of the added column.

  • columnValueType: the value type of the added column. Valid values: Constant and Variable.

  • columnValue: the value of the added column. When columnValueType is set to Constant, the value is a custom constant of the String type. When columnValueType is set to Variable, the value is a built-in variable. Valid built-in variables include: EXECUTE_TIME (execution time, Long type), DB_NAME_SRC (source database name, String type), DATASOURCE_NAME_SRC (source data source name, String type), TABLE_NAME_SRC (source table name, String type), DB_NAME_DEST (destination database name, String type), DATASOURCE_NAME_DEST (destination data source name, String type), TABLE_NAME_DEST (destination table name, String type), and DB_NAME_SRC_TRANSED (transformed database name, String type).

  1. Specify the primary key column names for the destination table (DefinePrimaryKey)

  • Example: {"columns":["ukcolumn1","ukcolumn2"]}

  • If not specified, the source primary key columns are used by default.

  • When the destination is an existing table: the data integration system does not modify the destination table schema. If the specified primary key columns are not in the destination column set, an error is reported when the task starts.

  • When the destination uses automatic table creation: the data integration system automatically creates the destination table schema, which includes the defined primary key columns. If the specified primary key columns are not in the destination column set, an error is reported when the task starts.

  1. DML handling rule (HandleDml)

  • Example: {"dmlPolicies":[{"dmlType":"Delete","dmlAction":"Filter","filterCondition":"id > 1"}]}

  • If not specified, the default rule is Normal for Insert, Update, and Delete.

  • dmlType: the DML operations type. Valid values: Insert, Update, and Delete.

  • dmlAction: the DML handling policy. Valid values: Normal (normal handling), Ignore (ignore), Filter (conditional normal handling, used when dmlType is Update or Delete), and LogicalDelete (logical deletion).

  • filterCondition: the DML filter condition, used when dmlAction is set to Filter.

  1. Incremental condition (DefineIncrementalCondition)

  • Example: {"where":"id > 0"}

  • Specifies the incremental filter condition.

  1. Periodic scheduling parameters (DefineCycleScheduleSettings)

  • Example: {"cronExpress":" * * * * * *", "cycleType":"1"}

  • Specifies the scheduling parameters for the periodic task.

  1. Specify the partition key (DefinePartitionKey)

  • Example: {"columns":["id"]}

  • Specifies the partition key.

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

RuleName

string

The name of the rule. The rule name must be unique under a specific combination of action type and target type.

rename_rule_1

RuleTargetType

string

The target type of the action. Valid values:

  • Table: table.

  • Schema: schema.

  • Database: database.

Table

JobStatus

string

The status of the task. Synchronization status. Valid values:

  • Finished: The task is completed successfully.

  • Failed: The task failed.

  • Running: The task is running.

  • Initialized: The task is initialized but not started.

  • Stopping: The task is being stopped.

  • Stop: The task is stopped.

Running

DIJobId deprecated

string

[Deprecated] This field is deprecated. Use the Id field instead.

32601

Owner

string

The owner of the task.

3726346

Examples

Success response

JSON format

{
  "RequestId": "C99E2BE6-9DEA-5C2E-8F51-1DDCFEADE490",
  "PagingInfo": {
    "Id": 32601,
    "Description": "description",
    "DestinationDataSourceSettings": [
      {
        "DataSourceName": "dw_mysql"
      }
    ],
    "DestinationDataSourceType": "Hologres",
    "JobName": "imp_ods_dms_det_dealer_info_df",
    "JobSettings": {
      "ChannelSettings": "{\"structInfo\":\"MANAGED\",\"storageType\":\"TEXTFILE\",\"writeMode\":\"APPEND\",\"partitionColumns\":[{\"columnName\":\"pt\",\"columnType\":\"STRING\",\"comment\":\"\"}],\"fieldDelimiter\":\"\"}",
      "ColumnDataTypeSettings": [
        {
          "DestinationDataType": "text",
          "SourceDataType": "bigint"
        }
      ],
      "CycleScheduleSettings": {
        "CycleMigrationType": "Full",
        "ScheduleParameters": "bizdate=$bizdate\n"
      },
      "DdlHandlingSettings": [
        {
          "Action": "Ignore",
          "Type": "CreateTable"
        }
      ],
      "RuntimeSettings": [
        {
          "Name": "runtime.offline.concurrent\n",
          "Value": "1"
        }
      ]
    },
    "MigrationType": "FullAndRealtimeIncremental",
    "JobType": "DatabaseRealtimeMigration",
    "ProjectId": 98330,
    "ResourceSettings": {
      "OfflineResourceSettings": {
        "RequestedCu": 2,
        "ResourceGroupIdentifier": "di_resourcegroup_v1"
      },
      "RealtimeResourceSettings": {
        "RequestedCu": 2,
        "ResourceGroupIdentifier": "di_resourcegroup_v1"
      },
      "ScheduleResourceSettings": {
        "RequestedCu": 2,
        "ResourceGroupIdentifier": "schedual_resourcegroup_v1"
      }
    },
    "SourceDataSourceSettings": [
      {
        "DataSourceName": "dw_mysql",
        "DataSourceProperties": {
          "Encoding": "UTF-8\n",
          "Timezone": "GMT+8\n"
        }
      }
    ],
    "SourceDataSourceType": "Mysql",
    "TableMappings": [
      {
        "SourceObjectSelectionRules": [
          {
            "Action": "Include",
            "Expression": "mysql_table_1",
            "ExpressionType": "Exact",
            "ObjectType": "Table"
          }
        ],
        "TransformationRules": [
          {
            "RuleName": "rename_rule_1",
            "RuleActionType": "AddColumn",
            "RuleTargetType": "Table"
          }
        ]
      }
    ],
    "TransformationRules": [
      {
        "RuleActionType": "Rename",
        "RuleExpression": "{\"expression\":\"${srcDatasoureName}_${srcDatabaseName}\"}",
        "RuleName": "rename_rule_1",
        "RuleTargetType": "Table"
      }
    ],
    "JobStatus": "Running",
    "DIJobId": "32601",
    "Owner": "3726346"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.