{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"To create a database cluster, send a POST request to `/v2/databases`. To see a list  of options for each engine, such as available regions, size slugs, and versions, send a GET request to the `/v2/databases/options` endpoint. The available sizes for  the `storage_size_mib` field depends on the cluster's size. To see a list of available sizes, see [Managed Database Pricing](https://www.digitalocean.com/pricing/managed-databases).\n\nThe create response returns a JSON object with a key called `database`. The value of this is an object that contains the standard attributes associated with a database cluster. The initial value of the database cluster's `status` attribute is `creating`. When the cluster is ready to receive traffic, this changes to `online`.\n\nThe embedded `connection` and `private_connection` objects contains the information needed to access the database cluster. For multi-node clusters, the `standby_connection` and `standby_private_connection` objects contain the information needed to connect to the cluster's standby node(s).\n\nDigitalOcean managed PostgreSQL and MySQL database clusters take automated daily backups. To create a new database cluster based on a backup of an existing cluster, send a POST request to `/v2/databases`. In addition to the standard database cluster attributes, the JSON body must include a key named `backup_restore` with the name of the original database cluster and the timestamp of the backup to be restored. Creating a database from a backup is the same as forking a database in the control panel.\n\nPostgreSQL and MySQL Advanced Edition clusters can be provisioned by setting `engine` to `advanced_pg` or `advanced_mysql`. Advanced Edition clusters are currently in public preview and target highly available workloads. `advanced_pg` supports 1-, 2-, and 3-node deployments; `advanced_mysql` only supports 1- and 3-node deployments. See the [PostgreSQL Advanced Edition](https://docs.digitalocean.com/products/databases/postgresql/how-to/use-advanced-edition-clusters/) and [MySQL Advanced Edition](https://docs.digitalocean.com/products/databases/mysql/how-to/use-advanced-edition-clusters/) documentation for the feature differences vs. Standard Edition and current preview limitations.\n\nNote: Caching cluster creates are no longer supported as of 2025-04-30T00:00:00Z. Backups are also not supported for Caching or Valkey clusters.","properties":{"body":{"allOf":[{"$ref":"#/definitions/database_cluster"},{"type":"object","properties":{"backup_restore":{"$ref":"#/definitions/database_backup"}}}],"examples":[{"name":"backend","engine":"pg","version":"14","region":"nyc3","size":"db-s-2vcpu-4gb","storage_size_mib":61440,"num_nodes":2,"tags":["production"]}]}},"required":["body"],"additionalProperties":false,"definitions":{"database_cluster":{"type":"object","properties":{"name":{"type":"string","description":"A unique, human-readable name referring to a database cluster.","examples":["backend"]},"engine":{"type":"string","enum":["pg","mysql","redis","valkey","mongodb","kafka","opensearch","advanced_pg","advanced_mysql"],"description":"A slug representing the database engine used for the cluster. The possible values are: \"pg\" for PostgreSQL, \"mysql\" for MySQL, \"redis\" for Caching, \"mongodb\" for MongoDB, \"kafka\" for Kafka, \"opensearch\" for OpenSearch, \"valkey\" for Valkey, \"advanced_pg\" for PostgreSQL Advanced Edition, and \"advanced_mysql\" for MySQL Advanced Edition. Advanced Edition engines are currently in public preview.","examples":["mysql"]},"version":{"type":"string","description":"A string representing the version of the database engine in use for the cluster.","examples":["8"]},"num_nodes":{"type":"integer","description":"The number of nodes in the database cluster.","examples":[2]},"size":{"type":"string","description":"The slug identifier representing the size of the nodes in the database cluster.","examples":["db-s-2vcpu-4gb"]},"region":{"type":"string","description":"The slug identifier for the region where the database cluster is located.","examples":["nyc3"]},"private_network_uuid":{"type":"string","pattern":"^$|[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}","description":"A string specifying the UUID of the VPC to which the database cluster will be assigned. If excluded, the cluster when creating a new database cluster, it will be assigned to your account's default VPC for the region. <br><br>Requires `vpc:read` scope.","examples":["d455e75d-4858-4eec-8c95-da2f0a5f93a7"]},"tags":{"type":["array","null"],"items":{"type":"string"},"description":"An array of tags (as strings) to apply to the database cluster. <br><br>Requires `tag:create` scope.","examples":[["production"]]},"ui_connection":{"allOf":[{"$ref":"#/definitions/opensearch_connection"},{}],"description":"The connection details for OpenSearch dashboard. "},"schema_registry_connection":{"allOf":[{"$ref":"#/definitions/schema_registry_connection"},{}],"description":"The connection details for Schema Registry."},"connection":{"allOf":[{"$ref":"#/definitions/database_connection"},{}]},"private_connection":{"allOf":[{"$ref":"#/definitions/database_connection"},{}]},"standby_connection":{"allOf":[{"$ref":"#/definitions/database_connection"},{}]},"standby_private_connection":{"allOf":[{"$ref":"#/definitions/database_connection"},{}]},"maintenance_window":{"allOf":[{"$ref":"#/definitions/database_maintenance_window"},{}]},"project_id":{"type":"string","format":"uuid","description":"The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.<br><br>Requires `project:assign_resource` scope.","examples":["9cc10173-e9ea-4176-9dbc-a4cee4c4ff30"]},"rules":{"type":"array","items":{"$ref":"#/definitions/firewall_rule"}},"storage_size_mib":{"type":"integer","description":"Additional storage added to the cluster, in MiB. If null, no additional storage is added to the cluster, beyond what is provided as a base amount from the 'size' and any previously added additional storage.","examples":[61440]},"autoscale":{"allOf":[{"$ref":"#/definitions/database_autoscale_params"}],"description":"Autoscaling configuration for the database cluster. Currently only supports storage autoscaling. If null, autoscaling is not configured for the cluster."},"do_settings":{"allOf":[{"$ref":"#/definitions/do_settings"},{"description":"DigitalOcean-specific settings for the database cluster, including custom service CNAMEs."}]}},"required":["name","engine","num_nodes","size","region"]},"database_backup":{"type":"object","properties":{"database_name":{"type":"string","description":"The name of an existing database cluster from which the backup will be restored.","examples":["backend"]},"backup_created_at":{"type":"string","format":"date-time","description":"The timestamp of an existing database cluster backup in ISO8601 combined date and time format. The most recent backup will be used if excluded.","examples":["2019-01-31T19:25:22Z"]}},"required":["database_name"]},"opensearch_connection":{"type":"object","properties":{}},"schema_registry_connection":{"type":"object","properties":{}},"database_connection":{"type":"object","properties":{}},"database_maintenance_window":{"type":["object","null"],"properties":{"day":{"type":"string","description":"The day of the week on which to apply maintenance updates.","examples":["tuesday"]},"hour":{"type":"string","description":"The hour in UTC at which maintenance updates will be applied in 24 hour format.","examples":["14:00"]}},"required":["day","hour"]},"firewall_rule":{"type":"object","properties":{"uuid":{"type":"string","pattern":"^$|[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}","description":"A unique ID for the firewall rule itself.","examples":["79f26d28-ea8a-41f2-8ad8-8cfcdd020095"]},"type":{"type":"string","enum":["droplet","k8s","ip_addr","tag","app"],"description":"The type of resource that the firewall rule allows to access the database cluster.","examples":["droplet"]},"value":{"type":"string","description":"The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster.","examples":["ff2a6c52-5a44-4b63-b99c-0e98e7a63d61"]},"description":{"type":"string","description":"A human-readable description of the rule.","examples":["an IP address for local development"]}},"required":["type","value"]},"database_autoscale_params":{"type":"object","description":"Contains all autoscaling configuration for a database cluster","properties":{"storage":{"allOf":[{"$ref":"#/definitions/database_storage_autoscale_params"},{"description":"Storage autoscaling configuration"}]}}},"do_settings":{"type":"object","description":"DigitalOcean-specific settings for the database cluster.","properties":{"service_cnames":{"type":"array","items":{"type":"string","pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)+$","maxLength":253},"maxItems":16,"description":"An array of custom CNAMEs for the database cluster. Each CNAME must be a valid RFC 1123 hostname (e.g., \"db.example.com\"). Maximum of 16 CNAMEs allowed, each up to 253 characters.","examples":[["db.example.com","database.myapp.io"]]}}},"database_storage_autoscale_params":{"type":"object","description":"Configuration for database cluster storage autoscaling","properties":{"enabled":{"type":"boolean","description":"Whether storage autoscaling is enabled for the cluster","examples":[true]},"threshold_percent":{"type":"integer","minimum":15,"maximum":95,"description":"The storage usage threshold percentage that triggers autoscaling. When storage usage exceeds this percentage, additional storage will be added automatically.","examples":[80]},"increment_gib":{"type":"integer","minimum":10,"maximum":500,"description":"The amount of additional storage to add (in GiB) when autoscaling is triggered","examples":[10]}},"required":["enabled"]}}},"name":"Create a New Database Cluster","id":"digitalocean.databases_create_cluster","example":{"body":{"name":"backend","engine":"pg","version":"14","region":"nyc3","size":"db-s-2vcpu-4gb","storage_size_mib":61440,"num_nodes":2,"tags":["production"]}},"maxRequests":1,"summary":false}}