Databases

Create a database

Changed on

Creates a database in one of your networks. To start it from a backup of another of your databases of the same type, send backupSourceId and backupToRestoreName (only for mysql, mariadb, postgres and mongodb).

Your balance must be high enough to cover the database. Your account must be verified. With teamID, your role needs the database.create permission.

post/v1/databases

Request

  • Base URL
    https://api.liara.ir
  • URL
    https://api.liara.ir/v1/databases
  • Auth
    HTTP bearer

Query parameters

teamIDstring

24-character hexadecimal ID.

Run the request in the context of a team you belong to, instead of your personal account.

Request body

hostnamestring required

The database's name, also its hostname inside the network. Lowercase letters, digits and hyphens; not all digits, and not localhost.

type'mysql' | 'mariadb' | 'postgres' | 'mongodb' | 'redis' | 'mssql' | 'elasticsearch' | 'rabbitmq' | 'clickhouse' required
versionstring

One of the version values for this type from GET /v1/databases/versions. Defaults to the newest.

planID'small-g2' | 'medium-g2' | 'standard-base-g2' | 'standard-pro-g2' | 'pro-g2' | 'pro-plus-g2' | 'pro-max-g2' required

The database's resource plan. small-g2 and medium-g2 don't support mssql or clickhouse, and small-g2 doesn't support elasticsearch. See Liara's pricing page for what each plan includes.

bundlePlanID'basic' | 'standard' | 'pro' required

The bundle plan, which sets backups, metrics retention, editable settings and public network access.

networkstring required

ID of one of your networks.

publicNetworkboolean

Make the database reachable from the internet. Ignored if the bundle plan doesn't allow it.

backupSourceIdstring

ID of the database whose backup to start from. Send together with backupToRestoreName.

backupToRestoreNamestring

The backup's name from GET /v1/databases/{databaseID}/backups of the source database.

Response

The database is being created.

databaseIDstring

Changes

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      request property was restricted to a list of enum values

    • breaking

      request property was restricted to a list of enum values

    • breaking

      the request property became required

    • breaking

      the request property became required

    • breaking

      the request property became required

    • breaking

      the request property's minLength was increased from 0 to 3

    • breaking

      added the pattern ^[a-z0-9][a-z0-9\-]+[a-z0-9]$ to the request property

    • warning

      the request property's maxLength was set to 50

    • info

      added the new optional query request parameter teamID

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property /

    • info

      added the new optional request property /

    • info

      added the new optional request property /

    • info

      added the new optional request property /

    • info

      added the new optional request property /

    • info

      added the new optional request property /

    • info

      the request property default value true was added

    • info

      added the new clickhouse enum value to the request property

    • info

      added the new elasticsearch enum value to the request property

    • info

      added the new mariadb enum value to the request property

    • info

      added the new medium-g2 enum value to the request property

    • info

      added the new mongodb enum value to the request property

    • info

      added the new mssql enum value to the request property

    • info

      added the new mysql enum value to the request property

    • info

      added the new postgres enum value to the request property

    • info

      added the new pro-g2 enum value to the request property

    • info

      added the new pro-max-g2 enum value to the request property

    • info

      added the new pro-plus-g2 enum value to the request property

    • info

      added the new rabbitmq enum value to the request property

    • info

      added the new redis enum value to the request property

    • info

      added the new small-g2 enum value to the request property

    • info

      added the new standard-base-g2 enum value to the request property

    • info

      added the new standard-pro-g2 enum value to the request property

    • info

      added the media type application/json for the response with the status

    • info

      added the media type application/json for the response with the status

    • info

      added the media type application/json for the response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • breaking

      removed the media type Databaselication/json from the request body

    • info

      added the media type application/json to the request body

    • info

      added the media type application/json for the response with the status