# databases-api ## Pages - [Databases API](https://docs.ezghcloud.com/databases-api/index.md) — Managed PostgreSQL, Percona Server and MariaDB. Every path is under an organization; lists are paged with limit, cursor and nextCursor. - [Cancel an operation](https://docs.ezghcloud.com/databases-api/CancelOperation/index.md) — 409 operation_finished or operation_not_cancellable when it can't be cancelled. - [Take a manual backup](https://docs.ezghcloud.com/databases-api/CreateBackup/index.md) — Asynchronous. A manual backup outlives its database. - [Create a blue/green deployment](https://docs.ezghcloud.com/databases-api/CreateBlueGreenDeployment/index.md) — Asynchronous. 409 precheck_failed with reasons, 409 blue_green_in_progress. - [Create a database, or restore one](https://docs.ezghcloud.com/databases-api/CreateDatabase/index.md) — Asynchronous: answers 202 with the operation that creates it, which takes minutes. Every database runs as an active/passive pair: a hot standby with its own copy of the data, replicated synchronously, takes over automatically behind the same endpoint; the operation succeeds once the standby is in sync. source restores a backup or a point in time into a new database. 409 subnet_has_no_room, 409 time_not_restorable with restorableRanges. - [Open a session](https://docs.ezghcloud.com/databases-api/CreateDatabaseSession/index.md) — A session reaches the database from anywhere, without entering its VPC: open url as a WebSocket within 30 seconds, offering the subprotocols ezgh.databases.tunnel.v1 (or ezgh.databases.query.v1 for kind query) and ticket.. The ticket works once. Sessions don't pass the database's allowed sources; the engine still checks its own user and password. An Idempotency-Key replay answers the same session with ticket null. 409 database_not_available while the database is being created or deleted, or has failed, 409 sessions_unavailable before its next maintenance update, 429 quota_exceeded with Retry-After at 20 open sessions. - [Create a user](https://docs.ezghcloud.com/databases-api/CreateDatabaseUser/index.md) — Asynchronous. The password is generated and written to a new Secret in the project (secrets.secrets.create and secrets.versions.create), named databases//users/; it's never in a response. Also checks databases.logicalDatabases.get on the logical database. 409 already_exists when the engine already has the name, 409 logical_database_not_available while a managed logical database isn't available, 409 owner_needs_managed_logical_database for owner on a PostgreSQL logical database made by hand, 409 users_unavailable until the database's next maintenance update, 409 database_busy while the database is being created, deleted or upgraded, or has failed; 409 blue_green_in_progress while a blue/green deployment is open, 409 quota_exceeded. - [Create a logical database](https://docs.ezghcloud.com/databases-api/CreateLogicalDatabase/index.md) — Asynchronous. A managed one that reads missing is made again. 409 already_exists when the engine already has the name, 409 users_unavailable until the database's next maintenance update, 409 database_busy while the database is being created, deleted or upgraded, or has failed; 409 blue_green_in_progress while a blue/green deployment is open, 409 quota_exceeded. - [Delete a backup](https://docs.ezghcloud.com/databases-api/DeleteBackup/index.md) — Answers with the backup deleting: it goes shortly after. - [Delete a blue/green deployment](https://docs.ezghcloud.com/databases-api/DeleteBlueGreenDeployment/index.md) — Asynchronous. Before switchover it discards the copy, cancelling a create still running, and after it retires the old one. - [Delete a database](https://docs.ezghcloud.com/databases-api/DeleteDatabase/index.md) — Asynchronous, and it wins over whatever else is running. 409 deletion_protected, 409 database_in_use while a firewall rule names it. - [Delete a user and its Secret](https://docs.ezghcloud.com/databases-api/DeleteDatabaseUser/index.md) — Asynchronous. Managed only: 409 unmanaged for one made by hand. Deletes the user's Secret first, inside the request (secrets.secrets.delete), then drops the user; the tables it owns stay. If the engine refuses the drop, the user stays with secret null until it's rotated. 409 database_busy while the database is being created, deleted or upgraded, or has failed; 409 blue_green_in_progress while a blue/green deployment is open. - [Delete a logical database and its data](https://docs.ezghcloud.com/databases-api/DeleteLogicalDatabase/index.md) — Asynchronous. Managed only: 409 unmanaged for one made by hand. 409 logical_database_in_use while a managed user names it, 409 database_busy while the database is being created, deleted or upgraded, or has failed; 409 blue_green_in_progress while a blue/green deployment is open. - [Switch a database over](https://docs.ezghcloud.com/databases-api/FailoverDatabase/index.md) — Asynchronous: a planned switchover. 409 not_eligible when it can't right now. - [Get a backup](https://docs.ezghcloud.com/databases-api/GetBackup/index.md) - [Get a blue/green deployment](https://docs.ezghcloud.com/databases-api/GetBlueGreenDeployment/index.md) - [Get a database](https://docs.ezghcloud.com/databases-api/GetDatabase/index.md) - [Get a user](https://docs.ezghcloud.com/databases-api/GetDatabaseUser/index.md) - [Get a logical database](https://docs.ezghcloud.com/databases-api/GetLogicalDatabase/index.md) - [Get an operation (poll it until it finishes)](https://docs.ezghcloud.com/databases-api/GetOperation/index.md) — While it's queued or running, Retry-After suggests when to poll again. Not recorded in Trails. - [List a project's backups, newest first](https://docs.ezghcloud.com/databases-api/ListBackups/index.md) — Includes backups of deleted databases. - [List a project's blue/green deployments, newest first](https://docs.ezghcloud.com/databases-api/ListBlueGreenDeployments/index.md) - [List a database's events, newest first](https://docs.ezghcloud.com/databases-api/ListDatabaseEvents/index.md) - [List a database's users, by name](https://docs.ezghcloud.com/databases-api/ListDatabaseUsers/index.md) — Those made through the API (managed) and those the database's latest report shows made by hand (managed false; preset, logicalDatabase, secret and status null). - [List a project's databases, newest first](https://docs.ezghcloud.com/databases-api/ListDatabases/index.md) - [List engines, their versions, parameters and extensions](https://docs.ezghcloud.com/databases-api/ListEngineVersions/index.md) - [List a database's logical databases, by name](https://docs.ezghcloud.com/databases-api/ListLogicalDatabases/index.md) — Those made through the API (managed) and those the database's latest report shows made by hand (managed false, status null). - [List the organization's operations, newest first](https://docs.ezghcloud.com/databases-api/ListOperations/index.md) - [Rotate a database's admin password](https://docs.ezghcloud.com/databases-api/RotateDatabaseAdminPassword/index.md) — Asynchronous. Writes a new version of the admin Secret, or a new Secret if it was deleted. - [Rotate a user's password](https://docs.ezghcloud.com/databases-api/RotateDatabaseUserPassword/index.md) — Asynchronous. Managed only: 409 unmanaged for one made by hand, 409 user_failed after a failed create (delete it). Writes a new version of the user's Secret, or a new Secret if it was deleted. A missing user is made again with its preset. 409 database_busy while the database is being created, deleted or upgraded, or has failed; 409 blue_green_in_progress while a blue/green deployment is open, 409 logical_database_not_available while its logical database is missing or not available. - [Switch over to a blue/green deployment](https://docs.ezghcloud.com/databases-api/SwitchoverBlueGreenDeployment/index.md) — Asynchronous and one-way. 409 precheck_failed with reasons. - [Change a database](https://docs.ezghcloud.com/databases-api/UpdateDatabase/index.md) — Asynchronous. Growing storage works while the database is storage_full. 409 blue_green_in_progress while a deployment is creating, available or switching over. - [Change a user's preset](https://docs.ezghcloud.com/databases-api/UpdateDatabaseUser/index.md) — Asynchronous. Managed only: 409 unmanaged for one made by hand, 409 user_failed after a failed create (delete it). The password doesn't change. 409 owner_needs_managed_logical_database, 409 database_busy while the database is being created, deleted or upgraded, or has failed; 409 blue_green_in_progress while a blue/green deployment is open, 409 logical_database_not_available while its logical database is missing or not available. - [Backup](https://docs.ezghcloud.com/databases-api/schemas/Backup/index.md) - [BackupList](https://docs.ezghcloud.com/databases-api/schemas/BackupList/index.md) - [BlueGreenDeployment](https://docs.ezghcloud.com/databases-api/schemas/BlueGreenDeployment/index.md) - [BlueGreenDeploymentCreate](https://docs.ezghcloud.com/databases-api/schemas/BlueGreenDeploymentCreate/index.md) - [BlueGreenDeploymentList](https://docs.ezghcloud.com/databases-api/schemas/BlueGreenDeploymentList/index.md) - [Database](https://docs.ezghcloud.com/databases-api/schemas/Database/index.md) - [DatabaseCreate](https://docs.ezghcloud.com/databases-api/schemas/DatabaseCreate/index.md) - [DatabaseEvent](https://docs.ezghcloud.com/databases-api/schemas/DatabaseEvent/index.md) - [DatabaseEventList](https://docs.ezghcloud.com/databases-api/schemas/DatabaseEventList/index.md) - [DatabaseList](https://docs.ezghcloud.com/databases-api/schemas/DatabaseList/index.md) - [DatabaseUpdate](https://docs.ezghcloud.com/databases-api/schemas/DatabaseUpdate/index.md) - [DatabaseUser](https://docs.ezghcloud.com/databases-api/schemas/DatabaseUser/index.md) - [DatabaseUserCreate](https://docs.ezghcloud.com/databases-api/schemas/DatabaseUserCreate/index.md) - [DatabaseUserList](https://docs.ezghcloud.com/databases-api/schemas/DatabaseUserList/index.md) - [DatabaseUserUpdate](https://docs.ezghcloud.com/databases-api/schemas/DatabaseUserUpdate/index.md) - [Endpoint](https://docs.ezghcloud.com/databases-api/schemas/Endpoint/index.md) - [EngineVersions](https://docs.ezghcloud.com/databases-api/schemas/EngineVersions/index.md) - [Error](https://docs.ezghcloud.com/databases-api/schemas/Error/index.md) — Every non-2xx answer. Clients branch on code, never on message. - [LogicalDatabase](https://docs.ezghcloud.com/databases-api/schemas/LogicalDatabase/index.md) - [LogicalDatabaseCreate](https://docs.ezghcloud.com/databases-api/schemas/LogicalDatabaseCreate/index.md) - [LogicalDatabaseList](https://docs.ezghcloud.com/databases-api/schemas/LogicalDatabaseList/index.md) - [ObjectFailure](https://docs.ezghcloud.com/databases-api/schemas/ObjectFailure/index.md) — Why a create failed, or the engine refused a user's drop (it stays, with secret null, until it's rotated). Null otherwise. - [Operation](https://docs.ezghcloud.com/databases-api/schemas/Operation/index.md) - [OperationList](https://docs.ezghcloud.com/databases-api/schemas/OperationList/index.md) - [OperationStatus](https://docs.ezghcloud.com/databases-api/schemas/OperationStatus/index.md) - [QuotaExceeded](https://docs.ezghcloud.com/databases-api/schemas/QuotaExceeded/index.md) — quota_exceeded: the quota that refused the request. Never with Retry-After. - [RestorableRange](https://docs.ezghcloud.com/databases-api/schemas/RestorableRange/index.md) — A span a database can be restored to, inclusive at both ends. - [Session](https://docs.ezghcloud.com/databases-api/schemas/Session/index.md) - [SessionCreate](https://docs.ezghcloud.com/databases-api/schemas/SessionCreate/index.md) - [Storage](https://docs.ezghcloud.com/databases-api/schemas/Storage/index.md) - [Tags](https://docs.ezghcloud.com/databases-api/schemas/Tags/index.md) — At most 50; keys 1-128 characters, values at most 256, keys starting with ezgh: are reserved.