Database methods.
| Service. | Database methods. |
| Functions | |
| create | Create a database and an initial database user You may use any characters to describe the database (up to 59 in length). |
| rename | Change the name for a Database You may use any characters to describe the database (up to 59 in length). |
| cloneDatabase | Clone a database to a new database and an initial database user If performed on a PostgreSQL database, the username and name must be the same value. |
| listDatabases | List details of one or many Databases. |
| destroy | Delete a Database |
| backup | Backup a database |
| listBackups | List database backups |
| destroyBackup | Destroy a database backup |
| createUser | Create a new database user |
| updateUser | Update one or more aspects of a database user |
| listUsers | List all the users on a database |
| destroyUser | Delete a user on a database |
| getSlowLogs | Retrieve slow logs for a given database and range |
| getSizeHistory | Retrieve size history for a given database and range |
Create a database and an initial database user You may use any characters to describe the database (up to 59 in length). This will be normalized (spaces removed, etc.) but the original name will be preserved as a friendly name. The normalized name for the database will be returned in the DatabaseDetails. If performed on a PostgreSQL database, the username and name must be the same value.
| type | no docs (idx: 1, type: Types.DatabaseType) |
| customerId | no docs (idx: 2, type: Types.CustomerId) |
| name | The four character customer digest and a ‘_’ will be prefixed to this (idx: 6, type: Types.DatabaseName) |
| username | The four character customer digest and a ‘_’ will be prefixed to this (idx: 7, type: Types.DatabaseUser) |
| password | The inital password for the user created (idx: 8, type: Types.DatabasePassword, optional) |
| storePassword | Store the password so it can be retrieved (idx: 5, type: Thrift.bool, optional) |
| userType | Defaults to ReadWrite (idx: 9, type: Types.DatabaseUserType, optional) |
| hostsAllow | no docs (idx: 10, type: Thrift.list (Types.Hostname), optional) |
Exceptions.InvalidArguments (idx: 1)
Change the name for a Database You may use any characters to describe the database (up to 59 in length). This will be normalized (spaces removed, etc.) but the original name will be preserved as a friendly name. The new normalized name for the database will be returned in the DatabaseDetails. If performed on a PostgreSQL database, the username will also be renamed.
| id | no docs (idx: 1, type: Types.DatabaseId) |
| name | The four character customer digest and a ‘_’ will be prefixed to this (idx: 3, type: Types.DatabaseName) |
Exceptions.InvalidArguments (idx: 1)
Clone a database to a new database and an initial database user If performed on a PostgreSQL database, the username and name must be the same value.
| id | no docs (idx: 1, type: Types.DatabaseId) |
| username | The four character customer digest and a ‘_’ will be prefixed to this (idx: 5, type: Types.DatabaseUser) |
| name | The four character customer digest and a ‘_’ will be prefixed to this (idx: 6, type: Types.DatabaseName) |
| password | The inital password for the user created (idx: 7, type: Types.DatabasePassword, optional) |
| storePassword | Store the password so it can be retrieved (idx: 4, type: Thrift.bool, optional) |
| userType | Defaults to ReadWrite (idx: 8, type: Types.DatabaseUserType, optional) |
| hostsAllow | no docs (idx: 9, type: Thrift.list (Types.Hostname), optional) |
Exceptions.InvalidArguments (idx: 1)
List details of one or many Databases. (always returns list)
| customerId | List all databases for this customer. (idx: 1, type: Types.CustomerId, optional) |
| databaseId | List details for this database (idx: 2, type: Types.DatabaseId, optional) |
Thrift.list (Types.DatabaseDetails)
Exceptions.InvalidArguments (idx: 1)
Delete a Database
| id | DatabaseId of the Database to destroy (idx: 1, type: Types.DatabaseId) |
| backup | Bool, true will dump the database before delete, false will not. (idx: 2, type: Thrift.bool, optional) |
Exceptions.InvalidArguments (idx: 1)
Backup a database
| id | the ID of the Database you wish to backup (idx: 1, type: Types.DatabaseId) |
Exceptions.InvalidArguments (idx: 1)
List database backups
| id | the database id. (idx: 1, type: Types.DatabaseId) |
Thrift.list (Types.DatabaseBackup)
Exceptions.InvalidArguments (idx: 1)
Destroy a database backup
| databaseId | the database id. (idx: 1, type: Types.DatabaseId) |
| backupId | the backup id. (idx: 2, type: Types.DatabaseBackupId) |
Exceptions.InvalidArguments (idx: 1)
Create a new database user
| databaseId | no docs (idx: 1, type: Types.DatabaseId) |
| username | The four character customer digest and a ‘_’ will be prefixed to this (idx: 2, type: Types.DatabaseUser) |
| password | If not provided, a random password will be created (idx: 3, type: Types.DatabasePassword, optional) |
| storePassword | Store the password so it can be retrieved (idx: 4, type: Thrift.bool, optional) |
| userType | Defaults to ReadWrite (idx: 5, type: Types.DatabaseUserType, optional) |
| hostsAllow | PgSQL specific options (idx: 6, type: Thrift.list (Types.Hostname), optional) |
| pgDatabaseOwner | For a PostgreSQL database, this will make the new user the owner of the database (idx: 7, type: Thrift.bool, optional) |
Exceptions.InvalidArguments (idx: 1)
Update one or more aspects of a database user
| id | no docs (idx: 1, type: Types.DatabaseUserId) |
| password | no docs (idx: 2, type: Types.DatabasePassword, optional) |
| storePassword | no docs (idx: 3, type: Thrift.bool, optional) |
| userType | no docs (idx: 4, type: Types.DatabaseUserType, optional) |
| hostsAllow | If present, replaces the previous values PgSQL specific options (idx: 5, type: Thrift.list (Types.Hostname), optional) |
| pgDatabaseOwner | For a PostgreSQL database, this will make the user the owner of the database (idx: 6, type: Thrift.bool, optional) |
Exceptions.InvalidArguments (idx: 1)
List all the users on a database
| databaseId | no docs (idx: 1, type: Types.DatabaseId) |
Thrift.list (Types.DatabaseUserDetails)
Exceptions.InvalidArguments (idx: 1)
Delete a user on a database
| id | no docs (idx: 1, type: Types.DatabaseUserId) |
Exceptions.InvalidArguments (idx: 1)
Retrieve slow logs for a given database and range
| databaseId | no docs (idx: 1, type: Types.DatabaseId) |
| userId | no docs (idx: 2, type: Types.DatabaseUserId, optional) |
| startTime | no docs (idx: 3, type: Types.UnixTime, optional) |
| endTime | no docs (idx: 4, type: Types.UnixTime, optional) |
| limit | no docs (idx: 5, type: Thrift.i16, optional) |
Thrift.list (Types.DatabaseSlowLog)
Exceptions.InvalidArguments (idx: 1)
Retrieve size history for a given database and range
| databaseId | no docs (idx: 1, type: Types.DatabaseId) |
| startTime | no docs (idx: 2, type: Types.UnixTime, optional) |
| endTime | no docs (idx: 3, type: Types.UnixTime, optional) |
| limit | no docs (idx: 4, type: Thrift.i16, optional) |
Thrift.list (Types.DatabaseSizeHistory)
Exceptions.InvalidArguments (idx: 1)