Data Sources
Gateway prefix: ${API_BASE}/metadata/datasources/...
DTO fields (DataSourceDto)
idstring (returned)namestring, required, unique data source nametypestring, required, database type such asPOSTGRES,MYSQLjdbcUrlstring, required, JDBC connection URLusernamestring, optional, database usernamepasswordstring, optional, database passwordactiveboolean, optional, whether active
Create data source
- POST
/datasources
Example:
curl -X POST \
"${API_BASE}/metadata/datasources" \
-H "Content-Type: application/json" \
-d '{
"name":"main_db",
"type":"POSTGRES",
"jdbcUrl":"jdbc:postgresql://db.local:5432/aidaas",
"username":"dbuser",
"password":"secret",
"active": true
}'
Update data source
- PUT
/datasources/{id}
Example: only toggle active state:
curl -X PUT \
"${API_BASE}/metadata/datasources/ds-1001" \
-H "Content-Type: application/json" \
-d '{"active": false}'
Get by ID/name
- GET
/datasources/{id} - GET
/datasources/name/{name}
Example:
curl -X GET "${API_BASE}/metadata/datasources/ds-1001"
curl -X GET "${API_BASE}/metadata/datasources/name/main_db"
Pagination and active list
- GET
/datasources?search=&type=&isActive=&page=&size=&sortBy=&sortDirection= - GET
/datasources/active
Example:
curl "${API_BASE}/metadata/datasources?search=main&page=0&size=10"
curl "${API_BASE}/metadata/datasources/active"
Delete data source
- DELETE
/datasources/{id}
curl -X DELETE "${API_BASE}/metadata/datasources/ds-1001"
Connection test
- POST
/datasources/{id}/test(by ID) - POST
/datasources/test(with configuration)
curl -X POST "${API_BASE}/metadata/datasources/ds-1001/test"
curl -X POST "${API_BASE}/metadata/datasources/test" -H "Content-Type: application/json" \
-d '{"type":"POSTGRES","jdbcUrl":"jdbc:postgresql://db.local:5432/aidaas","username":"dbuser","password":"secret"}'
Activate/deactivate
- PUT
/datasources/{id}/toggle?active=true|false
curl -X PUT "${API_BASE}/metadata/datasources/ds-1001/toggle?active=false"
Schema discovery
- GET
/datasources/{id}/tables - GET
/datasources/{id}/tables/{tableName}
curl -X GET "${API_BASE}/metadata/datasources/ds-1001/tables"
curl -X GET "${API_BASE}/metadata/datasources/ds-1001/tables/orders"