This topic describes the OpenAPI provided by OceanBase Migration Service (OMS): ListDataSource, which is used to query the list of data sources.
Purpose
This interface is used to query the list of created data sources.
Call description
Limitations
This interface applies to OMS V4.1.0 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, which include MYSQL, OB_ORACLE, OB_MYSQL, ORACLE, TIDB, KAFKA, DATAHUB, ROCKETMQ, DB2_LUW, POSTGRESQL, IDB, and DBP_OP_ROUTE. |
| sortField |
string |
The field for sorting data sources. |
| order |
string |
The sorting order of data sources, which can be asc (ascending) or descend (descending). |
| pageNumber |
integer |
The page number for paging queries. |
| pageSize |
integer |
The number of entries per page. Default value is 10. |
| Parameter |
Type |
Description |
| success |
boolean |
Specifies whether the call is successful. |
| errorDetail |
object |
Details about the error. |
| code |
string |
The error code. |
| message |
string |
The description of the error. |
| advice |
string |
Suggestions. |
| requestId |
string |
The ID of the request. |
| pageNumber |
integer |
The page number. This parameter is effective only when pagination query is performed. |
| pageSize |
integer |
The page size. This parameter is effective only when pagination query is performed. |
| totalCount |
integer |
The total number of records. This parameter is effective only when pagination query is performed. |
| cost |
string |
The time spent in processing the request, 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. Valid values: MYSQL, OB_ORACLE, OB_MYSQL, ORACLE, TIDB, KAFKA, DATAHUB, ROCKETMQ, DB2_LUW, POSTGRESQL, IDB, and DBP_OP_ROUTE. |
| ├─ role |
string |
The role of the data source. Valid values: MASTER and SLAVE. |
| ├─ owner |
string |
The owner of the data source. |
| ├─ tenant |
string |
The name of the database tenant. |
| ├─ cluster |
string |
The name of the cluster in which the database tenant resides. |
| ├─ schema |
string |
The name of the database. If you specify this parameter, data migration or synchronization is performed for only this database. |
| ├─ ip |
string |
The IP address of the host where the database resides. |
| ├─ port |
integer |
The port number of the host IP address. |
| ├─ userName |
string |
The name of the database user used for data migration or synchronization. |
| ├─ region |
string |
The region to which the data source belongs. |
| ├─ description |
string |
The remarks about the data source. The value of this parameter cannot exceed 128 characters. |
| ├─ ocpName |
string |
The name of the associated OCP. |
| ├─ oracleSid |
string |
The SID of the Oracle database. |
| ├─ oracleNlsLengthSemantics |
string |
The nls_length_semantics attribute. This parameter is valid only for Oracle and OceanBase Database compatible mode data sources. |
| ├─ operatingSystem |
string |
The operating system. This parameter is not returned for OceanBase data sources. |
| ├─ version |
string |
The version. |
| ├─ timezone |
string |
The time zone. |
| ├─ charset |
string |
The character set. |
| ├─ tryKeepHb |
boolean |
Specifies whether to attempt to maintain the heartbeat. |
| ├─ gmtCreate |
string |
The creation time of the data source, in the UTC + 0 time zone. |
| ├─ gmtModified |
string |
The modification time of the data source, in the UTC + 0 time zone. |
| ├─ partnerId |
string |
The ID corresponding to the primary or standby database. |
| ├─ connExtraAttributes |
Object |
The connection extra attributes. For more information about the return parameters, see the content in the Appendix. |
Examples
Request example
{
"searchKey": "",
"types": [
"MYSQL"
],
"sortField": "gmtCreate",
"order": "asc",
"pageNumber": 1,
"pageSize": 10
}
Response example
{
"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 endpoint of the service. |
| username |
string |
The username. This parameter is required when you set the authentication type to PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. |
| enableSSL |
boolean |
Specifies whether to enable SSL authentication. If SSL authentication is enabled, you must upload a trusted certificate. |
| enableSASL |
boolean |
Specifies whether to enable SASL authentication. |
| saslMechanism |
KafkaSaslMechanisnEnum |
The encryption method. Valid values: PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, and KERBEROS. |
| disableIdentificationAlgorithm |
boolean |
Specifies whether to enable hostname verification for SSL encryption. |
When an Oracle data source serves as the source or the target and you configure to obtain incremental data from Kafka, the following response parameters are added to the connExtraAttributes object.
| Parameter |
Type |
Description |
| kafkaId |
string |
The ID of the bound Kafka data source after you select the option to obtain incremental data from Kafka. |
| kafkaTopic |
string |
The topic of the bound Kafka data source. |
| cdcDataFormat |
string |
The incremental message format. Valid values: ogg_json and ogg_json_row. |
| kafkaName |
string |
The name of the bound Kafka data source. |
DataHub
{
"connExtraAttributes":{
"endpoint":"xxx.xxx.xxx.1:2883",
"project":"detx***"
}
}
| Parameter |
Type |
Description |
| endpoint |
string |
The endpoint of the service. |
| 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 endpoint of the service. |
| endpointType |
CloudRocketMQEndpoint.Type |
The type of the endpoint. |
| version |
CloudRocketMQInst.Version |
The version of RocketMQ. |
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 the data source is a logical data source. |
| useLogProxy |
boolean |
Specifies whether to use LogProxy. |
| drcUser |
string |
The configuration of drc_user. |
| configUrl |
string |
The URL for obtaining the real IP address of the underlying server of OceanBase Database. |
| logProxyIp |
string |
The IP address of LogProxy. |
| logProxyPort |
integer |
The port number of LogProxy. |
| noUserAuth |
boolean |
For the interface of DataWorks, the data source is automatically generated by OMS. If no username and password are provided, the OceanBase Database of the user cannot be connected. |
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. |