Databases
37 operations. Open one for its parameters, request body, responses and examples.
| Method | Path | Summary |
|---|---|---|
| GET | /api/v1/tenants/{tid}/databases | |
| POST | /api/v1/tenants/{tid}/databases | Create 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}/adminer | The open database tool for this database, if any |
| POST | /api/v1/tenants/{tid}/databases/{id}/adminer | Open the database tool on an HTTPS site for up to 60 minutes |
| DELETE | /api/v1/tenants/{tid}/databases/{id}/adminer | Close the database tool now |
| GET | /api/v1/tenants/{tid}/databases/{id}/backups | |
| POST | /api/v1/tenants/{tid}/databases/{id}/backups 202 | Queue a backup |
| DELETE | /api/v1/tenants/{tid}/databases/{id}/backups/{bid} | Delete a backup |
| GET | /api/v1/tenants/{tid}/databases/{id}/backups/{bid}/content | Download a backup |
| POST | /api/v1/tenants/{tid}/databases/{id}/backups/{bid}/restore | Replace the database with a backup; a safety backup is taken first |
| POST | /api/v1/tenants/{tid}/databases/{id}/copy | Copy 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 202 | Import 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}/password | Replace the account's password. It is shown once, or written into the application that uses it |
| GET | /api/v1/tenants/{tid}/databases/{id}/pitr | The 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}/pitr | Turn 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 202 | Restore 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}/tls | How to reach the database over TLS from outside (ADR 0181) |
| GET | /api/v1/tenants/{tid}/databases/{id}/users | The database's extra users (ADR 0067) |
| POST | /api/v1/tenants/{tid}/databases/{id}/users | Add 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}/password | Replace a user's password; shown once, after it works |
| GET | /api/v1/tenants/{tid}/db-servers | External database servers the provider registered; needs server.manage (ADR 0182) |
| POST | /api/v1/tenants/{tid}/db-servers | Register an external database server after connecting to it over verified TLS as its administrator (ADR 0182) |
| GET | /api/v1/tenants/{tid}/db-servers/available | External database servers the tenant may place databases on: its own and those its providers share (ADR 0182) |
| POST | /api/v1/tenants/{tid}/db-servers/fingerprint | Read 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}/check | Check the server's health now |
| GET | /api/v1/tenants/{tid}/remote-databases | The tenant's databases on external servers (ADR 0182) |
| POST | /api/v1/tenants/{tid}/remote-databases | Make 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}/password | Give the owner a new password, shown once |
| GET | /api/v1/tenants/{tid}/servers/{id}/database-tls | TLS of the server's database engines for remote connections; needs server.manage (ADR 0181) |
| PUT | /api/v1/tenants/{tid}/servers/{id}/database-tls | Choose 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/renew | Issue the database certificate again now (ADR 0181) |