Databases - Pro

Create Pro database in existing subscription

Changed on

Creates a new database in an existing Pro subscription.

post/v1/subscriptions/{subscriptionId}/databases

Request

  • Base URL
    https://api.redislabs.com
  • URL
    https://api.redislabs.com/v1/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
dryRunboolean

Optional. When 'false': Creates a deployment plan and deploys it, creating any resources required by the plan. When 'true': creates a read-only deployment plan and does not create any resources. Default: 'false'

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'

Optional. Database protocol. Only set to 'memcached' if you have a legacy application. Default: 'redis'

portinteger

Optional. TCP port on which the database is available (10000-19999). Generated automatically if not set.

memoryLimitInGbnumber double

Optional. Total memory in GB, including replication and other overhead. You cannot set both datasetSizeInGb and totalMemoryInGb.

datasetSizeInGbnumber double

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.

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 /subscriptions/redis-versions')

autoMinorVersionUpgradeboolean

Optional. Automatically upgrades the database to newer minor versions within the same major release. Applies to version 8.4 and above. Default: true.

respVersion'resp2' | 'resp3'

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

supportOSSClusterApiboolean

Optional. Support OSS Cluster API. Default: 'false'

useExternalEndpointForOSSClusterApiboolean

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'

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. Default: 'none'

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

Optional. Data eviction policy. Default: 'volatile-lru'

replicationboolean

Optional. Sets database replication. Default: 'true'

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'].

averageItemSizeInBytesinteger

Optional. Relevant only to ram-and-flash (also known as Redis-Flex/Auto-Tiering) subscriptions. Estimated average size in bytes of the items stored in the database. Default: 1000

ramPercentageinteger

Optional. Relevant only to ram-and-flash (also known as Redis-Flex/Auto-Tiering) subscriptions. The percentage of data to be stored in RAM. Must be between 10 and 50 in steps of 10 (10, 20, 30, 40, 50). Default: 20

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.

sourceIpstring[]

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. Example: '['192.168.10.0/32', '192.168.12.0/24']'

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. Can only be set if 'protocol' is 'redis'.

saslUsernamestring

Optional. Memcached (SASL) Username to access the database. If not set, the username will be set to a 'mc-' prefix followed by a random 5 character long alphanumeric. Can only be set if 'protocol' is 'memcached'.

saslPasswordstring

Optional. Memcached (SASL) Password to access the database. If not set, a random 32 character long alphanumeric password will be automatically generated. Can only be set if 'protocol' is 'memcached'.

shardingType'default-regex-rules' | 'custom-regex-rules' | 'redis-oss-hashing'

Optional. Database Hashing policy.

commandTypestring
queryPerformanceFactorstring

Optional. The query performance factor adds extra compute power specifically for search and query databases. You can increase your queries per second by the selected factor.

Example request

{
  "name": "Redis-database-example",
  "port": 10000,
  "memoryLimitInGb": 1,
  "datasetSizeInGb": 1,
  "redisVersion": "7.2",
  "respVersion": "resp3",
  "throughputMeasurement": {
    "value": 10000
  },
  "localThroughputMeasurement": [
    {
      "writeOperationsPerSecond": 1000,
      "readOperationsPerSecond": 1000
    }
  ],
  "ramPercentage": 20,
  "periodicBackupPath": "s3://<backup-path>",
  "alerts": [
    {
      "name": "dataset-size",
      "value": 80
    }
  ],
  "modules": [
    {
      "parameters": {}
    }
  ],
  "queryPerformanceFactor": "2x"
}

Response

Accepted

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