instances
Creates, updates, deletes, gets or lists an instances resource.
Overview
| Name | instances |
| Type | Resource |
| Id | google.sqladmin.instances |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the Cloud SQL instance. This does not include the project ID. |
availableMaintenanceVersions | array | Output only. List all maintenance versions applicable on the instance |
backendType | string | The backend type. SECOND_GEN: Cloud SQL database instance. EXTERNAL: A database server that is not managed by Google. This property is read-only; use the tier property in the settings object to determine the database type. (SQL_BACKEND_TYPE_UNSPECIFIED, FIRST_GEN, SECOND_GEN, EXTERNAL) |
connectionName | string | Connection name of the Cloud SQL instance used in connection strings. |
createTime | string (google-datetime) | Output only. The time when the instance was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
currentDiskSize | string (int64) | The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. |
databaseCenterIntegrationEnabled | boolean | Optional. If true, instance metadata is sent to the Database Center. If false, instance metadata is not sent to the Database Center. |
databaseInstalledVersion | string | Output only. Stores the current database version running on the instance including minor version such as MYSQL_8_0_18. |
databaseVersion | string | The database engine type and version. The databaseVersion field cannot be changed after instance creation. (SQL_DATABASE_VERSION_UNSPECIFIED, MYSQL_5_1, MYSQL_5_5, MYSQL_5_6, MYSQL_5_7, MYSQL_8_0, MYSQL_8_0_18, MYSQL_8_0_26, MYSQL_8_0_27, MYSQL_8_0_28, MYSQL_8_0_29, MYSQL_8_0_30, MYSQL_8_0_31, MYSQL_8_0_32, MYSQL_8_0_33, MYSQL_8_0_34, MYSQL_8_0_35, MYSQL_8_0_36, MYSQL_8_0_37, MYSQL_8_0_39, MYSQL_8_0_40, MYSQL_8_0_41, MYSQL_8_0_42, MYSQL_8_0_43, MYSQL_8_0_44, MYSQL_8_0_45, MYSQL_8_0_46, MYSQL_8_4, MYSQL_9_7, SQLSERVER_2017_STANDARD, SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, SQLSERVER_2017_WEB, POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13, POSTGRES_14, POSTGRES_15, POSTGRES_16, POSTGRES_17, POSTGRES_18, POSTGRES_19, POSTGRES_20, SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, SQLSERVER_2019_WEB, SQLSERVER_2022_STANDARD, SQLSERVER_2022_ENTERPRISE, SQLSERVER_2022_EXPRESS, SQLSERVER_2022_WEB, SQLSERVER_2025_STANDARD, SQLSERVER_2025_ENTERPRISE, SQLSERVER_2025_EXPRESS) |
diskEncryptionConfiguration | object | Disk encryption configuration specific to an instance. (id: DiskEncryptionConfiguration) |
diskEncryptionStatus | object | Disk encryption status specific to an instance. (id: DiskEncryptionStatus) |
dnsName | string | Output only. The dns name of the instance. |
dnsNames | array | Output only. The list of DNS names used by this instance. |
etag | string | This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. |
failoverReplica | object | The name and status of the failover replica. |
gceZone | string | The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. WARNING: Changing this might restart the instance. |
geminiConfig | object | Gemini instance configuration. (id: GeminiInstanceConfig) |
includeReplicasForMajorVersionUpgrade | boolean | Input only. Determines whether an in-place major version upgrade of replicas happens when an in-place major version upgrade of a primary instance is initiated. |
instanceType | string | The instance type. (SQL_INSTANCE_TYPE_UNSPECIFIED, CLOUD_SQL_INSTANCE, ON_PREMISES_INSTANCE, READ_REPLICA_INSTANCE, READ_POOL_INSTANCE) |
ipAddresses | array | The assigned IP addresses for the instance. |
ipv6Address | string | The IPv6 address assigned to the instance. (Deprecated) This property was applicable only to First Generation instances. |
kind | string | This is always sql#instance. |
maintenanceVersion | string | The current software version on the instance. |
masterInstanceName | string | The name of the instance which will act as primary in the replication setup. |
maxDiskSize | string (int64) | The maximum disk size of the instance in bytes. |
nodeCount | integer (int32) | The number of read pool nodes in a read pool. |
nodes | array | Output only. Entries containing information about each read pool node of the read pool. |
onPremisesConfiguration | object | Configuration specific to on-premises instances. (id: OnPremisesConfiguration) |
outOfDiskReport | object | This field represents the report generated by the proactive database wellness job for OutOfDisk issues. * Writers: * the proactive database wellness job for OOD. * Readers: * the proactive database wellness job (id: SqlOutOfDiskReport) |
primaryDnsName | string | Output only. DEPRECATED: please use write_endpoint instead. |
project | string | The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. |
pscServiceAttachmentLink | string | Output only. The link to service attachment of PSC instance. |
region | string | The geographical region of the Cloud SQL instance. It can be one of the regions where Cloud SQL operates: For example, asia-east1, europe-west1, and us-central1. The default value is us-central1. |
replicaConfiguration | object | Configuration specific to failover replicas and read replicas. (id: ReplicaConfiguration) |
replicaNames | array | The replicas of the instance. |
replicationCluster | object | Optional. A primary instance and disaster recovery (DR) replica pair. A DR replica is a cross-region replica that you designate for failover in the event that the primary instance experiences regional failure. Applicable to MySQL and PostgreSQL. (id: ReplicationCluster) |
rootPassword | string | Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances. |
satisfiesPzi | boolean | Output only. This status indicates whether the instance satisfies PZI. The status is reserved for future use. |
satisfiesPzs | boolean | This status indicates whether the instance satisfies PZS. The status is reserved for future use. |
scheduledMaintenance | object | The start time of any upcoming scheduled maintenance for this instance. (id: SqlScheduledMaintenance) |
secondaryGceZone | string | The Compute Engine zone that the failover instance is currently serving from for a regional instance. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary/failover zone. |
selfLink | string | The URI of this resource. |
serverCaCert | object | SSL configuration. (id: SslCert) |
serviceAccountEmailAddress | string | The service account email address assigned to the instance.\This property is read-only. |
settings | object | The user settings. (id: Settings) |
sqlNetworkArchitecture | string | (SQL_NETWORK_ARCHITECTURE_UNSPECIFIED, NEW_NETWORK_ARCHITECTURE, OLD_NETWORK_ARCHITECTURE) |
state | string | The current serving state of the Cloud SQL instance. (SQL_INSTANCE_STATE_UNSPECIFIED, RUNNABLE, SUSPENDED, PENDING_DELETE, PENDING_CREATE, MAINTENANCE, FAILED, ONLINE_MAINTENANCE, REPAIRING) |
suspensionReason | array | If the instance state is SUSPENDED, the reason for the suspension. |
switchTransactionLogsToCloudStorageEnabled | boolean | Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage. |
tags | object | Optional. Input only. Immutable. Tag keys and tag values that are bound to this instance. You must represent each item in the map as: "" : "". For example, a single resource can have the following tags: "123/environment": "production", "123/costCenter": "marketing", For more information on tag creation and management, see https://cloud.google.com/resource-manager/docs/tags/tags-overview. |
upgradableDatabaseVersions | array | Output only. All database versions that are available for upgrade. |
writeEndpoint | string | Output only. The dns name of the primary instance in a replication group. |
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the Cloud SQL instance. This does not include the project ID. |
availableMaintenanceVersions | array | Output only. List all maintenance versions applicable on the instance |
backendType | string | The backend type. SECOND_GEN: Cloud SQL database instance. EXTERNAL: A database server that is not managed by Google. This property is read-only; use the tier property in the settings object to determine the database type. (SQL_BACKEND_TYPE_UNSPECIFIED, FIRST_GEN, SECOND_GEN, EXTERNAL) |
connectionName | string | Connection name of the Cloud SQL instance used in connection strings. |
createTime | string (google-datetime) | Output only. The time when the instance was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
currentDiskSize | string (int64) | The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. |
databaseCenterIntegrationEnabled | boolean | Optional. If true, instance metadata is sent to the Database Center. If false, instance metadata is not sent to the Database Center. |
databaseInstalledVersion | string | Output only. Stores the current database version running on the instance including minor version such as MYSQL_8_0_18. |
databaseVersion | string | The database engine type and version. The databaseVersion field cannot be changed after instance creation. (SQL_DATABASE_VERSION_UNSPECIFIED, MYSQL_5_1, MYSQL_5_5, MYSQL_5_6, MYSQL_5_7, MYSQL_8_0, MYSQL_8_0_18, MYSQL_8_0_26, MYSQL_8_0_27, MYSQL_8_0_28, MYSQL_8_0_29, MYSQL_8_0_30, MYSQL_8_0_31, MYSQL_8_0_32, MYSQL_8_0_33, MYSQL_8_0_34, MYSQL_8_0_35, MYSQL_8_0_36, MYSQL_8_0_37, MYSQL_8_0_39, MYSQL_8_0_40, MYSQL_8_0_41, MYSQL_8_0_42, MYSQL_8_0_43, MYSQL_8_0_44, MYSQL_8_0_45, MYSQL_8_0_46, MYSQL_8_4, MYSQL_9_7, SQLSERVER_2017_STANDARD, SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, SQLSERVER_2017_WEB, POSTGRES_9_6, POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13, POSTGRES_14, POSTGRES_15, POSTGRES_16, POSTGRES_17, POSTGRES_18, POSTGRES_19, POSTGRES_20, SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, SQLSERVER_2019_EXPRESS, SQLSERVER_2019_WEB, SQLSERVER_2022_STANDARD, SQLSERVER_2022_ENTERPRISE, SQLSERVER_2022_EXPRESS, SQLSERVER_2022_WEB, SQLSERVER_2025_STANDARD, SQLSERVER_2025_ENTERPRISE, SQLSERVER_2025_EXPRESS) |
diskEncryptionConfiguration | object | Disk encryption configuration specific to an instance. (id: DiskEncryptionConfiguration) |
diskEncryptionStatus | object | Disk encryption status specific to an instance. (id: DiskEncryptionStatus) |
dnsName | string | Output only. The dns name of the instance. |
dnsNames | array | Output only. The list of DNS names used by this instance. |
etag | string | This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. |
failoverReplica | object | The name and status of the failover replica. |
gceZone | string | The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. WARNING: Changing this might restart the instance. |
geminiConfig | object | Gemini instance configuration. (id: GeminiInstanceConfig) |
includeReplicasForMajorVersionUpgrade | boolean | Input only. Determines whether an in-place major version upgrade of replicas happens when an in-place major version upgrade of a primary instance is initiated. |
instanceType | string | The instance type. (SQL_INSTANCE_TYPE_UNSPECIFIED, CLOUD_SQL_INSTANCE, ON_PREMISES_INSTANCE, READ_REPLICA_INSTANCE, READ_POOL_INSTANCE) |
ipAddresses | array | The assigned IP addresses for the instance. |
ipv6Address | string | The IPv6 address assigned to the instance. (Deprecated) This property was applicable only to First Generation instances. |
kind | string | This is always sql#instance. |
maintenanceVersion | string | The current software version on the instance. |
masterInstanceName | string | The name of the instance which will act as primary in the replication setup. |
maxDiskSize | string (int64) | The maximum disk size of the instance in bytes. |
nodeCount | integer (int32) | The number of read pool nodes in a read pool. |
nodes | array | Output only. Entries containing information about each read pool node of the read pool. |
onPremisesConfiguration | object | Configuration specific to on-premises instances. (id: OnPremisesConfiguration) |
outOfDiskReport | object | This field represents the report generated by the proactive database wellness job for OutOfDisk issues. * Writers: * the proactive database wellness job for OOD. * Readers: * the proactive database wellness job (id: SqlOutOfDiskReport) |
primaryDnsName | string | Output only. DEPRECATED: please use write_endpoint instead. |
project | string | The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. |
pscServiceAttachmentLink | string | Output only. The link to service attachment of PSC instance. |
region | string | The geographical region of the Cloud SQL instance. It can be one of the regions where Cloud SQL operates: For example, asia-east1, europe-west1, and us-central1. The default value is us-central1. |
replicaConfiguration | object | Configuration specific to failover replicas and read replicas. (id: ReplicaConfiguration) |
replicaNames | array | The replicas of the instance. |
replicationCluster | object | Optional. A primary instance and disaster recovery (DR) replica pair. A DR replica is a cross-region replica that you designate for failover in the event that the primary instance experiences regional failure. Applicable to MySQL and PostgreSQL. (id: ReplicationCluster) |
rootPassword | string | Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances. |
satisfiesPzi | boolean | Output only. This status indicates whether the instance satisfies PZI. The status is reserved for future use. |
satisfiesPzs | boolean | This status indicates whether the instance satisfies PZS. The status is reserved for future use. |
scheduledMaintenance | object | The start time of any upcoming scheduled maintenance for this instance. (id: SqlScheduledMaintenance) |
secondaryGceZone | string | The Compute Engine zone that the failover instance is currently serving from for a regional instance. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary/failover zone. |
selfLink | string | The URI of this resource. |
serverCaCert | object | SSL configuration. (id: SslCert) |
serviceAccountEmailAddress | string | The service account email address assigned to the instance.\This property is read-only. |
settings | object | The user settings. (id: Settings) |
sqlNetworkArchitecture | string | (SQL_NETWORK_ARCHITECTURE_UNSPECIFIED, NEW_NETWORK_ARCHITECTURE, OLD_NETWORK_ARCHITECTURE) |
state | string | The current serving state of the Cloud SQL instance. (SQL_INSTANCE_STATE_UNSPECIFIED, RUNNABLE, SUSPENDED, PENDING_DELETE, PENDING_CREATE, MAINTENANCE, FAILED, ONLINE_MAINTENANCE, REPAIRING) |
suspensionReason | array | If the instance state is SUSPENDED, the reason for the suspension. |
switchTransactionLogsToCloudStorageEnabled | boolean | Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage. |
tags | object | Optional. Input only. Immutable. Tag keys and tag values that are bound to this instance. You must represent each item in the map as: "" : "". For example, a single resource can have the following tags: "123/environment": "production", "123/costCenter": "marketing", For more information on tag creation and management, see https://cloud.google.com/resource-manager/docs/tags/tags-overview. |
upgradableDatabaseVersions | array | Output only. All database versions that are available for upgrade. |
writeEndpoint | string | Output only. The dns name of the primary instance in a replication group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, instance | Retrieves a resource containing information about a Cloud SQL instance. | |
list | select | project | filter, maxResults, pageToken | Lists instances under a given project. |
insert | insert | project | Creates a new Cloud SQL instance. | |
patch | update | project, instance | reconcilePscNetworking, reconcilePscNetworkingForce | Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics. |
update | replace | project, instance | Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart. | |
delete | delete | project, instance | enableFinalBackup, finalBackupDescription, finalBackupExpiryTime, finalBackupTtlDays | Deletes a Cloud SQL instance. |
acquire_ssrs_lease | exec | project, instance | Acquire a lease for the setup of SQL Server Reporting Services (SSRS). | |
clone | exec | project, instance | Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart. | |
demote | exec | project, instance | Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server. | |
demote_master | exec | project, instance | Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. | |
execute_sql | exec | project, instance | Execute SQL statements. | |
export | exec | project, instance | Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. | |
failover | exec | project, instance | Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance. | |
import | exec | project, instance | Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. | |
list_entra_id_certificates | exec | project, instance | Lists all versions of EntraID certificates for the specified instance. There can be up to three sets of certificates listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out. | |
list_server_certificates | exec | project, instance | Lists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out. For instances not using Certificate Authority Service (CAS) server CA, use ListServerCas instead. | |
perform_disk_shrink | exec | project, instance | Perform Disk Shrink on primary instance. | |
point_in_time_restore | exec | projectsId | Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery. | |
pre_check_major_version_upgrade | exec | project, instance | Execute MVU Pre-checks | |
promote_replica | exec | project, instance | failover | Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart. |
reencrypt | exec | project, instance | Reencrypt CMEK instance with latest key version. | |
release_ssrs_lease | exec | project, instance | Release a lease for the setup of SQL Server Reporting Services (SSRS). | |
reschedule_maintenance | exec | project, instance | Reschedules the maintenance on the given instance. | |
reset_replica_size | exec | project, instance | Reset Replica Size to primary instance disk size. | |
reset_ssl_config | exec | project, instance | mode | Deletes all client certificates and generates a new server SSL certificate for the instance. |
restart | exec | project, instance | Restarts a Cloud SQL instance. | |
restore_backup | exec | project, instance | Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart. | |
rotate_entra_id_certificate | exec | project, instance | Rotates the server certificate version to one previously added with the addEntraIdCertificate method. | |
rotate_server_ca | exec | project, instance | Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server certificate. | |
rotate_server_certificate | exec | project, instance | Rotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service (CAS) server CA, use RotateServerCa instead. | |
start_external_sync | exec | project, instance | Start External primary instance migration. | |
start_replica | exec | project, instance | Starts the replication in the read replica instance. | |
stop_replica | exec | project, instance | Stops the replication in the read replica instance. | |
switchover | exec | project, instance | dbTimeout | Switches over from the primary instance to the DR replica instance. |
truncate_log | exec | project, instance | Truncate MySQL general and slow query log tables MySQL only. | |
verify_external_sync_settings | exec | project, instance | Verify External primary instance external sync settings. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
instance | string | |
project | string | |
projectsId | string | |
dbTimeout | string (google-duration) | |
enableFinalBackup | boolean | |
failover | boolean | |
filter | string | |
finalBackupDescription | string | |
finalBackupExpiryTime | string (google-datetime) | |
finalBackupTtlDays | string (int64) | |
maxResults | integer (uint32) | |
mode | string | |
pageToken | string | |
reconcilePscNetworking | boolean | |
reconcilePscNetworkingForce | boolean |
SELECT examples
- get
- list
Retrieves a resource containing information about a Cloud SQL instance.
SELECT
name,
availableMaintenanceVersions,
backendType,
connectionName,
createTime,
currentDiskSize,
databaseCenterIntegrationEnabled,
databaseInstalledVersion,
databaseVersion,
diskEncryptionConfiguration,
diskEncryptionStatus,
dnsName,
dnsNames,
etag,
failoverReplica,
gceZone,
geminiConfig,
includeReplicasForMajorVersionUpgrade,
instanceType,
ipAddresses,
ipv6Address,
kind,
maintenanceVersion,
masterInstanceName,
maxDiskSize,
nodeCount,
nodes,
onPremisesConfiguration,
outOfDiskReport,
primaryDnsName,
project,
pscServiceAttachmentLink,
region,
replicaConfiguration,
replicaNames,
replicationCluster,
rootPassword,
satisfiesPzi,
satisfiesPzs,
scheduledMaintenance,
secondaryGceZone,
selfLink,
serverCaCert,
serviceAccountEmailAddress,
settings,
sqlNetworkArchitecture,
state,
suspensionReason,
switchTransactionLogsToCloudStorageEnabled,
tags,
upgradableDatabaseVersions,
writeEndpoint
FROM google.sqladmin.instances
WHERE project = '{{ project }}' -- required
AND instance = '{{ instance }}' -- required
;
Lists instances under a given project.
SELECT
name,
availableMaintenanceVersions,
backendType,
connectionName,
createTime,
currentDiskSize,
databaseCenterIntegrationEnabled,
databaseInstalledVersion,
databaseVersion,
diskEncryptionConfiguration,
diskEncryptionStatus,
dnsName,
dnsNames,
etag,
failoverReplica,
gceZone,
geminiConfig,
includeReplicasForMajorVersionUpgrade,
instanceType,
ipAddresses,
ipv6Address,
kind,
maintenanceVersion,
masterInstanceName,
maxDiskSize,
nodeCount,
nodes,
onPremisesConfiguration,
outOfDiskReport,
primaryDnsName,
project,
pscServiceAttachmentLink,
region,
replicaConfiguration,
replicaNames,
replicationCluster,
rootPassword,
satisfiesPzi,
satisfiesPzs,
scheduledMaintenance,
secondaryGceZone,
selfLink,
serverCaCert,
serviceAccountEmailAddress,
settings,
sqlNetworkArchitecture,
state,
suspensionReason,
switchTransactionLogsToCloudStorageEnabled,
tags,
upgradableDatabaseVersions,
writeEndpoint
FROM google.sqladmin.instances
WHERE project = '{{ project }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- insert
- Manifest
Creates a new Cloud SQL instance.
INSERT INTO google.sqladmin.instances (
data__backendType,
data__connectionName,
data__currentDiskSize,
data__databaseCenterIntegrationEnabled,
data__databaseVersion,
data__diskEncryptionConfiguration,
data__diskEncryptionStatus,
data__etag,
data__failoverReplica,
data__gceZone,
data__geminiConfig,
data__includeReplicasForMajorVersionUpgrade,
data__instanceType,
data__ipAddresses,
data__ipv6Address,
data__kind,
data__maintenanceVersion,
data__masterInstanceName,
data__maxDiskSize,
data__name,
data__nodeCount,
data__onPremisesConfiguration,
data__outOfDiskReport,
data__project,
data__region,
data__replicaConfiguration,
data__replicaNames,
data__replicationCluster,
data__rootPassword,
data__satisfiesPzs,
data__scheduledMaintenance,
data__secondaryGceZone,
data__selfLink,
data__serverCaCert,
data__serviceAccountEmailAddress,
data__settings,
data__sqlNetworkArchitecture,
data__state,
data__suspensionReason,
data__switchTransactionLogsToCloudStorageEnabled,
data__tags,
project
)
SELECT
'{{ backendType }}',
'{{ connectionName }}',
'{{ currentDiskSize }}',
{{ databaseCenterIntegrationEnabled }},
'{{ databaseVersion }}',
'{{ diskEncryptionConfiguration }}',
'{{ diskEncryptionStatus }}',
'{{ etag }}',
'{{ failoverReplica }}',
'{{ gceZone }}',
'{{ geminiConfig }}',
{{ includeReplicasForMajorVersionUpgrade }},
'{{ instanceType }}',
'{{ ipAddresses }}',
'{{ ipv6Address }}',
'{{ kind }}',
'{{ maintenanceVersion }}',
'{{ masterInstanceName }}',
'{{ maxDiskSize }}',
'{{ name }}',
{{ nodeCount }},
'{{ onPremisesConfiguration }}',
'{{ outOfDiskReport }}',
'{{ project }}',
'{{ region }}',
'{{ replicaConfiguration }}',
'{{ replicaNames }}',
'{{ replicationCluster }}',
'{{ rootPassword }}',
{{ satisfiesPzs }},
'{{ scheduledMaintenance }}',
'{{ secondaryGceZone }}',
'{{ selfLink }}',
'{{ serverCaCert }}',
'{{ serviceAccountEmailAddress }}',
'{{ settings }}',
'{{ sqlNetworkArchitecture }}',
'{{ state }}',
'{{ suspensionReason }}',
{{ switchTransactionLogsToCloudStorageEnabled }},
'{{ tags }}',
'{{ project }}'
RETURNING
name,
acquireSsrsLeaseContext,
apiWarning,
backupContext,
endTime,
error,
exportContext,
importContext,
insertTime,
kind,
operationType,
preCheckMajorVersionUpgradeContext,
selfLink,
startTime,
status,
subOperationType,
targetId,
targetLink,
targetProject,
user
;
# Description fields are for documentation purposes
- name: instances
props:
- name: project
value: "{{ project }}"
description: Required parameter for the instances resource.
- name: backendType
value: "{{ backendType }}"
description: |
The backend type. `SECOND_GEN`: Cloud SQL database instance. `EXTERNAL`: A database server that is not managed by Google. This property is read-only; use the `tier` property in the `settings` object to determine the database type.
valid_values: ['SQL_BACKEND_TYPE_UNSPECIFIED', 'FIRST_GEN', 'SECOND_GEN', 'EXTERNAL']
- name: connectionName
value: "{{ connectionName }}"
description: |
Connection name of the Cloud SQL instance used in connection strings.
- name: currentDiskSize
value: "{{ currentDiskSize }}"
description: |
The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see [this announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ) for details.
- name: databaseCenterIntegrationEnabled
value: {{ databaseCenterIntegrationEnabled }}
description: |
Optional. If true, instance metadata is sent to the Database Center. If false, instance metadata is not sent to the Database Center.
- name: databaseVersion
value: "{{ databaseVersion }}"
description: |
The database engine type and version. The `databaseVersion` field cannot be changed after instance creation.
valid_values: ['SQL_DATABASE_VERSION_UNSPECIFIED', 'MYSQL_5_1', 'MYSQL_5_5', 'MYSQL_5_6', 'MYSQL_5_7', 'MYSQL_8_0', 'MYSQL_8_0_18', 'MYSQL_8_0_26', 'MYSQL_8_0_27', 'MYSQL_8_0_28', 'MYSQL_8_0_29', 'MYSQL_8_0_30', 'MYSQL_8_0_31', 'MYSQL_8_0_32', 'MYSQL_8_0_33', 'MYSQL_8_0_34', 'MYSQL_8_0_35', 'MYSQL_8_0_36', 'MYSQL_8_0_37', 'MYSQL_8_0_39', 'MYSQL_8_0_40', 'MYSQL_8_0_41', 'MYSQL_8_0_42', 'MYSQL_8_0_43', 'MYSQL_8_0_44', 'MYSQL_8_0_45', 'MYSQL_8_0_46', 'MYSQL_8_4', 'MYSQL_9_7', 'SQLSERVER_2017_STANDARD', 'SQLSERVER_2017_ENTERPRISE', 'SQLSERVER_2017_EXPRESS', 'SQLSERVER_2017_WEB', 'POSTGRES_9_6', 'POSTGRES_10', 'POSTGRES_11', 'POSTGRES_12', 'POSTGRES_13', 'POSTGRES_14', 'POSTGRES_15', 'POSTGRES_16', 'POSTGRES_17', 'POSTGRES_18', 'POSTGRES_19', 'POSTGRES_20', 'SQLSERVER_2019_STANDARD', 'SQLSERVER_2019_ENTERPRISE', 'SQLSERVER_2019_EXPRESS', 'SQLSERVER_2019_WEB', 'SQLSERVER_2022_STANDARD', 'SQLSERVER_2022_ENTERPRISE', 'SQLSERVER_2022_EXPRESS', 'SQLSERVER_2022_WEB', 'SQLSERVER_2025_STANDARD', 'SQLSERVER_2025_ENTERPRISE', 'SQLSERVER_2025_EXPRESS']
- name: diskEncryptionConfiguration
description: |
Disk encryption configuration specific to an instance.
value:
kind: "{{ kind }}"
kmsKeyName: "{{ kmsKeyName }}"
- name: diskEncryptionStatus
description: |
Disk encryption status specific to an instance.
value:
kind: "{{ kind }}"
kmsKeyVersionName: "{{ kmsKeyVersionName }}"
- name: etag
value: "{{ etag }}"
description: |
This field is deprecated and will be removed from a future version of the API. Use the `settings.settingsVersion` field instead.
- name: failoverReplica
description: |
The name and status of the failover replica.
value:
available: {{ available }}
name: "{{ name }}"
- name: gceZone
value: "{{ gceZone }}"
description: |
The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. WARNING: Changing this might restart the instance.
- name: geminiConfig
description: |
Gemini instance configuration.
value:
activeQueryEnabled: {{ activeQueryEnabled }}
entitled: {{ entitled }}
flagRecommenderEnabled: {{ flagRecommenderEnabled }}
googleVacuumMgmtEnabled: {{ googleVacuumMgmtEnabled }}
indexAdvisorEnabled: {{ indexAdvisorEnabled }}
oomSessionCancelEnabled: {{ oomSessionCancelEnabled }}
- name: includeReplicasForMajorVersionUpgrade
value: {{ includeReplicasForMajorVersionUpgrade }}
description: |
Input only. Determines whether an in-place major version upgrade of replicas happens when an in-place major version upgrade of a primary instance is initiated.
- name: instanceType
value: "{{ instanceType }}"
description: |
The instance type.
valid_values: ['SQL_INSTANCE_TYPE_UNSPECIFIED', 'CLOUD_SQL_INSTANCE', 'ON_PREMISES_INSTANCE', 'READ_REPLICA_INSTANCE', 'READ_POOL_INSTANCE']
- name: ipAddresses
description: |
The assigned IP addresses for the instance.
value:
- ipAddress: "{{ ipAddress }}"
timeToRetire: "{{ timeToRetire }}"
type: "{{ type }}"
- name: ipv6Address
value: "{{ ipv6Address }}"
description: |
The IPv6 address assigned to the instance. (Deprecated) This property was applicable only to First Generation instances.
- name: kind
value: "{{ kind }}"
description: |
This is always `sql#instance`.
- name: maintenanceVersion
value: "{{ maintenanceVersion }}"
description: |
The current software version on the instance.
- name: masterInstanceName
value: "{{ masterInstanceName }}"
description: |
The name of the instance which will act as primary in the replication setup.
- name: maxDiskSize
value: "{{ maxDiskSize }}"
description: |
The maximum disk size of the instance in bytes.
- name: name
value: "{{ name }}"
description: |
Name of the Cloud SQL instance. This does not include the project ID.
- name: nodeCount
value: {{ nodeCount }}
description: |
The number of read pool nodes in a read pool.
- name: onPremisesConfiguration
description: |
Configuration specific to on-premises instances.
value:
caCertificate: "{{ caCertificate }}"
clientCertificate: "{{ clientCertificate }}"
clientKey: "{{ clientKey }}"
dmsManaged: {{ dmsManaged }}
dumpFilePath: "{{ dumpFilePath }}"
hostPort: "{{ hostPort }}"
kind: "{{ kind }}"
password: "{{ password }}"
selectedObjects:
- database: "{{ database }}"
sourceInstance:
name: "{{ name }}"
project: "{{ project }}"
region: "{{ region }}"
sslOption: "{{ sslOption }}"
username: "{{ username }}"
- name: outOfDiskReport
description: |
This field represents the report generated by the proactive database wellness job for OutOfDisk issues. * Writers: * the proactive database wellness job for OOD. * Readers: * the proactive database wellness job
value:
sqlMinRecommendedIncreaseSizeGb: {{ sqlMinRecommendedIncreaseSizeGb }}
sqlOutOfDiskState: "{{ sqlOutOfDiskState }}"
- name: project
value: "{{ project }}"
description: |
The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
- name: region
value: "{{ region }}"
description: |
The geographical region of the Cloud SQL instance. It can be one of the [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r) where Cloud SQL operates: For example, `asia-east1`, `europe-west1`, and `us-central1`. The default value is `us-central1`.
- name: replicaConfiguration
description: |
Configuration specific to failover replicas and read replicas.
value:
cascadableReplica: {{ cascadableReplica }}
failoverTarget: {{ failoverTarget }}
kind: "{{ kind }}"
mysqlReplicaConfiguration:
caCertificate: "{{ caCertificate }}"
clientCertificate: "{{ clientCertificate }}"
clientKey: "{{ clientKey }}"
connectRetryInterval: {{ connectRetryInterval }}
dumpFilePath: "{{ dumpFilePath }}"
kind: "{{ kind }}"
masterHeartbeatPeriod: "{{ masterHeartbeatPeriod }}"
password: "{{ password }}"
sslCipher: "{{ sslCipher }}"
username: "{{ username }}"
verifyServerCertificate: {{ verifyServerCertificate }}
- name: replicaNames
value:
- "{{ replicaNames }}"
description: |
The replicas of the instance.
- name: replicationCluster
description: |
Optional. A primary instance and disaster recovery (DR) replica pair. A DR replica is a cross-region replica that you designate for failover in the event that the primary instance experiences regional failure. Applicable to MySQL and PostgreSQL.
value:
drReplica: {{ drReplica }}
failoverDrReplicaName: "{{ failoverDrReplicaName }}"
psaWriteEndpoint: "{{ psaWriteEndpoint }}"
- name: rootPassword
value: "{{ rootPassword }}"
description: |
Initial root password. Use only on creation. You must set root passwords before you can connect to PostgreSQL instances.
- name: satisfiesPzs
value: {{ satisfiesPzs }}
description: |
This status indicates whether the instance satisfies PZS. The status is reserved for future use.
- name: scheduledMaintenance
description: |
The start time of any upcoming scheduled maintenance for this instance.
value:
canDefer: {{ canDefer }}
canReschedule: {{ canReschedule }}
scheduleDeadlineTime: "{{ scheduleDeadlineTime }}"
startTime: "{{ startTime }}"
- name: secondaryGceZone
value: "{{ secondaryGceZone }}"
description: |
The Compute Engine zone that the failover instance is currently serving from for a regional instance. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary/failover zone.
- name: selfLink
value: "{{ selfLink }}"
description: |
The URI of this resource.
- name: serverCaCert
description: |
SSL configuration.
value:
cert: "{{ cert }}"
certSerialNumber: "{{ certSerialNumber }}"
commonName: "{{ commonName }}"
createTime: "{{ createTime }}"
expirationTime: "{{ expirationTime }}"
instance: "{{ instance }}"
kind: "{{ kind }}"
selfLink: "{{ selfLink }}"
sha1Fingerprint: "{{ sha1Fingerprint }}"
- name: serviceAccountEmailAddress
value: "{{ serviceAccountEmailAddress }}"
description: |
The service account email address assigned to the instance.This property is read-only.
- name: settings
description: |
The user settings.
value:
acceleratedReplicaMode: {{ acceleratedReplicaMode }}
activationPolicy: "{{ activationPolicy }}"
activeDirectoryConfig:
adminCredentialSecretName: "{{ adminCredentialSecretName }}"
dnsServers:
- "{{ dnsServers }}"
domain: "{{ domain }}"
kind: "{{ kind }}"
mode: "{{ mode }}"
organizationalUnit: "{{ organizationalUnit }}"
advancedMachineFeatures:
threadsPerCore: {{ threadsPerCore }}
authorizedGaeApplications:
- "{{ authorizedGaeApplications }}"
autoUpgradeEnabled: {{ autoUpgradeEnabled }}
availabilityType: "{{ availabilityType }}"
backupConfiguration:
backupRetentionSettings:
retainedBackups: {{ retainedBackups }}
retentionUnit: "{{ retentionUnit }}"
backupTier: "{{ backupTier }}"
binaryLogEnabled: {{ binaryLogEnabled }}
enabled: {{ enabled }}
kind: "{{ kind }}"
location: "{{ location }}"
pointInTimeRecoveryEnabled: {{ pointInTimeRecoveryEnabled }}
replicationLogArchivingEnabled: {{ replicationLogArchivingEnabled }}
startTime: "{{ startTime }}"
transactionLogRetentionDays: {{ transactionLogRetentionDays }}
transactionalLogStorageState: "{{ transactionalLogStorageState }}"
collation: "{{ collation }}"
connectionPoolConfig:
connectionPoolingEnabled: {{ connectionPoolingEnabled }}
flags:
- name: "{{ name }}"
value: "{{ value }}"
poolerCount: {{ poolerCount }}
connectorEnforcement: "{{ connectorEnforcement }}"
crashSafeReplicationEnabled: {{ crashSafeReplicationEnabled }}
dataApiAccess: "{{ dataApiAccess }}"
dataCacheConfig:
dataCacheEnabled: {{ dataCacheEnabled }}
dataDiskProvisionedIops: "{{ dataDiskProvisionedIops }}"
dataDiskProvisionedThroughput: "{{ dataDiskProvisionedThroughput }}"
dataDiskSizeGb: "{{ dataDiskSizeGb }}"
dataDiskType: "{{ dataDiskType }}"
databaseFlags:
- name: "{{ name }}"
value: "{{ value }}"
databaseReplicationEnabled: {{ databaseReplicationEnabled }}
deletionProtectionEnabled: {{ deletionProtectionEnabled }}
denyMaintenancePeriods:
- endDate: "{{ endDate }}"
startDate: "{{ startDate }}"
time: "{{ time }}"
edition: "{{ edition }}"
enableDataplexIntegration: {{ enableDataplexIntegration }}
enableGoogleMlIntegration: {{ enableGoogleMlIntegration }}
entraidConfig:
applicationId: "{{ applicationId }}"
kind: "{{ kind }}"
tenantId: "{{ tenantId }}"
finalBackupConfig:
enabled: {{ enabled }}
retentionDays: {{ retentionDays }}
insightsConfig:
enhancedQueryInsightsEnabled: {{ enhancedQueryInsightsEnabled }}
queryInsightsEnabled: {{ queryInsightsEnabled }}
queryPlansPerMinute: {{ queryPlansPerMinute }}
queryStringLength: {{ queryStringLength }}
recordApplicationTags: {{ recordApplicationTags }}
recordClientAddress: {{ recordClientAddress }}
ipConfiguration:
allocatedIpRange: "{{ allocatedIpRange }}"
authorizedNetworks:
- expirationTime: "{{ expirationTime }}"
kind: "{{ kind }}"
name: "{{ name }}"
value: "{{ value }}"
customSubjectAlternativeNames:
- "{{ customSubjectAlternativeNames }}"
enablePrivatePathForGoogleCloudServices: {{ enablePrivatePathForGoogleCloudServices }}
ipv4Enabled: {{ ipv4Enabled }}
privateNetwork: "{{ privateNetwork }}"
pscConfig:
allowedConsumerProjects:
- "{{ allowedConsumerProjects }}"
networkAttachmentUri: "{{ networkAttachmentUri }}"
pscAutoConnectionPolicyEnabled: {{ pscAutoConnectionPolicyEnabled }}
pscAutoConnections:
- consumerNetwork: "{{ consumerNetwork }}"
consumerNetworkStatus: "{{ consumerNetworkStatus }}"
consumerProject: "{{ consumerProject }}"
instanceAutoDnsStatus: "{{ instanceAutoDnsStatus }}"
ipAddress: "{{ ipAddress }}"
serviceConnectionPolicy: "{{ serviceConnectionPolicy }}"
serviceConnectionPolicyCreationResult: "{{ serviceConnectionPolicyCreationResult }}"
status: "{{ status }}"
writeEndpointAutoDnsStatus: "{{ writeEndpointAutoDnsStatus }}"
pscAutoDnsEnabled: {{ pscAutoDnsEnabled }}
pscEnabled: {{ pscEnabled }}
pscWriteEndpointDnsEnabled: {{ pscWriteEndpointDnsEnabled }}
requireSsl: {{ requireSsl }}
serverCaMode: "{{ serverCaMode }}"
serverCaPool: "{{ serverCaPool }}"
serverCertificateRotationMode: "{{ serverCertificateRotationMode }}"
sslMode: "{{ sslMode }}"
kind: "{{ kind }}"
locationPreference:
followGaeApplication: "{{ followGaeApplication }}"
kind: "{{ kind }}"
secondaryZone: "{{ secondaryZone }}"
zone: "{{ zone }}"
maintenanceWindow:
day: {{ day }}
hour: {{ hour }}
kind: "{{ kind }}"
updateTrack: "{{ updateTrack }}"
passwordValidationPolicy:
complexity: "{{ complexity }}"
disallowCompromisedCredentials: {{ disallowCompromisedCredentials }}
disallowUsernameSubstring: {{ disallowUsernameSubstring }}
enablePasswordPolicy: {{ enablePasswordPolicy }}
minLength: {{ minLength }}
passwordChangeInterval: "{{ passwordChangeInterval }}"
reuseInterval: {{ reuseInterval }}
performanceCaptureConfig:
cpuUtilizationThresholdPercent: {{ cpuUtilizationThresholdPercent }}
enabled: {{ enabled }}
historyListLengthThresholdCount: {{ historyListLengthThresholdCount }}
memoryUsageThresholdPercent: {{ memoryUsageThresholdPercent }}
probeThreshold: {{ probeThreshold }}
probingIntervalSeconds: {{ probingIntervalSeconds }}
runningThreadsThreshold: {{ runningThreadsThreshold }}
secondsBehindSourceThreshold: {{ secondsBehindSourceThreshold }}
semaphoreWaitThresholdCount: {{ semaphoreWaitThresholdCount }}
transactionDurationThreshold: {{ transactionDurationThreshold }}
transactionKillExcludedUserHosts:
- "{{ transactionKillExcludedUserHosts }}"
transactionKillThresholdSeconds: {{ transactionKillThresholdSeconds }}
transactionKillType: "{{ transactionKillType }}"
transactionLockWaitThresholdCount: {{ transactionLockWaitThresholdCount }}
pricingPlan: "{{ pricingPlan }}"
readPoolAutoScaleConfig:
disableScaleIn: {{ disableScaleIn }}
enabled: {{ enabled }}
maxNodeCount: {{ maxNodeCount }}
minNodeCount: {{ minNodeCount }}
scaleInCooldownSeconds: {{ scaleInCooldownSeconds }}
scaleOutCooldownSeconds: {{ scaleOutCooldownSeconds }}
targetMetrics:
- metric: "{{ metric }}"
targetValue: {{ targetValue }}
replicationLagMaxSeconds: {{ replicationLagMaxSeconds }}
replicationType: "{{ replicationType }}"
retainBackupsOnDelete: {{ retainBackupsOnDelete }}
settingsVersion: "{{ settingsVersion }}"
sqlServerAuditConfig:
bucket: "{{ bucket }}"
kind: "{{ kind }}"
retentionInterval: "{{ retentionInterval }}"
uploadInterval: "{{ uploadInterval }}"
storageAutoResize: {{ storageAutoResize }}
storageAutoResizeLimit: "{{ storageAutoResizeLimit }}"
tier: "{{ tier }}"
timeZone: "{{ timeZone }}"
userLabels: "{{ userLabels }}"
- name: sqlNetworkArchitecture
value: "{{ sqlNetworkArchitecture }}"
valid_values: ['SQL_NETWORK_ARCHITECTURE_UNSPECIFIED', 'NEW_NETWORK_ARCHITECTURE', 'OLD_NETWORK_ARCHITECTURE']
- name: state
value: "{{ state }}"
description: |
The current serving state of the Cloud SQL instance.
valid_values: ['SQL_INSTANCE_STATE_UNSPECIFIED', 'RUNNABLE', 'SUSPENDED', 'PENDING_DELETE', 'PENDING_CREATE', 'MAINTENANCE', 'FAILED', 'ONLINE_MAINTENANCE', 'REPAIRING']
- name: suspensionReason
value:
- "{{ suspensionReason }}"
description: |
If the instance state is SUSPENDED, the reason for the suspension.
- name: switchTransactionLogsToCloudStorageEnabled
value: {{ switchTransactionLogsToCloudStorageEnabled }}
description: |
Input only. Whether Cloud SQL is enabled to switch storing point-in-time recovery log files from a data disk to Cloud Storage.
- name: tags
value: "{{ tags }}"
description: |
Optional. Input only. Immutable. Tag keys and tag values that are bound to this instance. You must represent each item in the map as: `"" : ""`. For example, a single resource can have the following tags: ``` "123/environment": "production", "123/costCenter": "marketing", ``` For more information on tag creation and management, see https://cloud.google.com/resource-manager/docs/tags/tags-overview.
UPDATE examples
- patch
Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
UPDATE google.sqladmin.instances
SET
data__backendType = '{{ backendType }}',
data__connectionName = '{{ connectionName }}',
data__currentDiskSize = '{{ currentDiskSize }}',
data__databaseCenterIntegrationEnabled = {{ databaseCenterIntegrationEnabled }},
data__databaseVersion = '{{ databaseVersion }}',
data__diskEncryptionConfiguration = '{{ diskEncryptionConfiguration }}',
data__diskEncryptionStatus = '{{ diskEncryptionStatus }}',
data__etag = '{{ etag }}',
data__failoverReplica = '{{ failoverReplica }}',
data__gceZone = '{{ gceZone }}',
data__geminiConfig = '{{ geminiConfig }}',
data__includeReplicasForMajorVersionUpgrade = {{ includeReplicasForMajorVersionUpgrade }},
data__instanceType = '{{ instanceType }}',
data__ipAddresses = '{{ ipAddresses }}',
data__ipv6Address = '{{ ipv6Address }}',
data__kind = '{{ kind }}',
data__maintenanceVersion = '{{ maintenanceVersion }}',
data__masterInstanceName = '{{ masterInstanceName }}',
data__maxDiskSize = '{{ maxDiskSize }}',
data__name = '{{ name }}',
data__nodeCount = {{ nodeCount }},
data__onPremisesConfiguration = '{{ onPremisesConfiguration }}',
data__outOfDiskReport = '{{ outOfDiskReport }}',
data__project = '{{ project }}',
data__region = '{{ region }}',
data__replicaConfiguration = '{{ replicaConfiguration }}',
data__replicaNames = '{{ replicaNames }}',
data__replicationCluster = '{{ replicationCluster }}',
data__rootPassword = '{{ rootPassword }}',
data__satisfiesPzs = {{ satisfiesPzs }},
data__scheduledMaintenance = '{{ scheduledMaintenance }}',
data__secondaryGceZone = '{{ secondaryGceZone }}',
data__selfLink = '{{ selfLink }}',
data__serverCaCert = '{{ serverCaCert }}',
data__serviceAccountEmailAddress = '{{ serviceAccountEmailAddress }}',
data__settings = '{{ settings }}',
data__sqlNetworkArchitecture = '{{ sqlNetworkArchitecture }}',
data__state = '{{ state }}',
data__suspensionReason = '{{ suspensionReason }}',
data__switchTransactionLogsToCloudStorageEnabled = {{ switchTransactionLogsToCloudStorageEnabled }},
data__tags = '{{ tags }}'
WHERE
project = '{{ project }}' --required
AND instance = '{{ instance }}' --required
AND reconcilePscNetworking = {{ reconcilePscNetworking}}
AND reconcilePscNetworkingForce = {{ reconcilePscNetworkingForce}}
RETURNING
name,
acquireSsrsLeaseContext,
apiWarning,
backupContext,
endTime,
error,
exportContext,
importContext,
insertTime,
kind,
operationType,
preCheckMajorVersionUpgradeContext,
selfLink,
startTime,
status,
subOperationType,
targetId,
targetLink,
targetProject,
user;
REPLACE examples
- update
Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
REPLACE google.sqladmin.instances
SET
data__backendType = '{{ backendType }}',
data__connectionName = '{{ connectionName }}',
data__currentDiskSize = '{{ currentDiskSize }}',
data__databaseCenterIntegrationEnabled = {{ databaseCenterIntegrationEnabled }},
data__databaseVersion = '{{ databaseVersion }}',
data__diskEncryptionConfiguration = '{{ diskEncryptionConfiguration }}',
data__diskEncryptionStatus = '{{ diskEncryptionStatus }}',
data__etag = '{{ etag }}',
data__failoverReplica = '{{ failoverReplica }}',
data__gceZone = '{{ gceZone }}',
data__geminiConfig = '{{ geminiConfig }}',
data__includeReplicasForMajorVersionUpgrade = {{ includeReplicasForMajorVersionUpgrade }},
data__instanceType = '{{ instanceType }}',
data__ipAddresses = '{{ ipAddresses }}',
data__ipv6Address = '{{ ipv6Address }}',
data__kind = '{{ kind }}',
data__maintenanceVersion = '{{ maintenanceVersion }}',
data__masterInstanceName = '{{ masterInstanceName }}',
data__maxDiskSize = '{{ maxDiskSize }}',
data__name = '{{ name }}',
data__nodeCount = {{ nodeCount }},
data__onPremisesConfiguration = '{{ onPremisesConfiguration }}',
data__outOfDiskReport = '{{ outOfDiskReport }}',
data__project = '{{ project }}',
data__region = '{{ region }}',
data__replicaConfiguration = '{{ replicaConfiguration }}',
data__replicaNames = '{{ replicaNames }}',
data__replicationCluster = '{{ replicationCluster }}',
data__rootPassword = '{{ rootPassword }}',
data__satisfiesPzs = {{ satisfiesPzs }},
data__scheduledMaintenance = '{{ scheduledMaintenance }}',
data__secondaryGceZone = '{{ secondaryGceZone }}',
data__selfLink = '{{ selfLink }}',
data__serverCaCert = '{{ serverCaCert }}',
data__serviceAccountEmailAddress = '{{ serviceAccountEmailAddress }}',
data__settings = '{{ settings }}',
data__sqlNetworkArchitecture = '{{ sqlNetworkArchitecture }}',
data__state = '{{ state }}',
data__suspensionReason = '{{ suspensionReason }}',
data__switchTransactionLogsToCloudStorageEnabled = {{ switchTransactionLogsToCloudStorageEnabled }},
data__tags = '{{ tags }}'
WHERE
project = '{{ project }}' --required
AND instance = '{{ instance }}' --required
RETURNING
name,
acquireSsrsLeaseContext,
apiWarning,
backupContext,
endTime,
error,
exportContext,
importContext,
insertTime,
kind,
operationType,
preCheckMajorVersionUpgradeContext,
selfLink,
startTime,
status,
subOperationType,
targetId,
targetLink,
targetProject,
user;
DELETE examples
- delete
Deletes a Cloud SQL instance.
DELETE FROM google.sqladmin.instances
WHERE project = '{{ project }}' --required
AND instance = '{{ instance }}' --required
AND enableFinalBackup = '{{ enableFinalBackup }}'
AND finalBackupDescription = '{{ finalBackupDescription }}'
AND finalBackupExpiryTime = '{{ finalBackupExpiryTime }}'
AND finalBackupTtlDays = '{{ finalBackupTtlDays }}'
;
Lifecycle Methods
- acquire_ssrs_lease
- clone
- demote
- demote_master
- execute_sql
- export
- failover
- import
- list_entra_id_certificates
- list_server_certificates
- perform_disk_shrink
- point_in_time_restore
- pre_check_major_version_upgrade
- promote_replica
- reencrypt
- release_ssrs_lease
- reschedule_maintenance
- reset_replica_size
- reset_ssl_config
- restart
- restore_backup
- rotate_entra_id_certificate
- rotate_server_ca
- rotate_server_certificate
- start_external_sync
- start_replica
- stop_replica
- switchover
- truncate_log
- verify_external_sync_settings
Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
EXEC google.sqladmin.instances.acquire_ssrs_lease
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"acquireSsrsLeaseContext": "{{ acquireSsrsLeaseContext }}"
}'
;
Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
EXEC google.sqladmin.instances.clone
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"cloneContext": "{{ cloneContext }}"
}'
;
Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
EXEC google.sqladmin.instances.demote
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"demoteContext": "{{ demoteContext }}"
}'
;
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
EXEC google.sqladmin.instances.demote_master
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"demoteMasterContext": "{{ demoteMasterContext }}"
}'
;
Execute SQL statements.
EXEC google.sqladmin.instances.execute_sql
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"application": "{{ application }}",
"autoIamAuthn": {{ autoIamAuthn }},
"database": "{{ database }}",
"partialResultMode": "{{ partialResultMode }}",
"passwordSecretVersion": "{{ passwordSecretVersion }}",
"rowLimit": "{{ rowLimit }}",
"sqlStatement": "{{ sqlStatement }}",
"user": "{{ user }}"
}'
;
Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
EXEC google.sqladmin.instances.export
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"exportContext": "{{ exportContext }}"
}'
;
Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.
EXEC google.sqladmin.instances.failover
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"failoverContext": "{{ failoverContext }}"
}'
;
Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
EXEC google.sqladmin.instances.import
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"importContext": "{{ importContext }}"
}'
;
Lists all versions of EntraID certificates for the specified instance. There can be up to three sets of certificates listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out.
EXEC google.sqladmin.instances.list_entra_id_certificates
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
Lists all versions of server certificates and certificate authorities (CAs) for the specified instance. There can be up to three sets of certs listed: the certificate that is currently in use, a future that has been added but not yet used to sign a certificate, and a certificate that has been rotated out. For instances not using Certificate Authority Service (CAS) server CA, use ListServerCas instead.
EXEC google.sqladmin.instances.list_server_certificates
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
Perform Disk Shrink on primary instance.
EXEC google.sqladmin.instances.perform_disk_shrink
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"targetSizeGb": "{{ targetSizeGb }}"
}'
;
Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery.
EXEC google.sqladmin.instances.point_in_time_restore
@projectsId='{{ projectsId }}' --required
@@json=
'{
"allocatedIpRange": "{{ allocatedIpRange }}",
"datasource": "{{ datasource }}",
"pointInTime": "{{ pointInTime }}",
"preferredSecondaryZone": "{{ preferredSecondaryZone }}",
"preferredZone": "{{ preferredZone }}",
"privateNetwork": "{{ privateNetwork }}",
"region": "{{ region }}",
"targetInstance": "{{ targetInstance }}",
"targetInstanceClearSettingsFieldNames": "{{ targetInstanceClearSettingsFieldNames }}",
"targetInstanceSettings": "{{ targetInstanceSettings }}"
}'
;
Execute MVU Pre-checks
EXEC google.sqladmin.instances.pre_check_major_version_upgrade
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"preCheckMajorVersionUpgradeContext": "{{ preCheckMajorVersionUpgradeContext }}"
}'
;
Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.
EXEC google.sqladmin.instances.promote_replica
@project='{{ project }}' --required,
@instance='{{ instance }}' --required,
@failover={{ failover }}
;
Reencrypt CMEK instance with latest key version.
EXEC google.sqladmin.instances.reencrypt
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"backupReencryptionConfig": "{{ backupReencryptionConfig }}"
}'
;
Release a lease for the setup of SQL Server Reporting Services (SSRS).
EXEC google.sqladmin.instances.release_ssrs_lease
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
Reschedules the maintenance on the given instance.
EXEC google.sqladmin.instances.reschedule_maintenance
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"reschedule": "{{ reschedule }}"
}'
;
Reset Replica Size to primary instance disk size.
EXEC google.sqladmin.instances.reset_replica_size
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
Deletes all client certificates and generates a new server SSL certificate for the instance.
EXEC google.sqladmin.instances.reset_ssl_config
@project='{{ project }}' --required,
@instance='{{ instance }}' --required,
@mode='{{ mode }}'
;
Restarts a Cloud SQL instance.
EXEC google.sqladmin.instances.restart
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
EXEC google.sqladmin.instances.restore_backup
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"backup": "{{ backup }}",
"backupdrBackup": "{{ backupdrBackup }}",
"restoreBackupContext": "{{ restoreBackupContext }}",
"restoreInstanceClearOverridesFieldNames": "{{ restoreInstanceClearOverridesFieldNames }}",
"restoreInstanceSettings": "{{ restoreInstanceSettings }}"
}'
;
Rotates the server certificate version to one previously added with the addEntraIdCertificate method.
EXEC google.sqladmin.instances.rotate_entra_id_certificate
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"rotateEntraIdCertificateContext": "{{ rotateEntraIdCertificateContext }}"
}'
;
Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, use RotateServerCertificate to rotate the server certificate.
EXEC google.sqladmin.instances.rotate_server_ca
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"rotateServerCaContext": "{{ rotateServerCaContext }}"
}'
;
Rotates the server certificate version to one previously added with the addServerCertificate method. For instances not using Certificate Authority Service (CAS) server CA, use RotateServerCa instead.
EXEC google.sqladmin.instances.rotate_server_certificate
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"rotateServerCertificateContext": "{{ rotateServerCertificateContext }}"
}'
;
Start External primary instance migration.
EXEC google.sqladmin.instances.start_external_sync
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"migrationType": "{{ migrationType }}",
"mysqlSyncConfig": "{{ mysqlSyncConfig }}",
"replicaOverwriteEnabled": {{ replicaOverwriteEnabled }},
"skipVerification": {{ skipVerification }},
"syncMode": "{{ syncMode }}",
"syncParallelLevel": "{{ syncParallelLevel }}"
}'
;
Starts the replication in the read replica instance.
EXEC google.sqladmin.instances.start_replica
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
Stops the replication in the read replica instance.
EXEC google.sqladmin.instances.stop_replica
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
Switches over from the primary instance to the DR replica instance.
EXEC google.sqladmin.instances.switchover
@project='{{ project }}' --required,
@instance='{{ instance }}' --required,
@dbTimeout='{{ dbTimeout }}'
;
Truncate MySQL general and slow query log tables MySQL only.
EXEC google.sqladmin.instances.truncate_log
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"truncateLogContext": "{{ truncateLogContext }}"
}'
;
Verify External primary instance external sync settings.
EXEC google.sqladmin.instances.verify_external_sync_settings
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"migrationType": "{{ migrationType }}",
"mysqlSyncConfig": "{{ mysqlSyncConfig }}",
"selectedObjects": "{{ selectedObjects }}",
"syncMode": "{{ syncMode }}",
"syncParallelLevel": "{{ syncParallelLevel }}",
"verifyConnectionOnly": {{ verifyConnectionOnly }},
"verifyReplicationOnly": {{ verifyReplicationOnly }}
}'
;