- Resource: BlueGreenDeployment
- State
- TargetConfig
- SourceTargetPairedNode
- NodeInfo
- State
- CurrentlyServingTraffic
- DeploymentTask
- Type
- State
- ConfigDiff
- DeploymentTasks
- RequestedConfig
- Methods
Resource: BlueGreenDeployment
A BlueGreenDeployment resource represents a Cloud SQL blue-green deployment setup. It orchestrates the lifecycle of creating a synchronized "green" environment from a "blue" production environment, performing updates, and managing the switchover process to minimize downtime.
| JSON representation |
|---|
{ "name": string, "description": string, "createTime": string, "state": enum ( |
| Fields | |
|---|---|
name |
Output only. Identifier. The full resource name of the deployment. Format: projects/{project}/locations/{location}/blueGreenDeployments/{deploymentId} |
description |
Optional. User-provided description for the deployment. |
createTime |
Output only. The time when the deployment was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
state |
Output only. The current state of the blue-green deployment. |
sourceInstance |
Required. Immutable. The instance ID of the source instance (the "blue" instance). The value for this field does not include the project ID, for example, |
targetConfig |
Optional. Immutable. Deprecated: Use requestedConfig instead. The configuration intended for the target instance(s) when the deployment was created. This field is immutable. |
switchoverTargetInstance |
Output only. Details about the primary target instance (the "Green" instance) that will be promoted during switchover. |
pairedNodes[] |
Output only. Deprecated: Use deploymentMappings instead. Output only. A list representing the pairs of source and target instances in the deployment. |
errorDetail |
Output only. Provides an error message with details on why switchover is not possible. |
deploymentMappings[] |
Output only. A list representing the pairs of source and target instances in the deployment. |
deploymentTasks |
Output only. Combined list of tasks for all paired nodes. |
requestedConfig |
Optional. Immutable. Optional on create, and immutable. The configuration intended for the target instance(s) when the deployment was created. |
State
The state of the blue-green deployment. This enum is not frozen, and new values may be added in the future.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
The state of the deployment is unknown. |
PROVISIONING |
The deployment is being provisioned. |
SWITCHOVER_READY |
The deployment is ready for switchover. |
SWITCHOVER_NOT_READY |
The deployment is not ready for switchover. |
SWITCHOVER_IN_PROGRESS |
The deployment is in the process of switching over. |
SWITCHOVER_COMPLETED |
The deployment has completed switchover. |
DELETING |
The deployment is being deleted. |
TargetConfig
Deprecated: Use RequestedConfig instead. Configuration specified by the user at creation time for the target (Green) instance.
| JSON representation |
|---|
{ "databaseVersion": string } |
| Fields | |
|---|---|
databaseVersion |
Optional. The target database major version for the upgrade. |
SourceTargetPairedNode
Represents a pairing of a source instance node and a target instance node.
| JSON representation |
|---|
{ "source": { object ( |
| Fields | |
|---|---|
source |
Output only. Resource name of the source instance in this pair. |
target |
Output only. Details of the corresponding target instance in this pair. |
state |
Output only. The current state of this specific source-target pair. |
currentlyServingTraffic |
Output only. Deprecated: Indicates which instance (SOURCE or TARGET) in the pair is currently live. Used for internal implementation and deprecated for external use. |
tasks[] |
Output only. Tasks performed or being performed on the target instance of this pair. |
diffs[] |
Output only. Describes the list of differences for this pair. |
NodeInfo
Details about an instance within the deployment.
| JSON representation |
|---|
{
"instance": string,
"connection": string,
"dns": string,
"ipMappings": [
{
object ( |
| Fields | |
|---|---|
instance |
Output only. The full resource name of the instance. Format: projects/{project}/instances/{instance} |
connection |
Output only. The instance connection name. |
dns |
Output only. The unique DNS name for this instance. |
ipMappings[] |
Output only. The list of IP addresses for this instance. |
State
The state of a pair of source and target instances in deployment (paired node).
| Enums | |
|---|---|
STATE_UNSPECIFIED |
The state of the paired node is unknown. |
PROVISIONING |
The paired node is being provisioned. |
PROVISIONED |
The paired node is provisioned. |
UPGRADING |
The paired node is upgrading. |
UPGRADED |
The paired node is upgraded. |
UPGRADE_FAILED |
Upgrade failed on the paired node. |
SWITCHOVER_IN_PROGRESS |
Switchover is in progress. |
SWITCHOVER_FAILED |
Switchover failed on the paired node. |
SWITCHOVER_SUCCEEDED |
Switchover completed successfully. |
DELETING |
The paired node is being deleted. |
CurrentlyServingTraffic
The instance currently serving traffic.
| Enums | |
|---|---|
CURRENTLY_SERVING_TRAFFIC_UNSPECIFIED |
The instance serving traffic is unknown. |
SOURCE |
The source instance is serving traffic. |
TARGET |
The target instance is serving traffic. |
DeploymentTask
Represents a task executed as part of the deployment on a target instance.
| JSON representation |
|---|
{ "type": enum ( |
| Fields | |
|---|---|
type |
Output only. The type of the task. |
state |
Output only. The current state of the task. |
startTime |
Output only. Task start time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endTime |
Output only. Task end time (if completed). Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
errorMessage |
Output only. Optional Error details if the task state is FAILED. |
Type
The type of the task. This enum is not frozen, and new values may be added in the future.
| Enums | |
|---|---|
TYPE_UNSPECIFIED |
The default value. This value is used if the type is omitted. |
PROVISION |
Creating target instance. |
UPGRADE |
e.g., Major Version Upgrade on Target. |
SWITCHOVER |
Promoting Target, Demoting Source for this pair. |
DELETE |
The task is to delete deployment. |
POST_SWITCHOVER_OPERATIONS |
Post-switchover operations, including cleaning up resources of the old instance, taking final backups, and updating metadata. |
State
The state of the task. This enum is not frozen, and new values may be added in the future.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
The state of the task is unknown. |
PENDING |
The task is pending. |
RUNNING |
The task is running. |
SUCCEEDED |
The task has succeeded. |
FAILED |
The task has failed. |
ConfigDiff
Represents a specific configuration difference between Blue and Green instances.
| JSON representation |
|---|
{ "field": string, "sourceValue": string, "targetValue": string } |
| Fields | |
|---|---|
field |
Output only. The name of the field that differs, fully-qualified. Example: settings.tier |
sourceValue |
Output only. The value on the source instance. |
targetValue |
Output only. The value on the target instance. |
DeploymentTasks
Combined list of tasks for all paired nodes in the deployment.
| JSON representation |
|---|
{
"task": [
{
object ( |
| Fields | |
|---|---|
task[] |
Output only. Tasks performed or being performed on the paired nodes of the deployment at a consolidated level. |
RequestedConfig
Configuration specified by the user at creation time for the target (Green) instance.
| JSON representation |
|---|
{ "databaseVersion": string } |
| Fields | |
|---|---|
databaseVersion |
Optional. The target database major version for the upgrade. |
Methods |
|
|---|---|
|
Creates a blue-green deployment under a given project and location. |
|
Deletes a blue-green deployment, including metadata and underlying resources based on the deployment state. |
|
Retrieves a blue-green deployment resource under a given project and location. |
|
Lists blue-green deployments under a given project. |
|
Switches over to green instance for a blue-green deployment. |