Skip to main content

eviction_policies

Creates, updates, deletes, gets or lists an eviction_policies resource.

Overview

Nameeviction_policies
TypeResource
Iddigitalocean.databases.eviction_policies

Fields

The following fields are returned by SELECT queries:

A JSON string with a key of eviction_policy.

NameDatatypeDescription

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
databases_get_eviction_policyselectdatabase_cluster_uuidTo 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.
databases_update_eviction_policyreplacedatabase_cluster_uuid, data__eviction_policyTo configure an eviction policy for an existing Caching or Valkey cluster, send a PUT request to /v2/databases/$DATABASE_ID/eviction_policy specifying the desired policy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
database_cluster_uuidstring (uuid)A unique identifier for a database cluster. (example: 9cc10173-e9ea-4176-9dbc-a4cee4c4ff30)

SELECT examples

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.

SELECT
*
FROM digitalocean.databases.eviction_policies
WHERE database_cluster_uuid = '{{ database_cluster_uuid }}' -- required;

REPLACE examples

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

REPLACE digitalocean.databases.eviction_policies
SET
data__eviction_policy = '{{ eviction_policy }}'
WHERE
database_cluster_uuid = '{{ database_cluster_uuid }}' --required
AND data__eviction_policy = '{{ eviction_policy }}' --required;