Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

DB API

Source: daemon/proto/hostcraft/v1/db.proto

DBService manages customer MariaDB/MySQL databases, users and grants. REST: /api/v1/db.

Method REST route Permission Streaming
ListDatabases GET /api/v1/db/databases DBDatabaseRead unary
CreateDatabase POST /api/v1/db/databases DBDatabaseCreate unary
GetDatabase GET /api/v1/db/databases/{id} DBDatabaseRead unary
DeleteDatabase DELETE /api/v1/db/databases/{id} DBDatabaseDelete unary
GetDatabaseStats GET /api/v1/db/databases/{id}/stats DBDatabaseRead unary
ListDBUsers GET /api/v1/db/users DBUserRead unary
CreateDBUser POST /api/v1/db/users DBUserCreate unary
GetDBUser GET /api/v1/db/users/{id} DBUserRead unary
UpdateDBUser PATCH /api/v1/db/users/{id} DBUserUpdate unary
DeleteDBUser DELETE /api/v1/db/users/{id} DBUserDelete unary
ChangeDBUserPassword POST /api/v1/db/users/{id}/password DBUserUpdate unary
ListGrants GET /api/v1/db/grants DBGrantRead unary
CreateGrant POST /api/v1/db/grants DBGrantAdd unary
DeleteGrant DELETE /api/v1/db/grants/{db_id}:{user_id} DBGrantRemove unary
CreateAdminerSession POST /api/v1/db/adminer-session DBAdminerAccess unary

/hostcraft.v1.DBService/ListDatabases

/hostcraft.v1.DBService/CreateDatabase

/hostcraft.v1.DBService/GetDatabase

DeleteDatabase needs a freshly re-authenticated session over REST; over gRPC it is available to the local root principal only.

/hostcraft.v1.DBService/DeleteDatabase

/hostcraft.v1.DBService/GetDatabaseStats

/hostcraft.v1.DBService/ListDBUsers

/hostcraft.v1.DBService/CreateDBUser

/hostcraft.v1.DBService/GetDBUser

/hostcraft.v1.DBService/UpdateDBUser

/hostcraft.v1.DBService/DeleteDBUser

/hostcraft.v1.DBService/ChangeDBUserPassword

/hostcraft.v1.DBService/ListGrants

/hostcraft.v1.DBService/CreateGrant

/hostcraft.v1.DBService/DeleteGrant

CreateAdminerSession mints a single-use Adminer login for a DB user.

/hostcraft.v1.DBService/CreateAdminerSession

Field Type Number Description
token string 1 -
url string 2 -
expires_at google.protobuf.Timestamp 3 -
Field Type Number Description
id string 1 -
new_password string 2 -
Field Type Number Description
user_id string 1 -
db_id string 2 -
Field Type Number Description
account_id string 1 -
username string 2 -
host string 3 -
password string 4 -
can_change_password bool 5 -
Field Type Number Description
user DBUser 1 -
workflow_id string 2 -
Field Type Number Description
account_id string 1 -
name string 2 -
charset string 3 -
collation string 4 -
Field Type Number Description
database Database 1 -
workflow_id string 2 -
Field Type Number Description
db_id string 1 -
user_id string 2 -
privileges repeated string 3 -
Field Type Number Description
grant DBGrant 1 -
workflow_id string 2 -
Field Type Number Description
db_id string 1 -
user_id string 2 -
privileges repeated string 3 -
granted_at google.protobuf.Timestamp 4 -
Field Type Number Description
id string 1 -
account_id string 2 -
username string 3 -
host string 4 -
can_change_password bool 5 -
created_at google.protobuf.Timestamp 6 -
Field Type Number Description
id string 1 -
account_id string 2 -
name string 3 -
charset string 4 -
collation string 5 -
size_bytes int64 6 -
created_at google.protobuf.Timestamp 7 -
Field Type Number Description
db_id string 1 -
size_bytes int64 2 -
table_count int64 3 -
last_query_at google.protobuf.Timestamp 4 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
db_id string 1 -
user_id string 2 -

Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.

No fields.

Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
account_id string 1 -
Field Type Number Description
users repeated DBUser 1 -
Field Type Number Description
account_id string 1 -
Field Type Number Description
databases repeated Database 1 -
Field Type Number Description
db_id string 1 -
user_id string 2 -
Field Type Number Description
grants repeated DBGrant 1 -
Field Type Number Description
id string 1 -
host optional string 2 -
can_change_password optional bool 3 -

WorkflowAccepted is the body of every 202 response that only starts a workflow saga. Follow progress with WorkflowService.StreamWorkflow.

Field Type Number Description
workflow_id string 1 -