This topic describes the CreateMysqlDataSource API provided by OceanBase Migration Service (OMS).
Purpose
You can call this operation to create a MySQL data source.
Call description
Limitations
This operation is supported in OMS V4.1.0 and later.
Request path
POST /api/v2?Action=CreateMySqlDataSource
Request parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The data source ID. We recommend that you set it to a combination of digits and letters. It must not contain any spaces and cannot exceed 32 characters in length. |
| ip | string | The IP address of the host where the database is located. |
| port | integer | The port number of the host where the database is located. |
| schema | string | The name of the database for which data migration or synchronization is to be performed. |
| username | string | The name of the database user for data migration or synchronization. |
| password | string | The password of the database user. |
| tryKeepHb | boolean | Indicates whether OMS is allowed to automatically write heartbeat data to this instance during incremental synchronization. This resolves the issue of high latency when no business data is written in the source database. |
| region | string | The region where the data source resides. |
| description | string | The description of the data source. The value must not exceed 128 characters in length. |
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 error description. |
| advice | string | The suggestions about how to resolve the error. |
| requestId | string | The request ID. |
| pageNumber | integer | The number of the page to return. |
| pageSize | integer | The number of entries to return on each page. |
| totalCount | integer | The total number of entries returned. |
| cost | string | The time spent in processing the request, in seconds. |
| data | string | The ID of the MySQL data source. |
Examples
Sample request
{
"name":"mysql_test",
"ip":"xxx.xxx.xxx.1",
"port":2883,
"schema":"test",
"username":"tes***",
"password":"pas***",
"tryKeepHb":true,
"region":"cn-anhui",
"description":null
}
Sample response
{
"success":true,
"errorDetail":null,
"code":null,
"message":null,
"advice":null,
"requestId":"a7b57****",
"pageNumber":null,
"pageSize":null,
"totalCount":null,
"cost":"27 ms",
"data":"e_edz****"
}