Core CRUD
Basic datasource creation, retrieval, update, and deletion operations.
GET /api/datasources
List all datasources.
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
q | string | - | Search query |
type | string | - | Filter by driver type |
sort | string | - | Sort field |
limit | integer | 30 | Results per page |
start | integer | 0 | Pagination offset |
Response:
The response is a paginated HAL collection. Datasource items are returned under _embedded["inf:datasource"].
{
"_links": {
"self": { "href": "/api/datasources{?sort,limit,start,q,type}", "templated": true }
},
"_embedded": {
"inf:datasource": [
{
"_links": {
"self": { "href": "/api/datasources/a1b2c3d4-..." }
},
"id": "a1b2c3d4-...",
"name": "Production MySQL",
"type": "mysql",
"host": "db.example.com",
"port": 3306,
"database": "production",
"username": "app_user",
"ownerId": "data-team",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-02-08T14:30:00.000Z"
}
]
},
"start": 0,
"count": 1,
"total": 5
}
POST /api/datasources
Create a new datasource.
Permissions: datasources:create
Request Body:
{
"name": "Production MySQL",
"type": "mysql",
"host": "db.example.com",
"port": 3306,
"database": "production",
"username": "app_user",
"password": "secretPassword",
"options": {
"connectionLimit": 10
},
"ssl": {
"rejectUnauthorized": true
}
}
Required Fields:
| Field | Type | Description |
|---|---|---|
name | string | Datasource name |
type | string | Driver type |
host | string | Server hostname |
database | string | Database name |
Optional Fields:
| Field | Type | Default | Description |
|---|---|---|---|
port | integer | Driver default | Connection port |
username | string | - | Auth username |
password | string | - | Auth password |
options | object | {} | Driver-specific options |
ssl | object | - | SSL configuration |
Response:
201 Created with datasource object and Location header.
GET /api/datasources/{id}
Get a specific datasource.
Response:
{
"id": "mysql-prod",
"name": "Production MySQL",
"type": "mysql",
"host": "db.example.com",
"port": 3306,
"database": "production",
"username": "app_user",
"options": {},
"ssl": {},
"ownerId": "team:data",
"createdAt": "2024-01-15T10:00:00Z",
"_links": {
"self": { "href": "/api/datasources/mysql-prod" },
"inf:test": { "href": "/api/datasources/mysql-prod/_test" },
"inf:mappings": { "href": "/api/datasources/mysql-prod/mappings" },
"inf:features": { "href": "/api/datasources/mysql-prod/features" }
}
}
Note: Password fields are never returned in responses.
PUT /api/datasources/{id}
Update a datasource.
Permissions: datasource:write
Request Body:
{
"name": "Updated MySQL Production",
"port": 3307,
"options": {
"connectionLimit": 20
}
}
Response:
Returns updated datasource object.
DELETE /api/datasources/{id}
Delete a datasource.
Permissions: datasource:write
Response:
204 No Content on success.
Warning:
Deleting a datasource may affect datasets and reports that depend on it.