How to Reconfigure OpenSearch Database Clusters

OpenSearch is an open-source search and analytics suite which serves as a centralized location to manage logs forwarded from other resources, such as databases and Droplets.


You can update your database engine’s parameters, such as compression_type and group_min_session_timeout_ms, with the API. For a full list of the parameters you can edit, see our API reference. Under the REQUEST BODY SCHEMA section, click config, and then select the opensearch option.

To ensure database stability, you can only edit the parameters listed in our API reference. To change other OpenSearch parameters, contact support.

Update a Database’s Configuration Using the API

How to Update a Database's Configuration Using the DigitalOcean API
  1. Create a personal access token and save it for use with the API.

  2. Send a PATCH request to https://api.digitalocean.com/v2/databases/{database_cluster_uuid}/config

    cURL

    Using cURL:

                    curl -X PATCH \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
      -d '{"config": {"sql_mode": "ANSI,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_ALL_TABLES","sql_require_primary_key": true}}' \
      "https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/config"
                  

    Python

                    import os
    from pydo import Client
    
    client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
    
    resp = client.databases.patch_config(database_cluster_uuid="a7aba9d")