Skip to main content

Retrieve Data Source List

Use this API to query the data source list with pagination. Filter by data source ID, data source name, keyword, or data source type.

Request URL: /openapi/v1/datasource/list

Request Method: GET

Request Parameters

ParameterTypeRequiredDescriptionExample
datasourceIdStringNoData source ID.ds-d92lj22cb03k
datasourceTypeStringNoData source type. Supported values: MYSQL, MARIADB, POSTGRESQL, SQLSERVER, DAMENG, KINGBASE, KINGBASE_ORACLE, MILVUS, MONGODB. Values are case-insensitive. Uppercase is recommended.MYSQL
nameStringNoData source name.Production Environment MySQL
keywordStringNoKeyword used for fuzzy search by data source information.mongo
currentIntegerNoCurrent page number, starting from 1, default is 1.1
pageSizeIntegerNoPage size, default is 10.50

Response Parameters

ParameterTypeDescriptionExample
successBoolWhether the interface call is successful. Return values: true, false.true
requestIdStringRequest ID.Mi6y0FCN-BHEEaHAnCFFp9DFdAAk0OUZ
dataArrayData source detail array. Each object contains common fields and may include sslConfig, multiTag, or data-source-specific fields depending on the data source type.{
"datasourceId": "ds-d92mr1g445le",
"name": "127.0.0.1",
"datasourceType": "MySQL"
}
currentIntegerCurrent page number.1
pageSizeIntegerSize of each page.50
totalIntegerTotal number of data sources.6

Common Data Source Response Fields

Each object in the data array contains these common fields.

ParameterTypeDescriptionExample
datasourceIdStringData source ID.ds-d92mr1g445le
orgIdStringOrganization ID.2697478995911717
nameStringData source name.Production MySQL
datasourceTypeStringData source type.MYSQL
usernameStringAccount used to access the data source.root
hostStringData source connection address.127.0.0.1
portIntegerData source port.3306
envIdStringEnvironment of the data source.env-dev
regionIdStringRegion of the data source.aliyun-cn-hangzhou
networkTypeStringData source access type.Public
multiTagStringMulti-active mark. This field may be empty when not configured.active
sslConfigObjectSSL configuration. This field may be returned only for MySQL, SQLServer, and PostgreSQL data sources.{"securityConfig":"PREFERRED"}

SSL Configuration Response Fields

When an object in the data array contains sslConfig, sslConfig may include these fields. Supported fields vary by data source type.

ParameterTypeApplicable Data SourcesDescriptionExample
sslConfig.securityConfigStringMySQL, PostgreSQLSSL security mode. MySQL values: REQUIRED, PREFERRED; PostgreSQL values: Prefer, Require, Verify-CA, Verify-Full.PREFERRED
sslConfig.sslCipherStringMySQLSSL cipher suite.TLS_AES_256_GCM_SHA384
sslConfig.sslCAStringMySQL, SQLServer, PostgreSQLCA certificate content.-----BEGIN CERTIFICATE-----
sslConfig.sslCAFileNameStringMySQL, SQLServer, PostgreSQLCA certificate file name.ca.pem
sslConfig.sslClientCertStringMySQL, PostgreSQLClient certificate content.-----BEGIN CERTIFICATE-----
sslConfig.sslClientCertFileNameStringMySQL, PostgreSQLClient certificate file name.client-cert.pem
sslConfig.sslClientKeyStringMySQL, PostgreSQLClient private key content.-----BEGIN PRIVATE KEY-----
sslConfig.sslClientKeyFileNameStringMySQL, PostgreSQLClient private key file name.client-key.pem
sslConfig.sslIndentifyBooleanMySQLWhether to verify the server identity. Use the field name sslIndentify as required by the API.false
sslConfig.hostNameInCertificateStringSQLServerHost name in the server certificate.db.example.com
sslConfig.trustServerCertificateBooleanSQLServerWhether to trust the server certificate.false

MongoDB Data Source Response Fields

When an object in the data array is a MongoDB data source, these MongoDB-specific fields are returned in addition to common fields.

ParameterTypeDescriptionExample
deploymentTypeStringMongoDB deployment type. Values: standalone, replicaSet, shardedCluster.standalone
authDBStringAuthentication database.admin
readPreferenceStringRead preference. If the data source is not configured with this parameter, the field may be absent or empty.primary
replicaSetStringReplica set name. If the data source is not configured with this parameter, the field may be absent or empty.rs0

Successful Invocation Example

{
"success": true,
"requestId": "Mi6y0FCN-BHEEaHAnCFFp9DFdAAk0OUZ",
"data": [{
"datasourceId": "ds-d92mr1g445le",
"orgId": "2697478995911717",
"name": "127.0.0.1",
"datasourceType": "MySQL",
"username": "root",
"host": "127.0.0.1",
"port": 3306,
"envId": "env-dev",
"regionId": "aliyun-cn-hangzhou",
"networkType": "Public",
"multiTag": "active",
"sslConfig": {
"securityConfig": "PREFERRED",
"sslIndentify": false
}
}],
"current": 1,
"pageSize": 10,
"total": 1
}

MongoDB data source response example:

{
"success": true,
"requestId": "Mi6y0FCN-BHEEaHAnCFFp9DFdAAk0OUZ",
"data": [{
"datasourceId": "ds-d92r4i7z1a90",
"orgId": "2056935997355584",
"name": "test-mongo-standalone-renamed",
"datasourceType": "MongoDB",
"username": "root",
"host": "192.168.1.10",
"port": 27017,
"envId": "env-dev",
"regionId": "aliyun-cn-hangzhou",
"networkType": "Public",
"deploymentType": "standalone",
"authDB": "admin",
"readPreference": "primary"
}],
"current": 1,
"pageSize": 10,
"total": 1
}

Result

A successful response returns data source records that match the filters. Use datasourceId when you update, delete, monitor, or grant permissions for a data source.