projects

GET /v1/projects/{projectsId}/instances/{instancesId}/databases/{databasesId}

Changed on

Gets the state of a Cloud Spanner database.

Request

  • Base URL
    https://spanner.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/spanner.admin
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/spanner.admin

Path parameters

projectsId, string required
instancesId, string required
databasesId, string required

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").

Response

Successful response

Database required

A Cloud Spanner database.

createTime, string google-datetime

Output only. If exists, the time at which the database creation started.

databaseDialect, 'DATABASE_DIALECT_UNSPECIFIED' | 'GOOGLE_STANDARD_SQL' | 'POSTGRESQL'

Output only. The dialect of the Cloud Spanner Database.

defaultLeader, string

Output only. The read-write region which contains the database's leader replicas. This is the same as the value of default_leader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.

defaultReadLockMode, 'READ_LOCK_MODE_UNSPECIFIED' | 'PESSIMISTIC' | 'OPTIMISTIC'

Output only. The default read lock mode for transactions. If not configured via DDL, READ_LOCK_MODE_UNSPECIFIED will be returned. For transactions, if lock mode is unspecified, it defaults to PESSIMISTIC for SERIALIZABLE isolation and OPTIMISTIC for REPEATABLE_READ isolation.

defaultTransactionIsolation, 'ISOLATION_LEVEL_UNSPECIFIED' | 'SERIALIZABLE' | 'REPEATABLE_READ'

Output only. The default isolation level for transactions in this database. If not configured via DDL, ISOLATION_LEVEL_UNSPECIFIED will be returned. For transactions, if isolation level is unspecified, it defaults to SERIALIZABLE.

earliestVersionTime, string google-datetime

Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

enableDropProtection, boolean

Optional. Whether drop protection is enabled for this database. Defaults to false, if not set. For more details, please see how to prevent accidental database deletion.

encryptionConfig, EncryptionConfig

Encryption configuration for a Cloud Spanner database.

encryptionInfo, EncryptionInfo[]

Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as all Cloud KMS key versions that are in use. The encryption_status field inside of each EncryptionInfo is not populated. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.

name, string

Required. The name of the database. Values are of the form projects//instances//databases/, where `` is as specified in the CREATE DATABASE statement. This name can be passed to other API methods to identify the database.

quorumInfo, QuorumInfo

Information about the dual-region quorum.

reconciling, boolean

Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database.

restoreInfo, RestoreInfo

Information about the database restore.

state, 'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'READY_OPTIMIZING'

Output only. The current database state.

versionRetentionPeriod, string

Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.

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/spanner.admin was removed from the endpoint's security scheme Oauth2

    1 more change in this revision