gcp.sql.database.ensure ​
Create or return a PostgreSQL database inside a Cloud SQL instance.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | Base-gcp |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | GCP CloudConnection UUID. |
project_id | string | No | — | GCP project override. |
instance_id | string | Yes | — | Cloud SQL instance id. |
database_name | string | Yes | — | Database name. |
charset | string | No | — | Database charset. |
collation | string | No | — | Database collation. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | Echoed connection UUID. |
project_id | string | No | — | Effective project. |
instance_id | string | No | — | Cloud SQL instance id. |
database_name | string | No | — | Database name. |
created | boolean | No | — | True when created during this run. |
database | json | No | — | Sanitized database response. |
failure_reason | string | No | — | Human-readable failure reason. |
failed_step | string | No | — | Failed logical step. |
failed_layer | json | No | — | Engine failed layer. |
failed_at_state | string | No | — | State where failure occurred. |
error | string | No | — | Error message. |
error_type | string | No | — | Error class. |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
ensuring | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | ensuring | — |
ensuring | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "gcp.sql.database.ensure",
"initial_data": {
"connection_uuid": "value",
"instance_id": "value",
"database_name": "value"
}
}