To list all of the database clusters available on your account, send a GET request to /v2/databases
. To limit the results to database clusters with a specific tag, include the tag_name
query parameter set to the name of the tag. For example, /v2/databases?tag_name=$TAG_NAME
.
The result will be a JSON object with a databases
key. This will be set to an array of database objects, each of which will contain the standard database attributes.
The embedded connection
and private_connection
objects will contain the information needed to access the database cluster. For multi-node clusters, the standby_connection
and standby_private_connection
objects will contain the information needed to connect to the cluster’s standby node(s).
The embedded maintenance_window
object will contain information about any scheduled maintenance for the database cluster.
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
tag_name |
string | False | Limits the results to database clusters with a specific tag. |
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
get_resp = client.databases.list_clusters(tag_name="production")
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.