ListDataSource - 查询数据源列表
本接口用于查询已创建数据源的列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| SearchKey |
string |
否 |
数据源的名称或 ID。 |
sourcename |
| Types |
array |
否 |
数据源类型的集合。 |
|
|
string |
否 |
数据源的类型。 |
MYSQL_PUBLIC |
|
| SortField |
string |
否 |
数据源排序的字段,包括 gmtCreate(默认值)和 gmtModified。 枚举值:
|
gmtCreate |
| Order |
string |
否 |
数据源排序的顺序,包括 |
descend |
| PageNumber |
string |
否 |
页序号,分页查询时生效。 |
1 |
| PageSize |
string |
否 |
页大小,分页查询时生效。 |
10 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| Success |
boolean |
是否调用成功。 |
true |
| ErrorDetail |
object |
错误详情。 |
|
| Code |
string |
错误码(新)。 |
CM-RESOAT1111 |
| Level |
string |
错误等级,包括 FATAL、ERROR、WARNING 和 CRITICAL。 |
ERROR |
| Message |
string |
错误描述(新)。 |
A system error occurred. |
| ExtraContext |
object |
用于填充 Message 中的占位符。 |
|
|
any |
用于填充 Message 中的占位符。 |
null |
|
| MessageMcmsKey |
string |
错误信息的 Key。 |
null |
| MessageMcmsContext |
object |
用于填充 MessageMcmsKey 中的占位符。 |
|
|
string |
用于填充 MessageMcmsKey 中的占位符。 |
null |
|
| Reason |
string |
错误原因。 |
null |
| ReasonMcmsKey |
string |
错误原因的 Key。 |
null |
| ReasonMcmsContext |
object |
错误原因的上下文。 |
|
|
string |
错误原因的上下文。 |
null |
|
| Proposal |
string |
建议(新)。 |
null |
| ProposalMcmsKey |
string |
建议内容的 Key。 |
null |
| ProposalMcmsContext |
object |
建议内容的上下文。 |
|
|
string |
建议内容的上下文。 |
null |
|
| UpstreamErrorDetail |
any |
上游错误详情,用于处理 HTTP 请求。 |
null |
| Code |
string |
错误码(旧)。 |
INNER_ERROR |
| Message |
string |
错误描述(旧)。 |
A system error occurred. |
| Advice |
string |
建议(旧)。 |
Contact the administrator. |
| RequestId |
string |
请求 ID。 |
EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C |
| PageNumber |
integer |
页序号,分页查询时生效。 |
1 |
| PageSize |
integer |
页大小,分页查询时生效。 |
10 |
| TotalCount |
integer |
总数,分页查询时生效。 |
132 |
| Cost |
string |
请求耗时,单位为秒。 |
28 |
| Data |
array<object> |
数据源列表的相关信息。 |
|
|
object |
|||
| Id |
string |
数据源终端标识。 |
e_4w****v |
| Name |
string |
数据源的名称。 |
RATION***1DBUTF11 |
| Type |
string |
数据源的类型。 |
MYSQL_PUBLIC |
| Role |
string |
数据源的角色,包括 |
MASTER |
| Owner |
string |
数据源的 Owner。 |
admin |
| Tenant |
string |
数据库租户的名称或 ID。 |
tenant_name |
| Cluster |
string |
数据库租户所在集群的名称或 ID。 |
cluster_name |
| Schema |
string |
数据库的名称。填写后,仅对该数据库进行数据迁移或数据同步。 |
schema_name |
| VpcId |
string |
用户申请公有云 VPC 的唯一 ID。 |
vpc_t4*** |
| Ip |
string |
数据库宿主机的 IP 地址。 |
xxx.xxx.xxx.1 |
| Port |
integer |
数据库宿主机 IP 的端口号。 |
2883 |
| UserName |
string |
用于数据迁移或数据同步的数据库用户的名称。 |
user_name |
| Region |
string |
数据源所属的地域。 |
cn-beijing |
| Description |
string |
数据源的备注信息,不能超过 128 个字符。 |
test |
| OracleSid |
string |
Oracle 数据库的 SID。 |
null |
| OracleNlsLengthSemantics |
string |
|
null |
| OperatingSystem |
string |
操作系统。OceanBase 数据源没有该参数。 |
Linux |
| Version |
string |
版本。 |
4.1.0 |
| Timezone |
string |
时区。 |
+08:00 |
| Charset |
string |
字符编码。 |
utf8mb4 |
| ResourceOwner |
string |
资源所有者。 |
178641****05809 |
| GmtCreate |
string |
数据源的创建时间,以 UTC + 0 时区的时间格式展示。 |
2023-07-13T20:27:28.000+00:00 |
| GmtModified |
string |
数据源的修改时间,以 UTC + 0 时区的时间格式展示。 |
2023-07-13T20:37:28.000+00:00 |
| PartnerId |
string |
对应主备库的 ID。 |
null |
| ConnExtraAttributes |
any |
连接额外属性。具体返回字段请参见《附录》模块的内容。 |
null |
附录
Kafka
{
"connExtraAttributes":{
"endpoint":"xxx.xxx.xxx.1:2883",
"username":null,
"enableSSL":null,
"enableSASL":null,
"saslMechanism":null,
"disableIdentificationAlgorithm":false
}
}
| 参数 | 类型 | 描述 |
| endpoint | string | 服务地址。 |
| username | string | 用户名。当您选择认证方式为 PLAIN、SCRAM-SHA-256 和 SCRAM-SHA-512 时,该参数必填。 |
| enableSSL | boolean | 是否开启 SSL 认证。如果开启,则需要上传授信证书。 |
| enableSASL | boolean | 是否开启 SASL 认证。 |
| saslMechanism | KafkaSaslMechanisnEnum | 加密方式,包括 PLAIN、SCRAM-SHA-256、SCRAM-SHA-512 和 KERBEROS。 |
| disableIdentificationAlgorithm | boolean | SSL 加密时,是否开启主机名验证。 |
DataHub
{
"connExtraAttributes":{
"endpoint":"xxx.xxx.xxx.1:2883",
"project":"detx***"
}
}
| 参数 | 类型 | 描述 |
| endpoint | string | 服务地址。 |
| project | string | 任务的名称。 |
RocketMQ
{
"connExtraAttributes":{
"endpoint":"xxx.xxx.xxx.1:2883",
"endpointType":null,
"version":null
}
}
| 参数 | 类型 | 描述 |
| endpoint | string | 服务地址。 |
| endpointType | CloudRocketMQEndpoint.Type | 服务地址的类型。 |
| version | CloudRocketMQInst.Version | 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
}
}
| 参数 | 类型 | 描述 |
| cluster | string | 集群的名称。 |
| tenant | string | 租户的名称。 |
| isLogicSource | boolean | 是否为逻辑数据源。 |
| useLogProxy | boolean | 是否使用 LogProxy。 |
| drcUser | string | drc_user 的配置。 |
| configUrl | string | 用于获取 OceanBase 数据库底层服务器的真实地址。 |
| logProxyIp | string | LogProxy 服务的 IP 地址。 |
| logProxyPort | integer | LogProxy 服务的端口。 |
| noUserAuth | boolean | 对于同步 DataWorks 的接口,数据源是 OMS 自动生成的。如果没有用户账号和密码,则不能连接用户的 OceanBase 数据库。 |
TiDB
{
"connExtraAttributes":{
"kafkaId":"e_edz****",
"kafkaTopic":"test**",
"kafkaName":"denz***"
}
}
| 参数 | 类型 | 描述 |
| kafkaId | string | 绑定的 Kafka 数据源的 ID。 |
| kafkaTopic | string | 绑定的 Kafka Topic 的名称。 |
| kafkaName | string | 绑定的 Kafka 数据源的名称。 |
示例
正常返回示例
JSON格式
{
"Success": true,
"ErrorDetail": {
"Code": "CM-RESOAT1111",
"Level": "ERROR",
"Message": "A system error occurred.",
"ExtraContext": {
"key": "null"
},
"MessageMcmsKey": "null",
"MessageMcmsContext": {
"key": "null"
},
"Reason": "null",
"ReasonMcmsKey": "null",
"ReasonMcmsContext": {
"key": "null"
},
"Proposal": "null",
"ProposalMcmsKey": "null",
"ProposalMcmsContext": {
"key": "null"
},
"UpstreamErrorDetail": "null"
},
"Code": "INNER_ERROR",
"Message": "A system error occurred.",
"Advice": "Contact the administrator. ",
"RequestId": "EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C",
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 132,
"Cost": "28",
"Data": [
{
"Id": "e_4w****v",
"Name": "RATION***1DBUTF11",
"Type": "MYSQL_PUBLIC",
"Role": "MASTER",
"Owner": "admin",
"Tenant": "tenant_name",
"Cluster": "cluster_name",
"Schema": "schema_name",
"VpcId": "vpc_t4***",
"Ip": "xxx.xxx.xxx.1",
"Port": 2883,
"UserName": "user_name",
"Region": "cn-beijing",
"Description": "test",
"OracleSid": "null",
"OracleNlsLengthSemantics": "null",
"OperatingSystem": "Linux",
"Version": "4.1.0",
"Timezone": "+08:00",
"Charset": "utf8mb4",
"ResourceOwner": "178641****05809",
"GmtCreate": "2023-07-13T20:27:28.000+00:00",
"GmtModified": "2023-07-13T20:37:28.000+00:00",
"PartnerId": "null",
"ConnExtraAttributes": "null"
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。