DataSource details
Get the registration details for the specified DataSource.
POST /api/open/v1/datasource/getDataSource
Requires “Query Settings Read” and read permission on the DataSource.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| dataSourceId | Integer | Yes | DataSource ID. |
Response fields
| Fields in data | Type | Description |
|---|---|---|
| dataSourceId | Integer | DataSource ID. |
| instanceId | String | Instance identifier. |
| instanceDesc | String | Display name. |
| dataSourceType | String | DataSource type. For supported values, see listDataSourceTypes. |
| envId | Integer or null | Environment ID. |
| lifeCycleState | String | CREATING (registering), CREATED (registered), DELETING (deregistering), LOCKED (locked). |
| version | String | Database version, returned when available. |
| host | String | DataSource address. Returned when the address is available and the caller has management permission on the DataSource. |
Request example
{
"dataSourceId": 42
}
Response example
{
"requestId": "818698e3-3088-547e-a581-0f1e58aa82ef",
"code": "OK",
"msg": "Request succeeded.",
"data": {
"dataSourceId": 42,
"instanceId": "my-5samk76gx9hj2tr",
"instanceDesc": "Sales database",
"dataSourceType": "MySQL",
"envId": 3,
"lifeCycleState": "CREATED",
"version": "8.0.36",
"host": "sales-db.example.test:3306"
}
}