instances

GET /v1/projects/{project}/instances/{instance}

Changed on

Retrieves a resource containing information about a Cloud SQL instance.

Request

  • Base URL
    https://sqladmin.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/sqlservice.admin
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/sqlservice.admin

Path parameters

project, string required

Required. Project ID of the project that contains the instance.

instance, string required

Required. Database instance ID. This does not include the project ID.

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

location, string

Optional. Region of the Cloud SQL instance.

Response

Successful response

DatabaseInstance required

A Cloud SQL instance resource.

availableMaintenanceVersions, string[]

Output only. List all maintenance versions applicable on the instance

backendType, 'SQL_BACKEND_TYPE_UNSPECIFIED' | 'FIRST_GEN' | 'SECOND_GEN' | 'EXTERNAL'

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.

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.

databaseCenterIntegration, 'DATABASE_CENTER_INTEGRATION_UNSPECIFIED' | 'ENABLED' | 'DISABLED'

Optional. State of the Database Center integration for this instance. When unspecified, Database Center integration is enabled by default.

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, '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'

The database engine type and version. The databaseVersion field cannot be changed after instance creation.

deploymentInfo, BlueGreenDeploymentInfo

Blue-green deployment metadata for a database instance. In a blue-green deployment, we maintain two environments, one of which is live. This message contains details about the blue-green deployment.

diskEncryptionConfiguration, DiskEncryptionConfiguration

Disk encryption configuration for an instance.

diskEncryptionStatus, DiskEncryptionStatus

Disk encryption status for an instance.

dnsName, string

Output only. The dns name of the instance.

dnsNames, DnsNameMapping[]

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, GeminiInstanceConfig

Gemini instance configuration.

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, 'SQL_INSTANCE_TYPE_UNSPECIFIED' | 'CLOUD_SQL_INSTANCE' | 'ON_PREMISES_INSTANCE' | 'READ_REPLICA_INSTANCE' | 'READ_POOL_INSTANCE' | 'GREEN_INSTANCE'

The instance type.

ipAddresses, IpMapping[]

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.

name, string

Name of the Cloud SQL instance. This does not include the project ID.

nodeCount, integer

The number of read pool nodes in a read pool.

nodes, PoolNodeConfig[]

Output only. Entries containing information about each read pool node of the read pool.

onPremisesConfiguration, OnPremisesConfiguration

On-premises instance configuration.

outOfDiskReport, SqlOutOfDiskReport

This message wraps up the information written by out-of-disk detection job.

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, ReplicaConfiguration

Read-replica configuration for connecting to the primary instance.

replicaNames, string[]

The replicas of the instance.

replicationCluster, ReplicationCluster

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.

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, SqlScheduledMaintenance

Any scheduled maintenance for this instance.

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, SslCert

SslCerts Resource

serviceAccountEmailAddress, string

The service account email address assigned to the instance.\This property is read-only.

settings, Settings

Database instance settings.

skipPrecheck, boolean

Optional. Input only. Determines whether the precheck step is skipped during a major version upgrade.

sqlNetworkArchitecture, 'SQL_NETWORK_ARCHITECTURE_UNSPECIFIED' | 'NEW_NETWORK_ARCHITECTURE' | 'OLD_NETWORK_ARCHITECTURE'
state, 'SQL_INSTANCE_STATE_UNSPECIFIED' | 'RUNNABLE' | 'SUSPENDED' | 'PENDING_DELETE' | 'PENDING_CREATE' | 'MAINTENANCE' | 'FAILED' | 'ONLINE_MAINTENANCE' | 'REPAIRING'

The current serving state of the Cloud SQL instance.

suspensionReason, string[]

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, AvailableDatabaseVersion[]

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.

Changes

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/sqlservice.admin was removed from the endpoint's security scheme Oauth2

    1 more change in this revision