This topic describes how to use the ListDataSource API of OceanBase Migration Service (OceanBase Migration Service, OMS) Community Edition.
Purpose
This API is used to query the list of created data sources.
Call description
Limitations
This API is applicable to OMS Community Edition V4.1.1-CE and later.
Request path
POST /api/v2?Action=ListDataSource
Request parameters
| Parameter |
Type |
Description |
| searchKey |
string |
The name or ID of the data source. |
| types |
array |
A collection of data source types, such as MYSQL, OB_MYSQL, TIDB, KAFKA, DATAHUB, ROCKETMQ, and POSTGRESQL. |
| sortField |
string |
The field for sorting data sources. |
| order |
string |
The sorting order, which can be asc (ascending) or descend (descending). |
| pageNumber |
integer |
The page number. This parameter takes effect when the data is queried in pages. |
| pageSize |
integer |
The number of entries to return on each page. Default value: 10. |
Response parameters
| Parameter |
Type |
Description |
| success |
boolean |
Specifies whether the call is successful. |
| errorDetail |
object |
The details of the error. |
| code |
string |
The error code. |
| message |
string |
The description information. |
| advice |
string |
The suggestions. |
| requestId |
string |
The request ID. |
| pageNumber |
integer |
The page number. This parameter takes effect when the data is queried in pages. |
| pageSize |
integer |
The number of entries on each page. This parameter takes effect when the data is queried in pages. |
| totalCount |
integer |
The total number. This parameter takes effect when the data is queried in pages. |
| cost |
string |
The request duration, in seconds. |
| data |
string |
Information about the data source list. |
| ├─ id |
string |
The terminal identifier of the data source. |
| ├─ name |
string |
The name of the data source. |
| ├─ type |
string |
The type of the data source. |
| ├─ role |
string |
The role of the data source, which can be MASTER or SLAVE. |
| ├─ owner |
string |
The owner of the data source. |
| ├─ tenant |
string |
The name of the database tenant. |
| ├─ cluster |
string |
The name of the cluster where the database tenant is located. |
| ├─ schema |
string |
The name of the database. If specified, data migration or synchronization is performed for this database only. |
| ├─ ip |
string |
The IP address of the host that the database is located on. |
| ├─ port |
integer |
The port number of the IP address of the host that the database is located on. |
| ├─ userName |
string |
The name of the database user that is used for data migration or synchronization. |
| ├─ region |
string |
The region to which the data source belongs. |
| ├─ description |
string |
The remarks on the data source. It cannot exceed 128 characters. |
| ├─ ocpName |
string |
The name of the associated OCP. |
| ├─ oracleSid |
string |
The SID of the Oracle database. |
| ├─ oracleNlsLengthSemantics |
string |
The value of the nls_length_semantics attribute. This parameter is returned only for Oracle and Oracle tenants of OceanBase databases. |
| ├─ operatingSystem |
string |
The operating system. This parameter is not returned for OceanBase databases. |
| ├─ version |
string |
The version. |
| ├─ timezone |
string |
The time zone. |
| ├─ charset |
string |
The character encoding. |
| ├─ tryKeepHb |
boolean |
Specifies whether to attempt to maintain the heartbeat. |
| ├─ gmtCreate |
string |
The creation time of the data source, displayed in the UTC + 0 time zone. |
| ├─ gmtModified |
string |
The modification time of the data source, displayed in the UTC + 0 time zone. |
| ├─ partnerId |
string |
The ID of the primary or standby database. |
| ├─ connExtraAttributes |
object |
The connection additional attributes. For more information, see the Appendix. |
Examples
Sample request
{
"searchKey": "",
"types": [
"MYSQL"
],
"sortField": "gmtCreate",
"order": "asc",
"pageNumber": 1,
"pageSize": 10
}
Sample response
{
"success": true,
"errorDetail": null,
"code": null,
"message": null,
"advice": null,
"requestId": "d5627aa****929",
"pageNumber": 1,
"pageSize": 10,
"totalCount": 54,
"cost": "18 ms",
"data": [
{
"id": "e_4w****v",
"name": "RATION***1DBUTF11",
"type": "OB_MYSQL",
"role": "MASTER",
"owner": "ade**",
"tenant": "dwr***",
"cluster": "desx***",
"schema": "t12***mysql",
"ip": "xxx.xxx.xxx.1",
"port": 2883,
"userName": "dexf***",
"region": "cn-beijing",
"description": "test",
"ocpName": "xxx.xxx.xxx.2",
"operatingSystem": null,
"version": "4.1.0.1",
"timezone": "+08:00",
"charset": "UTF8",
"tryKeepHb": true,
"gmtCreate": "2023-07-13T19:57:28.000+00:00",
"gmtModified": "2023-07-13T20:37:28.000+00:00",
"partnerId": null,
"connExtraAttributes": {}
}
]
}
Appendix
Kafka
{
"connExtraAttributes":{
"endpoint":"xxx.xxx.xxx.1:2883",
"username":null,
"enableSSL":null,
"enableSASL":null,
"saslMechanism":null,
"disableIdentificationAlgorithm":false
}
}
| Parameter |
Type |
Description |
| endpoint |
string |
The service address. |
| username |
string |
The username. This parameter is required when the authentication method is set to PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. |
| enableSSL |
boolean |
Specifies whether to enable SSL authentication. If yes, a trusted certificate needs to be uploaded. |
| enableSASL |
boolean |
Specifies whether to enable SASL authentication. |
| saslMechanism |
KafkaSaslMechanisnEnum |
The encryption method. The options are PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, and KERBEROS. |
| disableIdentificationAlgorithm |
boolean |
Specifies whether to enable hostname verification for SSL encryption. |
DataHub
{
"connExtraAttributes":{
"endpoint":"xxx.xxx.xxx.1:2883",
"project":"detx***"
}
}
| Parameter |
Type |
Description |
| endpoint |
string |
The service address. |
| project |
string |
The name of the task. |
RocketMQ
{
"connExtraAttributes":{
"endpoint":"xxx.xxx.xxx.1:2883",
"endpointType":null,
"version":null
}
}
| Parameter |
Type |
Description |
| endpoint |
string |
The service address. |
| endpointType |
CloudRocketMQEndpoint.Type |
The type of the service address. |
| version |
CloudRocketMQInst.Version |
The RocketMQ version. |
OceanBase
{
"connExtraAttributes":{
"cluster":"xgez***",
"tenant":"gexr**",
"isLogicSource":false,
"useLogProxy":true,
"drcUser":"tes***",
"configUrl":"http://xxx.xxx.xxx.1:2883/service****",
"logProxyIp":"xxx.xxx.xxx.2",
"logProxyPort":2883,
"noUserAuth":false
}
}
| Parameter |
Type |
Description |
| cluster |
string |
The name of the cluster. |
| tenant |
string |
The name of the tenant. |
| isLogicSource |
boolean |
Specifies whether it is a logic data source. |
| useLogProxy |
boolean |
Specifies whether to use LogProxy. |
| drcUser |
string |
The configuration of drc_user. |
| configUrl |
string |
The URL for obtaining the true IP address of an underlying server of OceanBase Database. |
| logProxyIp |
string |
The IP address of LogProxy. |
| logProxyPort |
integer |
The port of LogProxy. |
| noUserAuth |
boolean |
For the API of synchronizing data from DataWorks, the data source is automatically generated by OMS. If no username and password are specified, you cannot connect to your OceanBase Database. |
TiDB
{
"connExtraAttributes":{
"kafkaId":"e_edz****",
"kafkaTopic":"test**",
"kafkaName":"denz***"
}
}
| Parameter |
Type |
Description |
| kafkaId |
string |
The ID of the bound Kafka data source. |
| kafkaTopic |
string |
The name of the bound Kafka topic. |
| kafkaName |
string |
The name of the bound Kafka data source. |