This topic describes the CreateProject operation provided by OceanBase Migration Service (OMS).
Description
This operation is used to create a data migration or synchronization project.
Call description
Limitations
This operation is available in OMS V4.1.0 and later.
Request path
POST /api/v2?Action=CreateProject
Request parameters
| Parameter | Type | Description |
|---|---|---|
| name | String | The name of the project, which cannot contain spaces. |
| type | String | The type of the project. Valid values include MIGRATION and SYNC. |
| labelIds | String | The tag IDs. You can specify up to five tag 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 the objects to be transferred. |
| ├─ mode | String | The mapping mode for the objects to be transferred. Valid values include SPECIFIC and WILDCARD, which indicate specifying specific objects and matching objects by using a rule, respectively. |
| ├─ databases | Array | The database objects to be transferred. For more information, see Parameters in databases/databasesBlack. |
| ├─ databasesBlack | Array | The blocklist of database objects used for the WILDCARD mode. For more information, see Parameters in databases/databasesBlack. |
| ├─ tableAndViewWhiteList | Array | The wildcard-based allowlist of tables and views used for the WILDCARD mode. |
| ├─ tableAndViewBlackList | Array | The wildcard-based blocklist of tables and views used for the WILDCARD mode. |
| commonTransferConfig | Object | The common settings for transfer. |
| ├─ tableCategory | String | The supported table types. Valid values include ALL, WITHUNIQUEROWID, and WITHOUTUNIQUEROWID. The default value is ALL. |
| ├─ activeActive | Boolean | Specifies whether to enable active-active disaster recovery. |
| ├─ mqSerializerType | String | The JSON data serialization type for delivering data to message queues. Valid values include DEFAULT, CANAL, DATAWORKS_V2, SHAREPLEX, DEFAULT_WITH_SCHEMA, DEBEZIUM, DEBEZIUMFLATTEN, and DEBEZIUMSMT. |
| ├─ mqPartitionMode | String | The partition routing mode for delivering data to message queues. Valid values include ONE, HASH, and TABLE. ONE specifies to deliver data to a specified partition. HASH specifies to deliver data to HASH partitions based on the primary key column or sharding columns. TABLE specifies to deliver data to HASH partitions based on database and table names. |
| ├─ mqPartition | Integer | When the partitionMode parameter is set to ONE, this parameter indicates the location of the partition to which data is delivered in the current topic. |
| ├─ datahubTopicType | String | The type of the topic for delivering data to DataHub. Valid values include TUPLE and BLOB. |
| ├─ rocketMqProducerGroup | String | The name of the producer group. This parameter takes effect when the type of destination data source is RocketMQ. The default value is OMS. |
| ├─ rocketMqMsgTags | String | The tag of the message. This parameter takes effect when the type of destination data source is RocketMQ. For example, when the value is default, the _tag suffix is added to the value by default. |
| ├─ rocketMqEnableMsgTrace | Boolean | Specifies whether to enable message tracing. This parameter takes effect when the type of destination data source is RocketMQ. |
| ├─ rocketMqSendMsgTimeout | Long | The message delivery timeout period. This parameter takes effect when the type of destination data source is RocketMQ. |
| ├─ dataWorksBusinessName | String | The ID of the business system. |
| enableStructTransfer | Boolean | Specifies whether to allow schema transfer. |
| structTransferConfig | Object | The settings for schema transfer. |
| ├─ byteCharConvertStrategy | String | The BYTE/CHAR conversion scheme. Valid values include IGNORE_BYTE_IF_BYTE_USED, FORCE_CHAR_IF_BYTE_USED, EXPAND_LEN_IF_BYTE_USED, and DO_NOTHING_IF_BYTE_USED. The default value is DO_NOTHING_IF_BYTE_USED. |
| ├─ deferIndexCreation | Boolean | Specifies whether to allow post-indexing. The default value is false. |
| enableFullTransfer | Boolean | Specifies whether to enable full transfer. |
| enableFullVerify | Boolean | Specifies whether to enable full verification. |
| fullTransferConfig | Object | The settings for full transfer. |
| ├─ nonePkUkTruncateDstTable | Boolean | Specifies whether to clear the destination table during full migration from a table without a unique index. |
| ├─ allowDestTableNotEmpty | Boolean | Specifies whether to allow the destination table to be non-empty. You must set this parameter to true if you want to migrate data from multiple source tables to one destination table. Notice This parameter is available only when full verification is disabled. |
| ├─ fullTransferSpeedMode | String | The concurrency for full migration. Valid values include STEADY, NORMAL, and FAST. |
| ├─ fullVerifySpeedMode | String | The concurrency for full verification. Valid values include STEADY, NORMAL, and FAST. |
| enableIncrTransfer | Boolean | Specifies whether to enable incremental synchronization. |
| enableReverseIncrTransfer | Boolean | Specifies whether to enable reverse incremental synchronization. |
| incrTransferConfig | Object | The settings for incremental synchronization. |
| ├─ startTimestamp | string | The start timestamp for incremental synchronization. This parameter is available only when incremental synchronization is enabled and full transfer is disabled. |
| ├─ recordTypeWhiteList | String | The data types of incremental data to be synchronized in incremental synchronization. Supported data types include HEARTBEAT, INSERT, UPDATE, DELETE, BEGIN, COMMIT, ROLLBACK, DDL, and ROW. |
| ├─ storeLogKeptHour | Integer | The retention period in hours of logs when incremental synchronization is enabled and the incremental log pull component is Store. The default retention period is seven 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. The default value is 64. |
| ├─ enableIncrSyncStatistics | Boolean | Specifies whether to enable statistics collection for incremental DML and DDL operation records. |
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 ID of the database. tables Array The settings for the table objects to be transferred in the current database. When the modeparameter is set toWILDCARD, this parameter indicates the settings for a specific blocklist or allowlist of tables and views.├─ mappedName String The mapped table name. ├─ name String The name of the table. ├─ id String The ID of the table. ├─ whereClause String The WHEREclause in the standard SQL syntax that is used to configure row filtering.├─ filterColumns Array The filter columns. ├─ shardColumns Array The sharding columns. views Array The settings for the view objects to be transferred in the current database. ├─ mappedName String The mapped view name. ├─ name String The name of the view. ├─ id String The ID of the view. ├─ whereClause String The WHEREclause in the standard SQL syntax that is used to configure row filtering.├─ filterColumns Array The filter columns. ├─ shardColumns Array The sharding columns. specificTables Array The settings for the matched table objects. When the modeparameter is set toWILDCARD, this parameter indicates the rename and row filtering settings for the matched table objects.├─ mappedName String The mapped table name. ├─ name String The name of the table. ├─ id String The ID of the table. ├─ whereClause String The WHEREclause in the standard SQL syntax that is used to configure row filtering.├─ filterColumns Array The filter columns. ├─ shardColumns Array The sharding columns. specificViews Array The settings for the matched view objects. When the modeparameter is set toWILDCARD, this parameter indicates the rename settings for the matched view objects.├─ mappedName String The mapped view name. ├─ name String The name of the view. ├─ id String The ID of the view. ├─ whereClause String The WHEREclause in the standard SQL syntax that is used to configure row filtering.├─ filterColumns Array The filter columns. ├─ shardColumns Array The sharding columns.
Response parameters
| Parameter | Type | Description |
|---|---|---|
| success | Boolean | Indicates whether the call is successful. |
| errorDetail | Object | The error details. |
| code | String | The error code. |
| message | String | The description. |
| advice | String | The suggestions. |
| requestId | String | The request ID. |
| pageNumber | Integer[int32] | The page number, which takes effect in a pagination query. |
| pageSize | Integer[int32] | The page size, which takes effect in a pagination query. |
| totalCount | Integer[int64] | The total number of pages returned, which takes effect in a pagination query. |
| 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":[
{
"mappedName":"gez3***",
"name":"ion1****bmysql",
"id":null,
"tables":[
{
"mappedName":"tion12***20obmysql2",
"name":"GRATION129****",
"id":null,
"whereClause":null,
"filterColumns":null,
"shardColumns":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_****"
}