API referenceSections

Databases

37 operations. Open one for its parameters, request body, responses and examples.

MethodPathSummary
GET/api/v1/tenants/{tid}/databases
POST/api/v1/tenants/{tid}/databasesCreate a database and its account; the password is shown once
DELETE/api/v1/tenants/{tid}/databases/{id}Delete a database and its account, including its data
GET/api/v1/tenants/{tid}/databases/{id}/adminerThe open database tool for this database, if any
POST/api/v1/tenants/{tid}/databases/{id}/adminerOpen the database tool on an HTTPS site for up to 60 minutes
DELETE/api/v1/tenants/{tid}/databases/{id}/adminerClose the database tool now
GET/api/v1/tenants/{tid}/databases/{id}/backups
POST/api/v1/tenants/{tid}/databases/{id}/backups 202Queue a backup
DELETE/api/v1/tenants/{tid}/databases/{id}/backups/{bid}Delete a backup
GET/api/v1/tenants/{tid}/databases/{id}/backups/{bid}/contentDownload a backup
POST/api/v1/tenants/{tid}/databases/{id}/backups/{bid}/restoreReplace the database with a backup; a safety backup is taken first
POST/api/v1/tenants/{tid}/databases/{id}/copyCopy the database to a new one on the same server and engine, with its own account; the password is shown once
POST/api/v1/tenants/{tid}/databases/{id}/import 202Import a dump into the database (ADR 0068): .sql or .sql.gz for MariaDB and PostgreSQL (also pg_dump custom format), .bak for SQL Server. A safety backup is taken first and put back if the import fails; the reply is that backup, whose state follows the import.
POST/api/v1/tenants/{tid}/databases/{id}/passwordReplace the account's password. It is shown once, or written into the application that uses it
GET/api/v1/tenants/{tid}/databases/{id}/pitrThe database's point-in-time recovery: whether it is on, the earliest and latest moments it can be restored to (ADR 0183)
PUT/api/v1/tenants/{tid}/databases/{id}/pitrTurn point-in-time recovery on or off; the plan's pitr_days says how far back it reaches (ADR 0183)
POST/api/v1/tenants/{tid}/databases/{id}/pitr/restore 202Restore the database as it was just before a moment: into a new database (201, its password shown once) or in place after a safety backup (202) (ADR 0183)
GET/api/v1/tenants/{tid}/databases/{id}/tlsHow to reach the database over TLS from outside (ADR 0181)
GET/api/v1/tenants/{tid}/databases/{id}/usersThe database's extra users (ADR 0067)
POST/api/v1/tenants/{tid}/databases/{id}/usersAdd a user with read-only, read-write or chosen privileges; the password is shown once
PUT/api/v1/tenants/{tid}/databases/{id}/users/{uid}Change a user's privileges and the networks it may connect from; its password stays
DELETE/api/v1/tenants/{tid}/databases/{id}/users/{uid}Remove a user
POST/api/v1/tenants/{tid}/databases/{id}/users/{uid}/passwordReplace a user's password; shown once, after it works
GET/api/v1/tenants/{tid}/db-serversExternal database servers the provider registered; needs server.manage (ADR 0182)
POST/api/v1/tenants/{tid}/db-serversRegister an external database server after connecting to it over verified TLS as its administrator (ADR 0182)
GET/api/v1/tenants/{tid}/db-servers/availableExternal database servers the tenant may place databases on: its own and those its providers share (ADR 0182)
POST/api/v1/tenants/{tid}/db-servers/fingerprintRead the SHA-256 of the certificate a database server presents, to pin it; no credential is sent (ADR 0182)
PUT/api/v1/tenants/{tid}/db-servers/{sid}Change a server's settings; a new password or TLS setting is proved by connecting (ADR 0182)
DELETE/api/v1/tenants/{tid}/db-servers/{sid}Forget a server with no databases left on it; the server itself is not touched
POST/api/v1/tenants/{tid}/db-servers/{sid}/checkCheck the server's health now
GET/api/v1/tenants/{tid}/remote-databasesThe tenant's databases on external servers (ADR 0182)
POST/api/v1/tenants/{tid}/remote-databasesMake a database and its owner on an external server; the password is shown once (ADR 0182)
DELETE/api/v1/tenants/{tid}/remote-databases/{id}Drop the database and its owner on the server
POST/api/v1/tenants/{tid}/remote-databases/{id}/passwordGive the owner a new password, shown once
GET/api/v1/tenants/{tid}/servers/{id}/database-tlsTLS of the server's database engines for remote connections; needs server.manage (ADR 0181)
PUT/api/v1/tenants/{tid}/servers/{id}/database-tlsChoose the certificate (the panel's database CA, or on the panel's own machine the panel's certificate) and whether remote users must use TLS; issues it (ADR 0181)
POST/api/v1/tenants/{tid}/servers/{id}/database-tls/renewIssue the database certificate again now (ADR 0181)