Add a Database
add_databaseInstall PostgreSQL, MySQL, MariaDB, MongoDB, or Redis from the Template Catalog in one call, with credentials Control Plane generates so no value passes through this chat. Lets the listed workloads connect, waits up to 40 seconds for the database to be ready, and returns its internal host and port plus the env values an app uses, as cpln://secret references. Without gvc it uses the GVC a job made for apps, asks about any other, or creates the first one once the user picks a location. Safe to call again with the same arguments: it reuses what exists and reports readiness. On an existing database, allowWorkloads replaces its access rules by reapplying its template, which can redeploy it and resets changes made outside its values, such as volume snapshot settings. Other templates: install_template.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gvc | No | GVC the database runs in; its locations are where it runs. Omit it to use the GVC a job made for apps, or to create the first one. A name that does not exist yet creates that GVC in location. | |
| org | No | Organization slug. | |
| name | Yes | Name for this database. Its workload and its credentials secret are named after it. | |
| tier | No | starter (default): one instance; Redis keeps the one Sentinel it needs to start. ha: failover, when the user wants it: Redis only (3 Redis and 3 Sentinel). PostgreSQL and MongoDB failover are separate templates (postgres-highly-available, mongodb-cluster) through install_template. | |
| engine | Yes | Database engine. | |
| version | No | Template version (e.g. "3.0.1"). Omit to use the latest. See get_template for available versions. | |
| location | No | Only to create a GVC: An enabled location of the org, from the list a placement question gives. | |
| storageGiB | No | Initial storage in GiB (default and minimum 10). Redis keeps data in memory unless this is passed. | |
| allowWorkloads | No | Workloads that may connect. Omit to allow every workload in the same GVC, including ones created later; an app in another GVC must be listed. A listed workload that does not exist yet is admitted only once the database is updated after it exists: allow_workload_access on the database then. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | The full result. Read this, not only the summary. | |
| details | No | ||
| summary | Yes | ||
| nextSteps | No |