Skip to main content

Test DataSource connectivity

Test connectivity using the registered DataSource settings. Check data.success to determine whether the connection succeeded.

POST /api/open/v1/datasource/testConnection

Requires the “DataSource Manage” or “Query Settings Manage” permission and management permission on the target DataSource.

Request parameters​

ParameterTypeRequiredDescription
dataSourceIdIntegerYesDataSource ID.

Response fields​

Fields in dataTypeDescription
successBooleanWhether the connection succeeded.
versionString or nullDatabase version. A failed connection returns null.
reasonString or nullCONNECTION_FAILED (connection failed), CLUSTER_UNAVAILABLE (the execution cluster has no available workers). Returns null when the connection succeeds.

Request example​

{
"dataSourceId": 42
}

Response example​

{
"requestId": "e058d2e4-ba70-5a3e-8060-57163ed3c0d5",
"code": "OK",
"msg": "Request succeeded.",
"data": {
"success": false,
"version": null,
"reason": "CONNECTION_FAILED"
}
}