Chuyển tới nội dung chính

Databases API

Workspace database registry (engines + connection secrets).

This page lists 9 endpoints (OpenAPI tag databases). It is generated from openapi.json; see the REST API overview for authentication, CSRF and error conventions.

MethodPathOperation idNotes
GET/api/ws/{workspace}/databaseslist
POST/api/ws/{workspace}/databasescreate
POST/api/ws/{workspace}/databases/testtest_unsaved
GET/api/ws/{workspace}/databases/{id}detail
PUT/api/ws/{workspace}/databases/{id}update
DELETE/api/ws/{workspace}/databases/{id}remove
POST/api/ws/{workspace}/databases/{id}/testtest_saved
GET/api/ws/{workspace}/engineslist_engines
GET/api/ws/{workspace}/engines/{engine_id}engine_detail

GET /api/ws/{workspace}/databases​

Operation id: list. Auth: Session cookie. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Response 200 (application/json): array of DatabaseDetailDto

FieldTypeRequiredDescription
idstringyes
namestringyes
engineEngineyesSupported query engines.
hoststringyes
portinteger (int32)yes
optionsConnOptionsyesNon-secret connection options stored in databases.options (jsonb).
has_secretbooleanyes
statusstringyes
delegatedbooleanyes
governedbooleanyesSee [Database::governed]. Surfaced on the detail DTO so the Data API author's database picker can warn BEFORE publish that the connection it is pointed at cannot carry a governed endpoint.
engine_idstring, nullablenoSet (as a UUID string) when this connection was materialized by an engine→workspace assignment (read-only, provisioned by egret); None for a self-service connection. The frontend uses it to split the workspace Engines page into...
StatusMeaning
200Registered databases in the workspace
401Not authenticated
403Missing workspace permission
500Internal error

POST /api/ws/{workspace}/databases​

Operation id: create. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Request body (application/json): DatabaseInput

FieldTypeRequiredDescription
namestringyes
engineEngineyesSupported query engines.
hoststringyes
portinteger (int32)yes
optionsConnOptionsnoNon-secret connection options stored in databases.options (jsonb).
secret_idstring (uuid), nullableno
new_secretNewSecretno
delegatedbooleannoB3a: run BI queries as the caller's per-user engine JWT (delegation).
governedboolean, nullablenoThe data behind this connection is governed at the engine (Ranger row filters / column masks). Publishing a Data API endpoint onto it — or previewing one against it — requires delegated or options.impersonate; see...

Response 200 (application/json): DatabaseDetailDto

FieldTypeRequiredDescription
idstringyes
namestringyes
engineEngineyesSupported query engines.
hoststringyes
portinteger (int32)yes
optionsConnOptionsyesNon-secret connection options stored in databases.options (jsonb).
has_secretbooleanyes
statusstringyes
delegatedbooleanyes
governedbooleanyesSee [Database::governed]. Surfaced on the detail DTO so the Data API author's database picker can warn BEFORE publish that the connection it is pointed at cannot carry a governed endpoint.
engine_idstring, nullablenoSet (as a UUID string) when this connection was materialized by an engine→workspace assignment (read-only, provisioned by egret); None for a self-service connection. The frontend uses it to split the workspace Engines page into...
StatusMeaning
200Database registered
400Invalid input
401Not authenticated
403Missing workspace permission
500Internal error

POST /api/ws/{workspace}/databases/test​

Operation id: test_unsaved. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Request body (application/json): TestInput

FieldTypeRequiredDescription
engineEngineyesSupported query engines.
hoststringyes
portinteger (int32)yes
optionsConnOptionsnoNon-secret connection options stored in databases.options (jsonb).
secretstring, nullableno

Response 200 (application/json): TestOutcome

FieldTypeRequiredDescription
okbooleanyes
latency_msinteger (int64)yes
detailstringyes
StatusMeaning
200Connection test outcome for the unsaved connection
400Invalid input
401Not authenticated
403Missing workspace permission
500Internal error

GET /api/ws/{workspace}/databases/{id}​

Operation id: detail. Auth: Session cookie. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesDatabase id
workspacepathstringyes

Response 200 (application/json): DatabaseDetailDto

