This topic describes the OpenAPI provided by OceanBase Migration Service (OMS) Community Edition: CreateTiDBDataSource.
Overview
This API is used to create a TiDB data source.
API details
Constraints
This API applies to OMS Community Edition V4.2.14-CE and later.
Request path
POST /api/v2?Action=CreateTiDBDataSource
Request parameters
Parameter |
Type |
Description |
|---|---|---|
| name | string | Data source identifier. It is recommended to use a combination of Chinese characters, numbers, and letters. The name must not contain spaces and must not exceed 32 characters in length. |
| ip | string | The IP address of the TiDB database. |
| port | integer | The port of the TiDB database. |
| username | string | The username for the TiDB database. |
| password | string | The TiDB database password, which must be Base64-encoded. You can obtain it by running the command echo -n "<original_password>" \| base64 to obtain it. |
| region | string | TiDB region. |
| kafkaId | string | The Kafka data source ID, which can be queried from the oms_endpoint table in the OMS metadata database. |
| kafkaTopic | string | The topic name for incremental data writes by TiCDC. |
Response parameters
Parameter |
Type |
Description |
|---|---|---|
| success | boolean | Whether the call was successful. |
| errorDetail | object | Error details. |
| code | string | Error code. |
| message | string | Description. |
| advice | string | Recommendation. |
| requestId | string | Request ID. |
| pageNumber | integer | Page number, which takes effect during paginated queries. |
| pageSize | integer | Number of records returned per page. This parameter takes effect when you perform a paginated query. |
| totalCount | integer | Total number, which takes effect during paginated queries. |
| cost | string | Request time, in milliseconds. |
| data | string | The ID of the TiDB database. |
Examples
Request example
{
"name": "tidb-kafka-api",
"ip": "xx.xx.xx.xx",
"port": 4000,
"username": "root",
"password": "******",
"region": "default",
"kafkaId": "e_******",
"kafkaTopic": "xx_0716"
}
Response example
{
"success": true,
"errorDetail": null,
"code": null,
"message": null,
"advice": null,
"requestId": "a7b57****",
"pageNumber": null,
"pageSize": null,
"totalCount": null,
"cost": "1108 ms",
"data": "tidb******"
}