CreateDIJob

Updated at:

Creates a task in the new version of Data Integration. Currently supported task types include the full-database real-time synchronization solution from MySQL to Hologres.

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

ProjectId

integer

No

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

10000

JobName

string

No

The name of the task.

mysql_to_holo_sync_8772

Description

string

No

The description of the task.

Synchronize mysql to hologres

MigrationType

string

No

The synchronization type. Valid values:

  • FullAndRealtimeIncremental: full and real-time incremental synchronization

  • RealtimeIncremental: real-time incremental synchronization

  • Full: full synchronization

  • OfflineIncremental: batch incremental synchronization

  • FullAndOfflineIncremental: full and batch incremental synchronization

FullAndRealtimeIncremental

SourceDataSourceType

string

No

The type of the source data source. Valid value: MySQL.

MySQL

DestinationDataSourceType

string

No

The type of the destination data source. Valid values: Hologres and Hive.

Hologres

SourceDataSourceSettings

array<object>

No

The settings of the source data source. Currently, only a single data source is supported.

array<object>

No

The settings of the source data source.

DataSourceName

string

No

The name of the data source.

mysql_datasource_1

DataSourceProperties

object

No

The properties of the data source.

string

No

The properties of the source data source. For a MySQL data source, supported property names include TimeZone (time zone) and Encoding (encoding).

TimeZone

DestinationDataSourceSettings

array<object>

No

The settings of the destination data source. Currently, only a single data source is supported.

array<object>

No

The settings of the destination data source.

DataSourceName

string

No

The name of the data source.

holo_datasource_1

DataSourceProperties

object

No

The properties of the data source.

string

No

The properties of the destination data source. Currently, no properties can be configured for a Hologres data source.

TimeZone

ResourceSettings

object

No

The resource settings.

OfflineResourceSettings

object

No

The batch synchronization resources.

ResourceGroupIdentifier

string

No

The identifier of the Data Integration resource group used for batch synchronization.

S_res_group_111_222

RealtimeResourceSettings

object

No

The real-time synchronization resources.

ResourceGroupIdentifier

string

No

The identifier of the Data Integration resource group used for real-time synchronization.

S_res_group_111_222

RequestedCu

number

No

The number of compute units (CUs) of the resource group used for the full and incremental synchronization task.

2.0

TransformationRules

array<object>

No

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

object

No

The transformation rule definition for a synchronization object.

RuleName

string

No

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

No

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

  • DefineRuntimeSettings: defines the advanced configuration parameters

  • DefinePartitionKey: defines the partition key

Rename

RuleTargetType

string

No

The target type of the action. Valid values:

  • Table: table

  • Schema: schema

Table

RuleExpression

string

No

The rule expression in JSON string format.

Example of a rename rule (Rename): {"expression":"${srcDatasourceName}_${srcDatabaseName}_0922","variables":[{"variableName":"srcDatabaseName","variableRules":[{"from":"fromdb","to":"todb"}]}]}

  • 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).

  • variables: the generation rules for each variable in the rename transformation rule expression. The default value of a parameter is the original value of the corresponding meaning at the source. You can define a set of string replacement rules to rewrite the original value as needed. variableName: the variable name, excluding the ${} characters. variableRules: the variable generation rule group. Replacements are performed in sequential execution. from: the original string. to: the replaced string.

Example of a rule to add a specified column and assign a value at the destination (AddColumn): {"columns":[{"columnName":"my_add_column","columnValueType":"Constant","columnValue":"123"}]}

  • If not specified, the default rule is that no columns are added and no replication is performed.

  • columnName: the name of the appended column.

  • columnValueType: the value type of the appended column. Valid values: Constant (constant) and Variable (variable).

  • columnValue: the value of the appended column. When valueType is Constant, value is a custom constant of the String type. When valueType is Variable, value is a built-in variable. Valid values for 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).

Example of specifying the primary key column names for the destination table (DefinePrimaryKey): {"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 column set of the destination, an error is reported when the task starts.

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

Example of a DML handling rule (HandleDml): {"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 (insert), Update (update), and Delete (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 delete).

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

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

TableMappings

array<object>

No

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

array<object>

No

The transformation mapping for a synchronization object.

SourceObjectSelectionRules

array<object>

No

The source object selection rules. Multiple rules are supported.

object

No

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

ObjectType

string

No

The object type. Valid values:

  • Table: table

  • Database: database

Table

Expression

string

No

The expression.

mysql_table_1

TransformationRules

array<object>

No

The list of transformation rules applied to the source objects.

object

No

The transformation rule applied to the source objects.

RuleName

string

No

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

rename_rule_1

RuleActionType

string

No

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

  • DefineRuntimeSettings: defines the advanced configuration parameters

  • DefinePartitionKey: defines the partition key

Rename

RuleTargetType

string

No

The target type of the action. Valid values:

  • Table: table

  • Schema: schema

Table

JobSettings

object

No

The settings at the synchronization task level, including DDL handling policies, column data type mapping policies between the source and destination, and task runtime parameters.

DdlHandlingSettings

array<object>

No

The DDL handling settings.

object

No

The DDL handling settings.

Type

string

No

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

  • DropColumn: drops a column

  • AddColumn: adds a column

AddColumn

Action

string

No

The handling action. Valid values:

  • Ignore: ignores the operation

  • Critical: reports an error

  • Normal: handles the operation normally

Critical

ColumnDataTypeSettings

array<object>

No

The column type mappings. Multiple values are supported.

object

No

The column type mapping.

SourceDataType

string

No

The source data type.

bigint

DestinationDataType

string

No

The destination data type.

text

RuntimeSettings

array<object>

No

The runtime settings. Multiple values are supported.

object

No

The runtime setting.

Name

string

No

The name of the setting. Valid values:

  • runtime.offline.speed.limit.mb: the throttling limit for batch tasks, which takes effect when runtime.offline.speed.limit.enable is set to true

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

  • dst.offline.connection.max: the maximum number of connections to the destination for batch tasks

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

  • dst.realtime.connection.max: the maximum number of connections to the destination for real-time tasks

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

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

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

runtime.offline.concurrent

Value

string

No

The value of the setting.

1

CycleScheduleSettings

object

No

The periodic scheduling settings.

CycleMigrationType

string

No

The synchronization type that requires periodic scheduling. Valid values:

  • Full: full synchronization

  • OfflineIncremental: batch incremental synchronization

Full

ScheduleParameters

string

No

The scheduling parameters.

bizdate=$bizdate

ChannelSettings

string

No

The channel-related task settings in JSON string format.

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

ImportRuleSettings

object

No

The import settings for the synchronization task.

Source

string

No

The source from which the task configuration is imported. Valid value: Datastudio (synchronization tasks in Data Studio).

Datastudio

FileId

string

No

The ID of the task to be imported.

10000

SystemDebug

string

No

Used for system debugging. Default value: false.

false

Response elements

Element

Type

Description

Example

object

The response data.

RequestId

string

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

4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB

DIJobId

integer

The ID of the Data Integration task.

11792

Examples

Success response

JSON format

{
  "RequestId": "4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB",
  "DIJobId": 11792
}

Error codes

HTTP status code

Error code

Error message

Description

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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.