查询数据源信息

最近更新时间:2024-06-25 01:13:15

我的收藏

1. 接口描述

接口请求域名: dlc.tencentcloudapi.com 。

本接口(DescribeDatasourceConnection)用于查询数据源信息

默认接口请求频率限制:20次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:DescribeDatasourceConnection。
Version String 公共参数,本接口取值:2021-01-25。
Region String 公共参数,详见产品支持的 地域列表
DatasourceConnectionIds.N Array of String 连接ID列表,指定要查询的连接ID
示例值:[10001,10002]
Filters.N Array of Filter 过滤条件,当前支持的过滤键为:DatasourceConnectionName(数据源连接名)。
DatasourceConnectionType (数据源连接连接类型)
Offset Integer 偏移量,默认为0
示例值:0
Limit Integer 返回数量,默认20,最大值100
示例值:10
SortBy String 排序字段,支持如下字段类型,create-time(默认,创建时间)、update-time(更新时间)
示例值:create-time
Sorting String 排序方式,desc表示正序,asc表示反序, 默认为desc
示例值:asc
StartTime String 筛选字段:起始时间
示例值:2006-01-02 15:04:05
EndTime String 筛选字段:截止时间
示例值:2006-01-02 15:04:05
DatasourceConnectionNames.N Array of String 连接名称列表,指定要查询的连接名称
示例值:['test']
DatasourceConnectionTypes.N Array of String 连接类型,支持Mysql/HiveCos/Kafka/DataLakeCatalog
示例值:['Mysql']
HiveVersion.N Array of String 返回指定hive版本的数据源,该参数指定后,会过滤掉该参数指定版本以外的hive数据源,非hive数据源正常返回
示例值:['2.3.5']

3. 输出参数

参数名称 类型 描述
TotalCount Integer 数据连接总数
示例值:100
ConnectionSet Array of DatasourceConnectionInfo 数据连接对象集合
RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 test

输入示例

POST / HTTP/1.1
Host: dlc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDatasourceConnection
<公共请求参数>

{
    "DatasourceConnectionIds": [
        "abc"
    ],
    "Filters": [
        {
            "Name": "abc",
            "Values": [
                "abc"
            ]
        }
    ],
    "Offset": 0,
    "Limit": 0,
    "SortBy": "abc",
    "Sorting": "abc",
    "StartTime": "abc",
    "EndTime": "abc",
    "DatasourceConnectionNames": [
        "abc"
    ],
    "DatasourceConnectionTypes": [
        "abc"
    ],
    "HiveVersion": [
        "abc"
    ]
}

输出示例

