Databases - Essentials

Create Essentials database

Changed on

Creates a new database in the specified Essentials subscription.

post/v1/fixed/subscriptions/{subscriptionId}/databases

Request

  • Base URL
    https://api.redislabs.com
  • URL
    https://api.redislabs.com/v1/fixed/subscriptions/{subscriptionId}/databases
  • Auth
    API key in header x-api-key and API key in header x-api-secret-key and API key in header x-auth-token

Path parameters

subscriptionIdinteger required

Subscription ID.

Request body

subscriptionIdinteger
namestring required

Name of the database. Database name is limited to 40 characters or less and must include only letters, digits, and hyphens ('-'). It must start with a letter and end with a letter or digit.

protocol'redis' | 'memcached' | 'stack'

Optional. Database protocol. Use 'stack' to get all of Redis' advanced capabilities. Only use 'redis' for Pay-as-you-go or Redis Flex subscriptions. Default: 'stack' for most subscriptions, 'redis' for Redis Flex subscriptions.

memoryLimitInGbnumber double

(Pay-as-you-go subscriptions only) Optional. Total memory in GB, including replication and other overhead. You cannot set both datasetSizeInGb and totalMemoryInGb.

datasetSizeInGbnumber double

(Pay-as-you-go subscriptions only) Optional. The maximum amount of data in the dataset for this database in GB. You cannot set both datasetSizeInGb and totalMemoryInGb. If ‘replication’ is 'true', the database’s total memory will be twice as large as the datasetSizeInGb. If ‘replication’ is false, the database’s total memory will be the datasetSizeInGb value.

supportOSSClusterApiboolean

(Pay-as-you-go subscriptions only) Optional. Support Redis OSS Cluster API. Default: 'false'

redisVersionstring

Optional. If specified, redisVersion defines the Redis database version. If omitted, the Redis version will be set to the default version. (available in 'GET /fixed/redis-versions')

respVersion'resp2' | 'resp3'

Optional. Redis Serialization Protocol version. Must be compatible with Redis version.

useExternalEndpointForOSSClusterApiboolean

(Pay-as-you-go subscriptions only) Optional. If set to 'true', the database will use the external endpoint for OSS Cluster API. This setting blocks the database's private endpoint. Can only be set if 'supportOSSClusterAPI' is 'true'. Default: 'false'

enableDatabaseClusteringboolean

(Pay-as-you-go subscriptions only) Optional. Distributes database data to different cloud instances. Default: 'false'

numberOfShardsinteger

(Pay-as-you-go subscriptions only) Optional. Specifies the number of master shards.

dataPersistence'none' | 'aof-every-1-second' | 'aof-every-write' | 'snapshot-every-1-hour' | 'snapshot-every-6-hours' | 'snapshot-every-12-hours'

Optional. Type and rate of data persistence in persistent storage. Use GET /fixed/plans/{planId} to see if your plan supports data persistence.

dataEvictionPolicy'allkeys-lru' | 'allkeys-lfu' | 'allkeys-lrm' | 'allkeys-random' | 'volatile-lru' | 'volatile-lfu' | 'volatile-lrm' | 'volatile-random' | 'volatile-ttl' | 'noeviction'

Optional. Data eviction policy.

replicationboolean

Optional. Sets database replication. Use GET /fixed/plans/{planId} to see if your plan supports database replication.

periodicBackupPathstring

Optional. The path to a backup storage location. If specified, the database will back up every 24 hours to this location, and you can manually back up the database to this location at any time. Use GET /fixed/plans/{planId} to see if your plan supports database backups.

sourceIpsstring[]

Optional. List of source IP addresses or subnet masks to allow. If specified, Redis clients will be able to connect to this database only from within the specified source IP addresses ranges. Use GET /fixed/plans/{planId} to see how many CIDR allow rules your plan supports. Example: '['192.168.10.0/32', '192.168.12.0/24']'

regexRulesstring[]

