This topic describes the CreateProject API provided by OceanBase Migration Service (OMS) Community Edition.
Purpose
You can call this operation to create a data migration or synchronization project.
Call description
Limitations
This operation is applicable to OMS Community Edition V4.1.1 and later versions.
Request path
POST /api/v2?Action=CreateProject
Request parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The project name, which must not contain spaces. |
| type | string | The project type. Valid values: MIGRATION and SYNC. |
| labelIds | string | A collection of at most five label IDs. |
| sourceEndpointId | string | The ID of the source data source. |
| sinkEndpointId | string | The ID of the destination data source. |
| transferMapping | object | The mapping information about migration or synchronization objects. |
| ├─ mode | string | The mapping mode of migration or synchronization objects. Valid values: SPECIFIC (Specify Objects mode) WILDCARD (Match Rules mode). |
| ├─ databases | array | A list of database objects. For more information, see the "Parameters in databases/databasesBlack" section of this topic. |
| ├─ databasesBlack | array | The database object blocklist in Match Rules mode. For more information, see the "Parameters in databases/databasesBlack" section of this topic. |
| ├─ tableAndViewWhiteList | array | The table/view allowlist in Match Rules mode. |
| ├─ tableAndViewBlackList | array | The table/view blocklist in Match Rules mode. |
| commonTransferConfig | object | The general migration or synchronization configurations. |
| ├─ tableCategory | string | The table type. Valid values: ALL (all tables), WITHUNIQUEROWID (tables with unique ROWIDs), and WITHOUTUNIQUEROWID (tables without unique ROWIDs). Default value: ALL. |
| ├─ activeActive | boolean | Specifies whether the scenario is an active-active disaster recovery scenario. |
| ├─ mqSerializerType | string | The JSON serialization type when data is delivered to MQ. Valid values: DEFAULT, CANAL, DATAWORKS_V2, SHAREPLEX, DEFAULT_WITH_SCHEMA, DEBEZIUM, DEBEZIUMFLATTEN, and DEBEZIUMSMT. |
| ├─ mqPartitionMode | string | The partition routing mode when data is delivered to MQ. Valid values: ONE, HASH, and TABLE. ONE indicates that data is delivered to specified partitions. HASH indicates that data is delivered to HASH partitions based on values of the primary key or sharding columns. TABLE indicates that data is delivered to HASH partitions based on database and table names. |
| ├─ mqPartition | integer | The position of the destination partition in the current topic when the value of partitionMode is set to ONE. |
| ├─ datahubTopicType | string | The type of the topic when data is delivered to a DataHub instance. Valid values: TUPLE and BLOB. |
| ├─ rocketMqProducerGroup | string | The name of the producer group. This parameter is valid only when the destination data source is RocketMQ. Default value: OMS. |
| ├─ rocketMqMsgTags | string | The message tag. This parameter is valid only when the destination data source is RocketMQ. The default value is default->default_tag, which indicates that when the value is default, a _tag suffix is automatically added to the value. |
| ├─ rocketMqEnableMsgTrace | boolean | Indicates whether message tracing is enabled. This parameter is valid only when the destination data source is RocketMQ. |
| ├─ rocketMqSendMsgTimeout | long | The message delivery timeout period. This parameter is valid only when the destination data source is RocketMQ. |
| ├─ dataWorksBusinessName | string | The name of the business system. |
| enableStructTransfer | boolean | Specifies whether to allow schema migration. |
| structTransferConfig | object | The schema migration configurations. |
| ├─ byteCharConvertStrategy | string | The conversion strategy between bytes and characters. Valid values: IGNORE_BYTE_IF_BYTE_USED, FORCE_CHAR_IF_BYTE_USED, EXPAND_LEN_IF_BYTE_USED, and DO_NOTHING_IF_BYTE_USED. Default value: DO_NOTHING_IF_BYTE_USED. |
| ├─ deferIndexCreation | boolean | Specifies whether to allow post-indexing. Default value: false. |
| enableFullTransfer | boolean | Specifies whether to enable full migration. |
| enableFullVerify | boolean | Specifies whether to enable full verification. |
| fullTransferConfig | object | The full migration configurations. |
| ├─ nonePkUkTruncateDstTable | boolean | Specifies whether to clear destination tables during the full migration of tables without unique indexes. |
| ├─ allowDestTableNotEmpty | string | Specifies whether to allow a nonempty destination table. This parameter is required when you migrate data from multiple source tables to a single destination table. Notice This parameter is supported only when full verification is disabled. |
| ├─ fullTransferSpeedMode | string | The concurrency for full migration. Valid values: STEADY, NORMAL, and FAST. |
| ├─ fullVerifySpeedMode | string | The concurrency for full verification. Valid values: STEADY, NORMAL, and FAST. |
| enableIncrTransfer | boolean | Specifies whether to enable incremental synchronization. |
| enableReverseIncrTransfer | boolean | Specifies whether to enable reverse incremental synchronization. |
| incrTransferConfig | object | The incremental synchronization configurations. |
| ├─ startTimestamp | string | The start timestamp for incremental synchronization. This parameter is supported only when incremental synchronization is enabled but full migration is disabled. |
| ├─ recordTypeWhiteList | string | The type of incremental data synchronized during incremental synchronization. Valid values: HEARTBEAT, INSERT, UPDATE, DELETE, BEGIN, COMMIT, ROLLBACK, DDL, and ROW. |
| ├─ storeLogKeptHour | integer | The retention period of logs when incremental synchronization is enabled and the incremental log pull component is Store. Unit: hours. Default value: 7 days. The maximum retention period is 365 days. |
| ├─ enableSequencingWithinTxn | boolean | Specifies whether to enable intra-transaction sequencing when incremental synchronization is enabled and the incremental log pull component is Store. |
| ├─ incrSyncConcurrency | integer | The number of threads for incremental synchronization. Default value: 64. |
| ├─ enableIncrSyncStatistics | boolean | Specifies whether to collect statistics on incremental records (DML and DDL operations). |
Parameters in databases/databasesBlack
Parameter Type Description mappedName string The name of the destination database. name string The name of the source database. id string The database ID. tables array The list of tables in the current database for migration. When the value of modeis set toWILDCARD, the value of this parameter is a blocklist or allowlist of tables and views.├─ mappedName string The name of the destination table. ├─ name string The name of the source table. ├─ id string The table ID. ├─ whereClause string A standard SQL WHEREclause used to filter data by row.├─ filterColumns array A collection of filter columns. ├─ shardColumns array A collection of sharding columns. ├─ columns For more information, see the "Parameters in columns" section of this topic. views array The list of views in the current database for migration. ├─ mappedName string The name of the destination view. ├─ name string The name of the source view. ├─ id string The view ID. ├─ whereClause string A standard SQL WHEREclause used to filter data by row.├─ filterColumns array A collection of filter columns. ├─ shardColumns array A collection of sharding columns. ├─ columns array The list of columns for migration. For more information, see the "Parameters in columns" section of this topic. specificTables array The list of table objects. When the value of modeis set toWILDCARD, the value of this parameter is the renaming or row-based filtering configurations of specific table objects.├─ mappedName string The name of the destination table. ├─ name string The name of the source table. ├─ id string The table ID. ├─ whereClause string A standard SQL WHEREclause used to filter data by row.├─ filterColumns array A collection of filter columns. ├─ shardColumns array A collection of sharding columns. ├─ columns array The list of columns for migration. For more information, see the "Parameters in columns" section of this topic. specificViews array The list of specific view objects. When the value of modeis set toWILDCARD, the value of this parameter is the renaming configurations of specific view objects.├─ mappedName string The name of the destination view. ├─ name string The name of the source view. ├─ id string The view ID. ├─ whereClause string A standard SQL WHEREclause used to filter data by row.├─ filterColumns array A collection of filter columns. ├─ shardColumns array A collection of sharding columns. ├─ columns array The list of columns for migration. For more information, see the "Parameters in columns" section of this topic. Parameters in columns
Parameter Type Description type string The type. Valid values: DATABASE and TABLE. columnName string The column name. mappedName string The name of the destination column. position integer The position of the parameter. columnType string The type of the column. recordFieldType string The derivation of the column type. rawColumnType string The original string of the column type recorded in the database. columnKey string The type of the index. nullable boolean Indicates whether null values are supported. defaultValue string The default value of the column. dataLength integer The length of the column. dataPrecision integer The precision of the column. dataScale integer The number of decimal places. encoding string The character encoding format of the column. columnComment string The comment of the column. isGenerateField boolean Specifies whether the column is a hidden column.
Return result
| Parameter | Type | Description |
|---|---|---|
| success | boolean | Indicates whether the call is successful. |
| errorDetail | object | The error details. |
| code | string | The error code. |
| message | string | The error description. |
| advice | string | The suggestions about how to resolve the error. |
| requestId | string | The request ID. |
| pageNumber | integer[int32] | The number of the page to return. |
| pageSize | integer[int32] | The number of entries to return on each page. |
| totalCount | integer[int64] | The total number of entries returned. |
| cost | string | The time spent in processing the request, in seconds. |
| data | string | The project ID. |
Examples
Sample request
{
"name":"test",
"type":"MIGRATION",
"labelIds":[
"l_4w****wygjk"
],
"sourceEndpointId":"e_4wg07f****",
"sinkEndpointId":"e_4wfy2****",
"transferMapping":{
"mode":"SPECIFIC",
"databases":[
{
"clusterName":null,
"tenantName":null,
"mappedName":"gez3***",
"name":"ion1****bmysql",
"id":"efetze***",
"tables":[
{
"mappedName":"tion12***20obmysql2",
"name":"GRATION129****",
"id":"dext***",
"whereClause":null,
"filterColumns":null,
"shardColumns":null,
"columns":null
}
],
"views":null,
"specificTables":null,
"specificViews":null
}
],
"databasesBlack":null,
"tableAndViewWhiteList":null,
"tableAndViewBlackList":null
},
"commonTransferConfig":{
"tableCategory":null,
"activeActive":false,
"mqSerializerType":null,
"mqPartitionMode":null,
"mqPartition":0,
"datahubTopicType":null,
"rocketMqProducerGroup":null,
"rocketMqMsgTags":null,
"rocketMqEnableMsgTrace":null,
"rocketMqSendMsgTimeout":null,
"dataWorksBusinessName":null
},
"enableStructTransfer":true,
"structTransferConfig":{
"byteCharConvertStrategy":"DO_NOTHING_IF_BYTE_USED",
"deferIndexCreation":true
},
"enableFullTransfer":true,
"enableFullVerify":true,
"fullTransferConfig":{
"nonePkUkTruncateDstTable":null,
"allowDestTableNotEmpty":true,
"fullTransferSpeedMode":"NORMAL",
"fullVerifySpeedMode":"NORMAL"
},
"enableIncrTransfer":true,
"enableReverseIncrTransfer":true,
"incrTransferConfig":{
"startTimestamp":1689201369,
"recordTypeWhiteList":[
"DELETE",
"INSERT",
"UPDATE"
],
"storeLogKeptHour":120,
"enableSequencingWithinTxn":true,
"incrSyncConcurrency":64,
"enableIncrSyncStatistics":true
}
}
Sample response
{
"Success":true,
"ErrorDetail":{
"Code":"CM-RES***11",
"Level":"WARN",
"Message":"A system error occurred.",
"Proposal":"Contact the administrator."
},
"Code":"INNER_ERROR",
"Message":"A system error occurred.",
"Advice":"Contact the administrator.",
"RequestId":"XCVSADG****DSGDS",
"PageNumber":1,
"PageSize":1,
"TotalCount":1,
"Cost":"27 ms",
"Data":"np_****"
}