{
    "Response": {
        "TotalCount": 0,
        "ConnectionSet": [
            {
                "Id": 0,
                "DatasourceConnectionId": "abc",
                "DatasourceConnectionName": "abc",
                "DatasourceConnectionDesc": "abc",
                "DatasourceConnectionType": "abc",
                "DatasourceConnectionConfig": {
                    "Mysql": {
                        "JdbcUrl": "abc",
                        "User": "abc",
                        "Password": "abc",
                        "Location": {
                            "VpcId": "abc",
                            "VpcCidrBlock": "abc",
                            "SubnetId": "abc",
                            "SubnetCidrBlock": "abc"
                        },
                        "DbName": "abc",
                        "InstanceId": "abc",
                        "InstanceName": "abc"
                    },
                    "Hive": {
                        "MetaStoreUrl": "abc",
                        "Type": "abc",
                        "User": "abc",
                        "HighAvailability": true,
                        "BucketUrl": "abc",
                        "HdfsProperties": "abc",
                        "Location": {
                            "VpcId": "abc",
                            "VpcCidrBlock": "abc",
                            "SubnetId": "abc",
                            "SubnetCidrBlock": "abc"
                        },
                        "Mysql": {
                            "JdbcUrl": "abc",
                            "User": "abc",
                            "Password": "abc",
                            "Location": {
                                "VpcId": "abc",
                                "VpcCidrBlock": "abc",
                                "SubnetId": "abc",
                                "SubnetCidrBlock": "abc"
                            },
                            "DbName": "abc",
                            "InstanceId": "abc",
                            "InstanceName": "abc"
                        },
                        "InstanceId": "abc",
                        "InstanceName": "abc",
                        "HiveVersion": "abc",
                        "KerberosInfo": {
                            "Krb5Conf": "abc",
                            "KeyTab": "abc",
                            "ServicePrincipal": "abc"
                        },
                        "KerberosEnable": true
                    },
                    "Kafka": {
                        "InstanceId": "abc"
                    },
                    "OtherDatasourceConnection": {
                        "Location": {
                            "VpcId": "abc",
                            "VpcCidrBlock": "abc",
                            "SubnetId": "abc",
                            "SubnetCidrBlock": "abc"
                        }
                    },
                    "PostgreSql": {
                        "InstanceId": "abc",
                        "InstanceName": "abc",
                        "JdbcUrl": "abc",
                        "User": "abc",
                        "Password": "abc",
                        "DbName": "abc",
                        "Location": {
                            "VpcId": "abc",
                            "VpcCidrBlock": "abc",
                            "SubnetId": "abc",
                            "SubnetCidrBlock": "abc"
                        }
                    },
                    "SqlServer": {
                        "InstanceId": "abc",
                        "InstanceName": "abc",
                        "JdbcUrl": "abc",
                        "User": "abc",
                        "Password": "abc",
                        "DbName": "abc"
                    },
                    "ClickHouse": {
                        "InstanceId": "abc",
                        "InstanceName": "abc",
                        "JdbcUrl": "abc",
                        "User": "abc",
                        "Password": "abc",
                        "DbName": "abc",
                        "Location": {
                            "VpcId": "abc",
                            "VpcCidrBlock": "abc",
                            "SubnetId": "abc",
                            "SubnetCidrBlock": "abc"
                        }
                    },
                    "Elasticsearch": {
                        "InstanceId": "abc",
                        "InstanceName": "abc",
                        "User": "abc",
                        "Password": "abc",
                        "DbName": "abc",
                        "Location": {
                            "VpcId": "abc",
                            "VpcCidrBlock": "abc",
                            "SubnetId": "abc",
                            "SubnetCidrBlock": "abc"
                        },
                        "ServiceInfo": [
                            {
                                "Ip": "abc",
                                "Port": 0
                            }
                        ]
                    },
                    "TDSQLPostgreSql": {
                        "InstanceId": "abc",
                        "InstanceName": "abc",
                        "JdbcUrl": "abc",
                        "User": "abc",
                        "Password": "abc",
                        "DbName": "abc",
                        "Location": {
                            "VpcId": "abc",
                            "VpcCidrBlock": "abc",
                            "SubnetId": "abc",
                            "SubnetCidrBlock": "abc"
                        }
                    }
                },
                "State": 0,
                "Region": "abc",
                "AppId": "abc",
                "CreateTime": "abc",
                "UpdateTime": "abc",
                "Message": "abc",
                "DataEngines": [
                    {
                        "DataEngineName": "abc",
                        "QuotaId": "abc",
                        "EngineType": "abc",
                        "ClusterType": "abc",
                        "State": 0,
                        "CreateTime": 0,
                        "UpdateTime": 0,
                        "Size": 0,
                        "Mode": 0,
                        "MinClusters": 0,
                        "MaxClusters": 0,
                        "AutoResume": true,
                        "SpendAfter": 0,
                        "CidrBlock": "abc",
                        "DefaultDataEngine": true,
                        "Message": "abc",
                        "DataEngineId": "abc",
                        "SubAccountUin": "abc",
                        "ExpireTime": "abc",
                        "IsolatedTime": "abc",
                        "ReversalTime": "abc",
                        "UserAlias": "abc",
                        "TagList": [
                            {
                                "TagKey": "abc",
                                "TagValue": "abc"
                            }
                        ],
                        "Permissions": [
                            "abc"
                        ],
                        "AutoSuspend": true,
                        "CrontabResumeSuspend": 0,
                        "CrontabResumeSuspendStrategy": {
                            "ResumeTime": "abc",
                            "SuspendTime": "abc",
                            "SuspendStrategy": 0
                        },
                        "EngineExecType": "abc",
                        "RenewFlag": 0,
                        "AutoSuspendTime": 0,
                        "NetworkConnectionSet": [
                            {
                                "Id": 0,
                                "AssociateId": "abc",
                                "HouseId": "abc",
                                "DatasourceConnectionId": "abc",
                                "State": 0,
                                "CreateTime": 0,
                                "UpdateTime": 0,
                                "Appid": 0,
                                "HouseName": "abc",
                                "DatasourceConnectionName": "abc",
                                "NetworkConnectionType": 0,
                                "Uin": "abc",
                                "SubAccountUin": "abc",
                                "NetworkConnectionDesc": "abc",
                                "DatasourceConnectionVpcId": "abc",
                                "DatasourceConnectionSubnetId": "abc",
                                "DatasourceConnectionCidrBlock": "abc",
                                "DatasourceConnectionSubnetCidrBlock": "abc"
                            }
                        ],
                        "UiURL": "abc",
                        "ResourceType": "abc",
                        "ImageVersionId": "abc",
                        "ChildImageVersionId": "abc",
                        "ImageVersionName": "abc",
                        "StartStandbyCluster": true,
                        "ElasticSwitch": true,
                        "ElasticLimit": 0,
                        "DefaultHouse": true,
                        "MaxConcurrency": 0,
                        "TolerableQueueTime": 0,
                        "UserAppId": 0,
                        "UserUin": "abc",
                        "SessionResourceTemplate": {
                            "DriverSize": "abc",
                            "ExecutorSize": "abc",
                            "ExecutorNums": 1,
                            "ExecutorMaxNumbers": 1
                        },
                        "AutoAuthorization": true
                    }
                ],
                "UserAlias": "abc",
                "NetworkConnectionSet": [
                    {
                        "Id": 0,
                        "AssociateId": "abc",
                        "HouseId": "abc",
                        "DatasourceConnectionId": "abc",
                        "State": 0,
                        "CreateTime": 0,
                        "UpdateTime": 0,
                        "Appid": 0,
                        "HouseName": "abc",
                        "DatasourceConnectionName": "abc",
                        "NetworkConnectionType": 0,
                        "Uin": "abc",
                        "SubAccountUin": "abc",
                        "NetworkConnectionDesc": "abc",
                        "DatasourceConnectionVpcId": "abc",
                        "DatasourceConnectionSubnetId": "abc",
                        "DatasourceConnectionCidrBlock": "abc",
                        "DatasourceConnectionSubnetCidrBlock": "abc"
                    }
                ],
                "ConnectivityState": 1,
                "ConnectivityTips": "abc"
            }
        ],
        "RequestId": "abc"
    }
}

5. 开发者资源

腾讯云 API 平台

腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

API Inspector

用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
InternalError 内部错误。
InternalError.DBError 数据库错误。
InvalidParameter.DatasourceTypeError 数据源类型错误。