v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Databases

Retrieve the Eviction Policy for a Caching or Valkey Cluster

To retrieve the configured eviction policy for an existing Caching or Valkey cluster, send a GET request to /v2/databases/$DATABASE_ID/eviction_policy. The response will be a JSON object with an eviction_policy key. This will be set to a string representing the eviction policy.

get/v2/databases/{database_cluster_uuid}/eviction_policy

Path parameters

database_cluster_uuidstring uuid required

A unique identifier for a database cluster.

Response

A JSON string with a key of eviction_policy.

eviction_policy'noeviction' | 'allkeys_lru' | 'allkeys_random' | 'volatile_lru' | 'volatile_random' | 'volatile_ttl' required

A string specifying the desired eviction policy for a Caching or Valkey cluster.

  • noeviction: Don't evict any data, returns error when memory limit is reached.
  • allkeys_lru: Evict any key, least recently used (LRU) first.
  • allkeys_random: Evict keys in a random order.
  • volatile_lru: Evict keys with expiration only, least recently used (LRU) first.
  • volatile_random: Evict keys with expiration only in a random order.
  • volatile_ttl: Evict keys with expiration only, shortest time-to-live (TTL) first.

Example response

{
  "eviction_policy": "allkeys_lru"
}