This article describes how to create a Redis database via the API.
Prerequisites
To create a Redis database, you will need to have access to a project. Refer to the guide "create a project" for this. You will need the project ID for the subsequent operations.
List available Redis versions
Set a request to the GET/v2/
Each returned version object contains the following properties:
idcontains the unique identifier of the versionnumbercontains the version number (e.g., "7.0")namecontains a human-readable name for the versiondisabledindicates whether the version is available for use
Important: When selecting a version for your database, you must choose a version where disabled is false.
Creating a Redis database
To create a Redis database, send a request to the POST/v2/
descriptionshould contain a human-readable description of the database. This is a required value.versionshould contain the version number of the database (e.g., "7.0"). This is a required value, and must match thenumberproperty of a version returned by the GET/v2/redis-versions endpoint (not theidproperty).
The response will contain the following properties:
idcontains the ID of the created database.
Accessing the database
After creating a database, you can send a request to the GET/v2/
Among others, the response will contain the following values:
hostnameandportcontain the hostname and port of the database. You can use these values to connect to the database from within your hosting environment.configurationallows you to inspect the specific configuration values that were applied to your database.