(Pay-as-you-go subscriptions only) Optional. Hashing policy Regex rules. Used only if 'enableDatabaseClustering' is set to 'true' and .

replicaOfstring[]

Optional. This database will be a replica of the specified Redis databases provided as one or more URI(s). Example: 'redis://user:password@host:port'. If the URI provided is a Redis Cloud database, only host and port should be provided. Example: ['redis://endpoint1:6379', 'redis://endpoint2:6380'].

clientSslCertificatestring

Optional. A public key client TLS/SSL certificate with new line characters replaced with '\n'. If specified, mTLS authentication will be required to authenticate user connections. Default: 'null'

enableTlsboolean

Optional. When 'true', requires TLS authentication for all connections - mTLS with valid clientTlsCertificates, regular TLS when clientTlsCertificates is not provided. Default: 'false'

passwordstring

Optional. Password to access the database. If not set, a random 32-character alphanumeric password will be automatically generated.

commandTypestring

Example request

{
  "name": "Redis-Essentials-database-example",
  "memoryLimitInGb": 1,
  "datasetSizeInGb": 1,
  "supportOSSClusterApi": true,
  "redisVersion": "7.4",
  "respVersion": "resp3",
  "useExternalEndpointForOSSClusterApi": true,
  "numberOfShards": 2,
  "periodicBackupPath": "s3://<backup-path>",
  "alerts": [
    {
      "name": "dataset-size",
      "value": 80
    }
  ],
  "modules": [
    {
      "parameters": {}
    }
  ]
}

Response

OK

taskIdstring uuid
commandTypestring
status'initialized' | 'received' | 'processing-in-progress' | 'processing-completed' | 'processing-error'
descriptionstring
timestampstring date-time
linksobject[]

Changes

    • warning

      added the new AGENT_MEMORY_IS_DISABLED enum value to the / response property for the response status

    • warning

      added the new AGENT_MEMORY_STORE_DEPENDENCY_FAILED enum value to the / response property for the response status

    • warning

      added the new AGENT_MEMORY_STORE_FORBIDDEN enum value to the / response property for the response status

    • warning

      added the new AGENT_MEMORY_STORE_INVALID_REQUEST enum value to the / response property for the response status

    • warning

      added the new AGENT_MEMORY_STORE_NOT_FOUND enum value to the / response property for the response status

    • warning

      added the new DATABASE_IN_ACTIVE_ENDPOINTS_REDIRECTION enum value to the / response property for the response status

    • warning

      added the new DATABASE_TRAFFIC_NOT_STOPPED enum value to the / response property for the response status

    • warning

      added the new DATABASE_TRAFFIC_RESUME_IN_PROGRESS enum value to the / response property for the response status

    • warning

      added the new DATABASE_TRAFFIC_RESUME_NOT_ELIGIBLE enum value to the / response property for the response status

    • warning

      added the new DATABASE_TRAFFIC_STATE_NOT_FOUND enum value to the / response property for the response status

    • warning

      added the new DB_ENDPOINTS_SERVICE_NOT_FOUND enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_ACCOUNT_MISMATCH enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_ALREADY_EXISTS enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_CONNECTIVITY_MISMATCH enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_DATABASES_NOT_COMPATIBLE enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_DATABASE_STATE_NOT_SUPPORTED enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_DNS_SERVICE_NOT_AVAILABLE enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_INVALID_ENDPOINT_TYPE enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_NOT_COMPLETED enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_NOT_FOUND enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_NOT_LATEST enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_REVERT_WINDOW_EXCEEDED enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_SOURCE_HAS_NO_ENDPOINTS enum value to the / response property for the response status

    • warning

      added the new ENDPOINTS_REDIRECTION_TARGET_HAS_NO_ENDPOINTS enum value to the / response property for the response status

    • warning

      added the new FIXED_DATABASE_MEMCACHED_PROTOCOL_IS_NOT_SUPPORTED_FOR_FREE_PLAN enum value to the / response property for the response status