FieldTypeRequiredDescription
idstringyes
namestringyes
engineEngineyesSupported query engines.
hoststringyes
portinteger (int32)yes
optionsConnOptionsyesNon-secret connection options stored in databases.options (jsonb).
has_secretbooleanyes
statusstringyes
delegatedbooleanyes
governedbooleanyesSee [Database::governed]. Surfaced on the detail DTO so the Data API author's database picker can warn BEFORE publish that the connection it is pointed at cannot carry a governed endpoint.
engine_idstring, nullablenoSet (as a UUID string) when this connection was materialized by an engine→workspace assignment (read-only, provisioned by egret); None for a self-service connection. The frontend uses it to split the workspace Engines page into...
StatusMeaning
200Database detail
401Not authenticated
403Missing workspace permission
404No such database in this workspace
500Internal error

PUT /api/ws/{workspace}/databases/{id}​

Operation id: update. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesDatabase id
workspacepathstringyes

Request body (application/json): DatabaseInput

FieldTypeRequiredDescription
namestringyes
engineEngineyesSupported query engines.
hoststringyes
portinteger (int32)yes
optionsConnOptionsnoNon-secret connection options stored in databases.options (jsonb).
secret_idstring (uuid), nullableno
new_secretNewSecretno
delegatedbooleannoB3a: run BI queries as the caller's per-user engine JWT (delegation).
governedboolean, nullablenoThe data behind this connection is governed at the engine (Ranger row filters / column masks). Publishing a Data API endpoint onto it — or previewing one against it — requires delegated or options.impersonate; see...

Response 200 (application/json): DatabaseDetailDto

FieldTypeRequiredDescription
idstringyes
namestringyes
engineEngineyesSupported query engines.
hoststringyes
portinteger (int32)yes
optionsConnOptionsyesNon-secret connection options stored in databases.options (jsonb).
has_secretbooleanyes
statusstringyes
delegatedbooleanyes
governedbooleanyesSee [Database::governed]. Surfaced on the detail DTO so the Data API author's database picker can warn BEFORE publish that the connection it is pointed at cannot carry a governed endpoint.
engine_idstring, nullablenoSet (as a UUID string) when this connection was materialized by an engine→workspace assignment (read-only, provisioned by egret); None for a self-service connection. The frontend uses it to split the workspace Engines page into...
StatusMeaning
200Database updated
400Invalid input
401Not authenticated
403Missing workspace permission
404No such database in this workspace
500Internal error

DELETE /api/ws/{workspace}/databases/{id}​

Operation id: remove. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesDatabase id
workspacepathstringyes

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Deleted
401Not authenticated
403Missing workspace permission
404No such database in this workspace
500Internal error

POST /api/ws/{workspace}/databases/{id}/test​

Operation id: test_saved. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
idpathstring (uuid)yesDatabase id
workspacepathstringyes

Response 200 (application/json): TestOutcome

FieldTypeRequiredDescription
okbooleanyes
latency_msinteger (int64)yes
detailstringyes
StatusMeaning
200Connection test outcome for the saved database
401Not authenticated
403Missing workspace permission
404No such database in this workspace
500Internal error

GET /api/ws/{workspace}/engines​

Operation id: list_engines. Auth: Session cookie. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug

Response 200 (application/json): array of WsEngineListDto

FieldTypeRequiredDescription
idstringyes
namestringyes
typestringyesEngine kind (trino/starrocks/risingwave).
statusstringyes
StatusMeaning
200Engines provisioned (assigned) to the workspace
401Not authenticated
403Missing workspace permission
500Internal error

GET /api/ws/{workspace}/engines/{engine_id}​

Operation id: engine_detail. Auth: Session cookie. Forbidden (403): Missing workspace permission.

ParameterInTypeRequiredDescription
workspacepathstringyesWorkspace slug
engine_idpathstring (uuid)yesEngine id
workspacepathstringyes

Response 200 (application/json): WsEngineDetailDto

FieldTypeRequiredDescription
namestringyes
typestringyesEngine kind (trino/starrocks/risingwave).
statusstringyes
catalogsWsEngineCatalogDto[]yes
StatusMeaning
200Assigned engine detail with catalogs → storage/secret names
401Not authenticated
403Missing workspace permission
404No such engine assigned to this workspace
500Internal error