DB API
Source: daemon/proto/hostcraft/v1/db.proto
DBService
Section titled “DBService”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 |
ListDatabases
Section titled “ListDatabases”/hostcraft.v1.DBService/ListDatabases
- Request: ListDatabasesRequest
- Response: ListDatabasesResponse
CreateDatabase
Section titled “CreateDatabase”/hostcraft.v1.DBService/CreateDatabase
- Request: CreateDatabaseRequest
- Response: CreateDatabaseResponse
GetDatabase
Section titled “GetDatabase”/hostcraft.v1.DBService/GetDatabase
- Request: GetDatabaseRequest
- Response: Database
DeleteDatabase
Section titled “DeleteDatabase”DeleteDatabase needs a freshly re-authenticated session over REST; over gRPC it is available to the local root principal only.
/hostcraft.v1.DBService/DeleteDatabase
- Request: DeleteDatabaseRequest
- Response: WorkflowAccepted
GetDatabaseStats
Section titled “GetDatabaseStats”/hostcraft.v1.DBService/GetDatabaseStats
- Request: GetDatabaseStatsRequest
- Response: DatabaseStats
ListDBUsers
Section titled “ListDBUsers”/hostcraft.v1.DBService/ListDBUsers
- Request: ListDBUsersRequest
- Response: ListDBUsersResponse
CreateDBUser
Section titled “CreateDBUser”/hostcraft.v1.DBService/CreateDBUser
- Request: CreateDBUserRequest
- Response: CreateDBUserResponse
GetDBUser
Section titled “GetDBUser”/hostcraft.v1.DBService/GetDBUser
- Request: GetDBUserRequest
- Response: DBUser
UpdateDBUser
Section titled “UpdateDBUser”/hostcraft.v1.DBService/UpdateDBUser
- Request: UpdateDBUserRequest
- Response: DBUser
DeleteDBUser
Section titled “DeleteDBUser”/hostcraft.v1.DBService/DeleteDBUser
- Request: DeleteDBUserRequest
- Response: WorkflowAccepted
ChangeDBUserPassword
Section titled “ChangeDBUserPassword”/hostcraft.v1.DBService/ChangeDBUserPassword
- Request: ChangeDBUserPasswordRequest
- Response: Empty
ListGrants
Section titled “ListGrants”/hostcraft.v1.DBService/ListGrants
- Request: ListGrantsRequest
- Response: ListGrantsResponse
CreateGrant
Section titled “CreateGrant”/hostcraft.v1.DBService/CreateGrant
- Request: CreateGrantRequest
- Response: CreateGrantResponse
DeleteGrant
Section titled “DeleteGrant”/hostcraft.v1.DBService/DeleteGrant
- Request: DeleteGrantRequest
- Response: WorkflowAccepted
CreateAdminerSession
Section titled “CreateAdminerSession”CreateAdminerSession mints a single-use Adminer login for a DB user.
/hostcraft.v1.DBService/CreateAdminerSession
- Request: CreateAdminerSessionRequest
- Response: AdminerSession
Messages
Section titled “Messages”AdminerSession
Section titled “AdminerSession”| Field | Type | Number | Description |
|---|---|---|---|
token |
string |
1 | - |
url |
string |
2 | - |
expires_at |
google.protobuf.Timestamp |
3 | - |
ChangeDBUserPasswordRequest
Section titled “ChangeDBUserPasswordRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
new_password |
string |
2 | - |
CreateAdminerSessionRequest
Section titled “CreateAdminerSessionRequest”| Field | Type | Number | Description |
|---|---|---|---|
user_id |
string |
1 | - |
db_id |
string |
2 | - |
CreateDBUserRequest
Section titled “CreateDBUserRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
username |
string |
2 | - |
host |
string |
3 | - |
password |
string |
4 | - |
can_change_password |
bool |
5 | - |
CreateDBUserResponse
Section titled “CreateDBUserResponse”| Field | Type | Number | Description |
|---|---|---|---|
user |
DBUser |
1 | - |
workflow_id |
string |
2 | - |
CreateDatabaseRequest
Section titled “CreateDatabaseRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
name |
string |
2 | - |
charset |
string |
3 | - |
collation |
string |
4 | - |
CreateDatabaseResponse
Section titled “CreateDatabaseResponse”| Field | Type | Number | Description |
|---|---|---|---|
database |
Database |
1 | - |
workflow_id |
string |
2 | - |
CreateGrantRequest
Section titled “CreateGrantRequest”| Field | Type | Number | Description |
|---|---|---|---|
db_id |
string |
1 | - |
user_id |
string |
2 | - |
privileges |
repeated string |
3 | - |
CreateGrantResponse
Section titled “CreateGrantResponse”| Field | Type | Number | Description |
|---|---|---|---|
grant |
DBGrant |
1 | - |
workflow_id |
string |
2 | - |
DBGrant
Section titled “DBGrant”| Field | Type | Number | Description |
|---|---|---|---|
db_id |
string |
1 | - |
user_id |
string |
2 | - |
privileges |
repeated string |
3 | - |
granted_at |
google.protobuf.Timestamp |
4 | - |
DBUser
Section titled “DBUser”| 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 | - |
Database
Section titled “Database”| 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 | - |
DatabaseStats
Section titled “DatabaseStats”| Field | Type | Number | Description |
|---|---|---|---|
db_id |
string |
1 | - |
size_bytes |
int64 |
2 | - |
table_count |
int64 |
3 | - |
last_query_at |
google.protobuf.Timestamp |
4 | - |
DeleteDBUserRequest
Section titled “DeleteDBUserRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
DeleteDatabaseRequest
Section titled “DeleteDatabaseRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
DeleteGrantRequest
Section titled “DeleteGrantRequest”| 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.
GetDBUserRequest
Section titled “GetDBUserRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
GetDatabaseRequest
Section titled “GetDatabaseRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
GetDatabaseStatsRequest
Section titled “GetDatabaseStatsRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
ListDBUsersRequest
Section titled “ListDBUsersRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
ListDBUsersResponse
Section titled “ListDBUsersResponse”| Field | Type | Number | Description |
|---|---|---|---|
users |
repeated DBUser |
1 | - |
ListDatabasesRequest
Section titled “ListDatabasesRequest”| Field | Type | Number | Description |
|---|---|---|---|
account_id |
string |
1 | - |
ListDatabasesResponse
Section titled “ListDatabasesResponse”| Field | Type | Number | Description |
|---|---|---|---|
databases |
repeated Database |
1 | - |
ListGrantsRequest
Section titled “ListGrantsRequest”| Field | Type | Number | Description |
|---|---|---|---|
db_id |
string |
1 | - |
user_id |
string |
2 | - |
ListGrantsResponse
Section titled “ListGrantsResponse”| Field | Type | Number | Description |
|---|---|---|---|
grants |
repeated DBGrant |
1 | - |
UpdateDBUserRequest
Section titled “UpdateDBUserRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
host |
optional string |
2 | - |
can_change_password |
optional bool |
3 | - |
WorkflowAccepted
Section titled “WorkflowAccepted”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 | - |