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. |
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 |
|---|---|---|
code | string | Code to uniquely identify the warning type. (SQL_API_WARNING_CODE_UNSPECIFIED, REGION_UNREACHABLE, MAX_RESULTS_EXCEEDS_LIMIT, COMPROMISED_CREDENTIALS, INTERNAL_STATE_FAILURE) |
message | string | The warning message. |
region | string | The region name for REGION_UNREACHABLE warning. |
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 | reconcilePscNetworkingForce, reconcilePscNetworking | 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 | finalBackupExpiryTime, enableFinalBackup, finalBackupDescription, finalBackupTtlDays | Deletes a Cloud SQL instance. |
start_external_sync | exec | project, instance | Start External primary instance migration. | |
verify_external_sync_settings | exec | project, instance | Verify External primary instance external sync settings. | |
perform_disk_shrink | exec | project, instance | Perform Disk Shrink on primary instance. | |
reset_replica_size | exec | project, instance | Reset Replica Size to primary instance disk size. | |
reschedule_maintenance | exec | project, instance | Reschedules the maintenance on the given instance. | |
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. | |
execute_sql | exec | project, instance | Execute SQL statements. | |
truncate_log | exec | project, instance | Truncate MySQL general and slow query log tables MySQL only. | |
rotate_entra_id_certificate | exec | project, instance | Rotates the server certificate version to one previously added with the addEntraIdCertificate method. | |
start_replica | exec | project, instance | Starts the replication in the read replica instance. | |
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. |
pre_check_major_version_upgrade | exec | project, instance | Execute MVU Pre-checks | |
demote_master | exec | project, instance | Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. | |
switchover | exec | project, instance | dbTimeout | Switches over from the primary instance to the DR replica instance. |
restart | exec | project, instance | Restarts a Cloud SQL instance. | |
stop_replica | exec | project, instance | Stops the replication in the read replica instance. | |
reset_ssl_config | exec | project, instance | mode | Deletes all client certificates and generates a new server SSL certificate for the instance. |
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. | |
restore_backup | exec | project, instance | Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart. | |
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. | |
acquire_ssrs_lease | exec | project, instance | Acquire a lease for the setup of SQL Server Reporting Services (SSRS). | |
demote | exec | project, instance | Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server. | |
release_ssrs_lease | exec | project, instance | Release a lease for the setup of SQL Server Reporting Services (SSRS). | |
reencrypt | exec | project, instance | Reencrypt CMEK instance with latest key version. | |
import | exec | project, instance | Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. | |
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. | |
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. | |
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. | |
export | exec | project, instance | Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. | |
point_in_time_restore | exec | projectsId | Point in time restore for an instance managed by Google Cloud Backup and Disaster Recovery. |
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,
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
code,
message,
region
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__satisfiesPzs,
data__currentDiskSize,
data__onPremisesConfiguration,
data__scheduledMaintenance,
data__diskEncryptionStatus,
data__serverCaCert,
data__failoverReplica,
data__serviceAccountEmailAddress,
data__project,
data__backendType,
data__includeReplicasForMajorVersionUpgrade,
data__state,
data__masterInstanceName,
data__replicationCluster,
data__replicaConfiguration,
data__rootPassword,
data__sqlNetworkArchitecture,
data__diskEncryptionConfiguration,
data__maxDiskSize,
data__secondaryGceZone,
data__databaseVersion,
data__ipv6Address,
data__tags,
data__maintenanceVersion,
data__etag,
data__nodeCount,
data__instanceType,
data__name,
data__selfLink,
data__kind,
data__connectionName,
data__outOfDiskReport,
data__gceZone,
data__region,
data__suspensionReason,
data__settings,
data__geminiConfig,
data__switchTransactionLogsToCloudStorageEnabled,
data__replicaNames,
data__ipAddresses,
project
)
SELECT
{{ satisfiesPzs }},
'{{ currentDiskSize }}',
'{{ onPremisesConfiguration }}',
'{{ scheduledMaintenance }}',
'{{ diskEncryptionStatus }}',
'{{ serverCaCert }}',
'{{ failoverReplica }}',
'{{ serviceAccountEmailAddress }}',
'{{ project }}',
'{{ backendType }}',
{{ includeReplicasForMajorVersionUpgrade }},
'{{ state }}',
'{{ masterInstanceName }}',
'{{ replicationCluster }}',
'{{ replicaConfiguration }}',
'{{ rootPassword }}',
'{{ sqlNetworkArchitecture }}',
'{{ diskEncryptionConfiguration }}',
'{{ maxDiskSize }}',
'{{ secondaryGceZone }}',
'{{ databaseVersion }}',
'{{ ipv6Address }}',
'{{ tags }}',
'{{ maintenanceVersion }}',
'{{ etag }}',
{{ nodeCount }},
'{{ instanceType }}',
'{{ name }}',
'{{ selfLink }}',
'{{ kind }}',
'{{ connectionName }}',
'{{ outOfDiskReport }}',
'{{ gceZone }}',
'{{ region }}',
'{{ suspensionReason }}',
'{{ settings }}',
'{{ geminiConfig }}',
{{ switchTransactionLogsToCloudStorageEnabled }},
'{{ replicaNames }}',
'{{ ipAddresses }}',
'{{ 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: satisfiesPzs
value: {{ satisfiesPzs }}
description: |
This status indicates whether the instance satisfies PZS. The status is reserved for future use.
- 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: onPremisesConfiguration
description: |
Configuration specific to on-premises instances.
value:
sourceInstance:
region: "{{ region }}"
project: "{{ project }}"
name: "{{ name }}"
clientKey: "{{ clientKey }}"
clientCertificate: "{{ clientCertificate }}"
sslOption: "{{ sslOption }}"
selectedObjects:
- database: "{{ database }}"
kind: "{{ kind }}"
caCertificate: "{{ caCertificate }}"
dumpFilePath: "{{ dumpFilePath }}"
hostPort: "{{ hostPort }}"
password: "{{ password }}"
username: "{{ username }}"
- name: scheduledMaintenance
description: |
The start time of any upcoming scheduled maintenance for this instance.
value:
startTime: "{{ startTime }}"
canReschedule: {{ canReschedule }}
scheduleDeadlineTime: "{{ scheduleDeadlineTime }}"
canDefer: {{ canDefer }}
- name: diskEncryptionStatus
description: |
Disk encryption status specific to an instance.
value:
kind: "{{ kind }}"
kmsKeyVersionName: "{{ kmsKeyVersionName }}"
- name: serverCaCert
description: |
SSL configuration.
value:
commonName: "{{ commonName }}"
expirationTime: "{{ expirationTime }}"
instance: "{{ instance }}"
sha1Fingerprint: "{{ sha1Fingerprint }}"
kind: "{{ kind }}"
certSerialNumber: "{{ certSerialNumber }}"
cert: "{{ cert }}"
createTime: "{{ createTime }}"
selfLink: "{{ selfLink }}"
- name: failoverReplica
description: |
The name and status of the failover replica.
value:
name: "{{ name }}"
available: {{ available }}
- name: serviceAccountEmailAddress
value: "{{ serviceAccountEmailAddress }}"
description: |
The service account email address assigned to the instance.This property is read-only.
- 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: 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: 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: 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: masterInstanceName
value: "{{ masterInstanceName }}"
description: |
The name of the instance which will act as primary in the replication setup.
- 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:
failoverDrReplicaName: "{{ failoverDrReplicaName }}"
drReplica: {{ drReplica }}
psaWriteEndpoint: "{{ psaWriteEndpoint }}"
- name: replicaConfiguration
description: |
Configuration specific to failover replicas and read replicas.
value:
cascadableReplica: {{ cascadableReplica }}
kind: "{{ kind }}"
mysqlReplicaConfiguration:
connectRetryInterval: {{ connectRetryInterval }}
username: "{{ username }}"
sslCipher: "{{ sslCipher }}"
password: "{{ password }}"
dumpFilePath: "{{ dumpFilePath }}"
verifyServerCertificate: {{ verifyServerCertificate }}
caCertificate: "{{ caCertificate }}"
kind: "{{ kind }}"
masterHeartbeatPeriod: "{{ masterHeartbeatPeriod }}"
clientCertificate: "{{ clientCertificate }}"
clientKey: "{{ clientKey }}"
failoverTarget: {{ failoverTarget }}
- 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: sqlNetworkArchitecture
value: "{{ sqlNetworkArchitecture }}"
valid_values: ['SQL_NETWORK_ARCHITECTURE_UNSPECIFIED', 'NEW_NETWORK_ARCHITECTURE', 'OLD_NETWORK_ARCHITECTURE']
- name: diskEncryptionConfiguration
description: |
Disk encryption configuration specific to an instance.
value:
kmsKeyName: "{{ kmsKeyName }}"
kind: "{{ kind }}"
- name: maxDiskSize
value: "{{ maxDiskSize }}"
description: |
The maximum disk size of the instance in bytes.
- 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: 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: ipv6Address
value: "{{ ipv6Address }}"
description: |
The IPv6 address assigned to the instance. (Deprecated) This property was applicable only to First Generation instances.
- 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.
- name: maintenanceVersion
value: "{{ maintenanceVersion }}"
description: |
The current software version on the instance.
- 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: nodeCount
value: {{ nodeCount }}
description: |
The number of read pool nodes in a read pool.
- 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: name
value: "{{ name }}"
description: |
Name of the Cloud SQL instance. This does not include the project ID.
- name: selfLink
value: "{{ selfLink }}"
description: |
The URI of this resource.
- name: kind
value: "{{ kind }}"
description: |
This is always `sql#instance`.
- name: connectionName
value: "{{ connectionName }}"
description: |
Connection name of the Cloud SQL instance used in connection strings.
- 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:
sqlOutOfDiskState: "{{ sqlOutOfDiskState }}"
sqlMinRecommendedIncreaseSizeGb: {{ sqlMinRecommendedIncreaseSizeGb }}
- 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: 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: suspensionReason
value:
- "{{ suspensionReason }}"
description: |
If the instance state is SUSPENDED, the reason for the suspension.
- name: settings
description: |
The user settings.
value:
tier: "{{ tier }}"
replicationType: "{{ replicationType }}"
autoUpgradeEnabled: {{ autoUpgradeEnabled }}
databaseFlags:
- value: "{{ value }}"
name: "{{ name }}"
crashSafeReplicationEnabled: {{ crashSafeReplicationEnabled }}
availabilityType: "{{ availabilityType }}"
connectionPoolConfig:
connectionPoolingEnabled: {{ connectionPoolingEnabled }}
flags:
- value: "{{ value }}"
name: "{{ name }}"
poolerCount: {{ poolerCount }}
authorizedGaeApplications:
- "{{ authorizedGaeApplications }}"
entraidConfig:
kind: "{{ kind }}"
tenantId: "{{ tenantId }}"
applicationId: "{{ applicationId }}"
collation: "{{ collation }}"
replicationLagMaxSeconds: {{ replicationLagMaxSeconds }}
userLabels: "{{ userLabels }}"
ipConfiguration:
allocatedIpRange: "{{ allocatedIpRange }}"
serverCaMode: "{{ serverCaMode }}"
ipv4Enabled: {{ ipv4Enabled }}
enablePrivatePathForGoogleCloudServices: {{ enablePrivatePathForGoogleCloudServices }}
serverCaPool: "{{ serverCaPool }}"
pscConfig:
pscAutoConnections:
- status: "{{ status }}"
consumerNetworkStatus: "{{ consumerNetworkStatus }}"
consumerNetwork: "{{ consumerNetwork }}"
consumerProject: "{{ consumerProject }}"
serviceConnectionPolicyCreationResult: "{{ serviceConnectionPolicyCreationResult }}"
ipAddress: "{{ ipAddress }}"
serviceConnectionPolicy: "{{ serviceConnectionPolicy }}"
instanceAutoDnsStatus: "{{ instanceAutoDnsStatus }}"
writeEndpointAutoDnsStatus: "{{ writeEndpointAutoDnsStatus }}"
pscAutoDnsEnabled: {{ pscAutoDnsEnabled }}
pscWriteEndpointDnsEnabled: {{ pscWriteEndpointDnsEnabled }}
pscEnabled: {{ pscEnabled }}
networkAttachmentUri: "{{ networkAttachmentUri }}"
pscAutoConnectionPolicyEnabled: {{ pscAutoConnectionPolicyEnabled }}
allowedConsumerProjects:
- "{{ allowedConsumerProjects }}"
requireSsl: {{ requireSsl }}
authorizedNetworks:
- value: "{{ value }}"
expirationTime: "{{ expirationTime }}"
kind: "{{ kind }}"
name: "{{ name }}"
sslMode: "{{ sslMode }}"
customSubjectAlternativeNames:
- "{{ customSubjectAlternativeNames }}"
serverCertificateRotationMode: "{{ serverCertificateRotationMode }}"
privateNetwork: "{{ privateNetwork }}"
readPoolAutoScaleConfig:
enabled: {{ enabled }}
maxNodeCount: {{ maxNodeCount }}
targetMetrics:
- metric: "{{ metric }}"
targetValue: {{ targetValue }}
minNodeCount: {{ minNodeCount }}
scaleOutCooldownSeconds: {{ scaleOutCooldownSeconds }}
scaleInCooldownSeconds: {{ scaleInCooldownSeconds }}
disableScaleIn: {{ disableScaleIn }}
storageAutoResize: {{ storageAutoResize }}
sqlServerAuditConfig:
uploadInterval: "{{ uploadInterval }}"
kind: "{{ kind }}"
bucket: "{{ bucket }}"
retentionInterval: "{{ retentionInterval }}"
performanceCaptureConfig:
probeThreshold: {{ probeThreshold }}
transactionKillExcludedUserHosts:
- "{{ transactionKillExcludedUserHosts }}"
transactionDurationThreshold: {{ transactionDurationThreshold }}
transactionKillThresholdSeconds: {{ transactionKillThresholdSeconds }}
secondsBehindSourceThreshold: {{ secondsBehindSourceThreshold }}
historyListLengthThresholdCount: {{ historyListLengthThresholdCount }}
runningThreadsThreshold: {{ runningThreadsThreshold }}
memoryUsageThresholdPercent: {{ memoryUsageThresholdPercent }}
transactionKillType: "{{ transactionKillType }}"
cpuUtilizationThresholdPercent: {{ cpuUtilizationThresholdPercent }}
enabled: {{ enabled }}
probingIntervalSeconds: {{ probingIntervalSeconds }}
semaphoreWaitThresholdCount: {{ semaphoreWaitThresholdCount }}
transactionLockWaitThresholdCount: {{ transactionLockWaitThresholdCount }}
activeDirectoryConfig:
domain: "{{ domain }}"
adminCredentialSecretName: "{{ adminCredentialSecretName }}"
mode: "{{ mode }}"
organizationalUnit: "{{ organizationalUnit }}"
kind: "{{ kind }}"
dnsServers:
- "{{ dnsServers }}"
denyMaintenancePeriods:
- startDate: "{{ startDate }}"
endDate: "{{ endDate }}"
time: "{{ time }}"
databaseReplicationEnabled: {{ databaseReplicationEnabled }}
dataDiskProvisionedIops: "{{ dataDiskProvisionedIops }}"
acceleratedReplicaMode: {{ acceleratedReplicaMode }}
maintenanceWindow:
kind: "{{ kind }}"
updateTrack: "{{ updateTrack }}"
hour: {{ hour }}
day: {{ day }}
backupConfiguration:
transactionLogRetentionDays: {{ transactionLogRetentionDays }}
enabled: {{ enabled }}
location: "{{ location }}"
transactionalLogStorageState: "{{ transactionalLogStorageState }}"
binaryLogEnabled: {{ binaryLogEnabled }}
startTime: "{{ startTime }}"
replicationLogArchivingEnabled: {{ replicationLogArchivingEnabled }}
backupRetentionSettings:
retentionUnit: "{{ retentionUnit }}"
retainedBackups: {{ retainedBackups }}
backupTier: "{{ backupTier }}"
kind: "{{ kind }}"
pointInTimeRecoveryEnabled: {{ pointInTimeRecoveryEnabled }}
kind: "{{ kind }}"
activationPolicy: "{{ activationPolicy }}"
dataDiskProvisionedThroughput: "{{ dataDiskProvisionedThroughput }}"
settingsVersion: "{{ settingsVersion }}"
dataDiskType: "{{ dataDiskType }}"
retainBackupsOnDelete: {{ retainBackupsOnDelete }}
timeZone: "{{ timeZone }}"
insightsConfig:
enhancedQueryInsightsEnabled: {{ enhancedQueryInsightsEnabled }}
recordClientAddress: {{ recordClientAddress }}
queryPlansPerMinute: {{ queryPlansPerMinute }}
queryInsightsEnabled: {{ queryInsightsEnabled }}
recordApplicationTags: {{ recordApplicationTags }}
queryStringLength: {{ queryStringLength }}
deletionProtectionEnabled: {{ deletionProtectionEnabled }}
dataDiskSizeGb: "{{ dataDiskSizeGb }}"
enableGoogleMlIntegration: {{ enableGoogleMlIntegration }}
passwordValidationPolicy:
passwordChangeInterval: "{{ passwordChangeInterval }}"
enablePasswordPolicy: {{ enablePasswordPolicy }}
reuseInterval: {{ reuseInterval }}
disallowUsernameSubstring: {{ disallowUsernameSubstring }}
minLength: {{ minLength }}
disallowCompromisedCredentials: {{ disallowCompromisedCredentials }}
complexity: "{{ complexity }}"
storageAutoResizeLimit: "{{ storageAutoResizeLimit }}"
finalBackupConfig:
enabled: {{ enabled }}
retentionDays: {{ retentionDays }}
connectorEnforcement: "{{ connectorEnforcement }}"
dataApiAccess: "{{ dataApiAccess }}"
edition: "{{ edition }}"
dataCacheConfig:
dataCacheEnabled: {{ dataCacheEnabled }}
advancedMachineFeatures:
threadsPerCore: {{ threadsPerCore }}
locationPreference:
secondaryZone: "{{ secondaryZone }}"
followGaeApplication: "{{ followGaeApplication }}"
kind: "{{ kind }}"
zone: "{{ zone }}"
enableDataplexIntegration: {{ enableDataplexIntegration }}
pricingPlan: "{{ pricingPlan }}"
- name: geminiConfig
description: |
Gemini instance configuration.
value:
oomSessionCancelEnabled: {{ oomSessionCancelEnabled }}
activeQueryEnabled: {{ activeQueryEnabled }}
entitled: {{ entitled }}
indexAdvisorEnabled: {{ indexAdvisorEnabled }}
flagRecommenderEnabled: {{ flagRecommenderEnabled }}
googleVacuumMgmtEnabled: {{ googleVacuumMgmtEnabled }}
- 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: replicaNames
value:
- "{{ replicaNames }}"
description: |
The replicas of the instance.
- name: ipAddresses
description: |
The assigned IP addresses for the instance.
value:
- type: "{{ type }}"
ipAddress: "{{ ipAddress }}"
timeToRetire: "{{ timeToRetire }}"
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__satisfiesPzs = {{ satisfiesPzs }},
data__currentDiskSize = '{{ currentDiskSize }}',
data__onPremisesConfiguration = '{{ onPremisesConfiguration }}',
data__scheduledMaintenance = '{{ scheduledMaintenance }}',
data__diskEncryptionStatus = '{{ diskEncryptionStatus }}',
data__serverCaCert = '{{ serverCaCert }}',
data__failoverReplica = '{{ failoverReplica }}',
data__serviceAccountEmailAddress = '{{ serviceAccountEmailAddress }}',
data__project = '{{ project }}',
data__backendType = '{{ backendType }}',
data__includeReplicasForMajorVersionUpgrade = {{ includeReplicasForMajorVersionUpgrade }},
data__state = '{{ state }}',
data__masterInstanceName = '{{ masterInstanceName }}',
data__replicationCluster = '{{ replicationCluster }}',
data__replicaConfiguration = '{{ replicaConfiguration }}',
data__rootPassword = '{{ rootPassword }}',
data__sqlNetworkArchitecture = '{{ sqlNetworkArchitecture }}',
data__diskEncryptionConfiguration = '{{ diskEncryptionConfiguration }}',
data__maxDiskSize = '{{ maxDiskSize }}',
data__secondaryGceZone = '{{ secondaryGceZone }}',
data__databaseVersion = '{{ databaseVersion }}',
data__ipv6Address = '{{ ipv6Address }}',
data__tags = '{{ tags }}',
data__maintenanceVersion = '{{ maintenanceVersion }}',
data__etag = '{{ etag }}',
data__nodeCount = {{ nodeCount }},
data__instanceType = '{{ instanceType }}',
data__name = '{{ name }}',
data__selfLink = '{{ selfLink }}',
data__kind = '{{ kind }}',
data__connectionName = '{{ connectionName }}',
data__outOfDiskReport = '{{ outOfDiskReport }}',
data__gceZone = '{{ gceZone }}',
data__region = '{{ region }}',
data__suspensionReason = '{{ suspensionReason }}',
data__settings = '{{ settings }}',
data__geminiConfig = '{{ geminiConfig }}',
data__switchTransactionLogsToCloudStorageEnabled = {{ switchTransactionLogsToCloudStorageEnabled }},
data__replicaNames = '{{ replicaNames }}',
data__ipAddresses = '{{ ipAddresses }}'
WHERE
project = '{{ project }}' --required
AND instance = '{{ instance }}' --required
AND reconcilePscNetworkingForce = {{ reconcilePscNetworkingForce}}
AND reconcilePscNetworking = {{ reconcilePscNetworking}}
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__satisfiesPzs = {{ satisfiesPzs }},
data__currentDiskSize = '{{ currentDiskSize }}',
data__onPremisesConfiguration = '{{ onPremisesConfiguration }}',
data__scheduledMaintenance = '{{ scheduledMaintenance }}',
data__diskEncryptionStatus = '{{ diskEncryptionStatus }}',
data__serverCaCert = '{{ serverCaCert }}',
data__failoverReplica = '{{ failoverReplica }}',
data__serviceAccountEmailAddress = '{{ serviceAccountEmailAddress }}',
data__project = '{{ project }}',
data__backendType = '{{ backendType }}',
data__includeReplicasForMajorVersionUpgrade = {{ includeReplicasForMajorVersionUpgrade }},
data__state = '{{ state }}',
data__masterInstanceName = '{{ masterInstanceName }}',
data__replicationCluster = '{{ replicationCluster }}',
data__replicaConfiguration = '{{ replicaConfiguration }}',
data__rootPassword = '{{ rootPassword }}',
data__sqlNetworkArchitecture = '{{ sqlNetworkArchitecture }}',
data__diskEncryptionConfiguration = '{{ diskEncryptionConfiguration }}',
data__maxDiskSize = '{{ maxDiskSize }}',
data__secondaryGceZone = '{{ secondaryGceZone }}',
data__databaseVersion = '{{ databaseVersion }}',
data__ipv6Address = '{{ ipv6Address }}',
data__tags = '{{ tags }}',
data__maintenanceVersion = '{{ maintenanceVersion }}',
data__etag = '{{ etag }}',
data__nodeCount = {{ nodeCount }},
data__instanceType = '{{ instanceType }}',
data__name = '{{ name }}',
data__selfLink = '{{ selfLink }}',
data__kind = '{{ kind }}',
data__connectionName = '{{ connectionName }}',
data__outOfDiskReport = '{{ outOfDiskReport }}',
data__gceZone = '{{ gceZone }}',
data__region = '{{ region }}',
data__suspensionReason = '{{ suspensionReason }}',
data__settings = '{{ settings }}',
data__geminiConfig = '{{ geminiConfig }}',
data__switchTransactionLogsToCloudStorageEnabled = {{ switchTransactionLogsToCloudStorageEnabled }},
data__replicaNames = '{{ replicaNames }}',
data__ipAddresses = '{{ ipAddresses }}'
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 finalBackupExpiryTime = '{{ finalBackupExpiryTime }}'
AND enableFinalBackup = '{{ enableFinalBackup }}'
AND finalBackupDescription = '{{ finalBackupDescription }}'
AND finalBackupTtlDays = '{{ finalBackupTtlDays }}'
;
Lifecycle Methods
- start_external_sync
- verify_external_sync_settings
- perform_disk_shrink
- reset_replica_size
- reschedule_maintenance
- clone
- execute_sql
- truncate_log
- rotate_entra_id_certificate
- start_replica
- promote_replica
- pre_check_major_version_upgrade
- demote_master
- switchover
- restart
- stop_replica
- reset_ssl_config
- rotate_server_ca
- restore_backup
- failover
- acquire_ssrs_lease
- demote
- release_ssrs_lease
- reencrypt
- import
- list_server_certificates
- list_entra_id_certificates
- rotate_server_certificate
- export
- point_in_time_restore
Start External primary instance migration.
EXEC google.sqladmin.instances.start_external_sync
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"mysqlSyncConfig": "{{ mysqlSyncConfig }}",
"migrationType": "{{ migrationType }}",
"syncParallelLevel": "{{ syncParallelLevel }}",
"skipVerification": {{ skipVerification }},
"replicaOverwriteEnabled": {{ replicaOverwriteEnabled }},
"syncMode": "{{ syncMode }}"
}'
;
Verify External primary instance external sync settings.
EXEC google.sqladmin.instances.verify_external_sync_settings
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"verifyConnectionOnly": {{ verifyConnectionOnly }},
"selectedObjects": "{{ selectedObjects }}",
"mysqlSyncConfig": "{{ mysqlSyncConfig }}",
"migrationType": "{{ migrationType }}",
"syncParallelLevel": "{{ syncParallelLevel }}",
"syncMode": "{{ syncMode }}",
"verifyReplicationOnly": {{ verifyReplicationOnly }}
}'
;
Perform Disk Shrink on primary instance.
EXEC google.sqladmin.instances.perform_disk_shrink
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"targetSizeGb": "{{ targetSizeGb }}"
}'
;
Reset Replica Size to primary instance disk size.
EXEC google.sqladmin.instances.reset_replica_size
@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 }}"
}'
;
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 }}"
}'
;
Execute SQL statements.
EXEC google.sqladmin.instances.execute_sql
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"application": "{{ application }}",
"sqlStatement": "{{ sqlStatement }}",
"passwordSecretVersion": "{{ passwordSecretVersion }}",
"user": "{{ user }}",
"database": "{{ database }}",
"rowLimit": "{{ rowLimit }}",
"autoIamAuthn": {{ autoIamAuthn }},
"partialResultMode": "{{ partialResultMode }}"
}'
;
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 }}"
}'
;
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 }}"
}'
;
Starts the replication in the read replica instance.
EXEC google.sqladmin.instances.start_replica
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
;
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 }}
;
Execute MVU Pre-checks
EXEC google.sqladmin.instances.pre_check_major_version_upgrade
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"preCheckMajorVersionUpgradeContext": "{{ preCheckMajorVersionUpgradeContext }}"
}'
;
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 }}"
}'
;
Switches over from the primary instance to the DR replica instance.
EXEC google.sqladmin.instances.switchover
@project='{{ project }}' --required,
@instance='{{ instance }}' --required,
@dbTimeout='{{ dbTimeout }}'
;
Restarts a Cloud SQL instance.
EXEC google.sqladmin.instances.restart
@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
;
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 }}'
;
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 }}"
}'
;
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 }}",
"restoreBackupContext": "{{ restoreBackupContext }}",
"backupdrBackup": "{{ backupdrBackup }}",
"restoreInstanceSettings": "{{ restoreInstanceSettings }}",
"restoreInstanceClearOverridesFieldNames": "{{ restoreInstanceClearOverridesFieldNames }}"
}'
;
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 }}"
}'
;
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 }}"
}'
;
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 }}"
}'
;
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
;
Reencrypt CMEK instance with latest key version.
EXEC google.sqladmin.instances.reencrypt
@project='{{ project }}' --required,
@instance='{{ instance }}' --required
@@json=
'{
"backupReencryptionConfig": "{{ backupReencryptionConfig }}"
}'
;
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 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
;
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
;
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 }}"
}'
;
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 }}"
}'
;
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=
'{
"region": "{{ region }}",
"allocatedIpRange": "{{ allocatedIpRange }}",
"datasource": "{{ datasource }}",
"preferredSecondaryZone": "{{ preferredSecondaryZone }}",
"targetInstanceClearSettingsFieldNames": "{{ targetInstanceClearSettingsFieldNames }}",
"targetInstanceSettings": "{{ targetInstanceSettings }}",
"pointInTime": "{{ pointInTime }}",
"privateNetwork": "{{ privateNetwork }}",
"preferredZone": "{{ preferredZone }}",
"targetInstance": "{{ targetInstance }}"
}'
;