pydo.databases.update_eviction_policy()

Generated on 7 Jul 2026 from pydo version v0.39.0

Usage

client.databases.update_eviction_policy(
    database_cluster_uuid="9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
    body={
        "eviction_policy": "allkeys_lru",
    },
)
Returns NoneRaises HttpResponseError

Description

To configure an eviction policy for an existing Caching or Valkey cluster, send a PUT request to /v2/databases/{database_cluster_uuid}/eviction_policy specifying the desired policy.

Parameters

database_cluster_uuid string required

A unique identifier for a database cluster.

eviction_policy string 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.

One of: noeviction, allkeys_lru, allkeys_random, volatile_lru, volatile_random, volatile_ttl

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "eviction_policy": "allkeys_lru"
}

update_resp = client.databases.update_eviction_policy(database_cluster_uuid="a7a8bas", body=req)

More Information

See /v2/databases/{database_cluster_uuid}/eviction_policy in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.