- Resource: Database
- State
- RestoreInfo
- RestoreSourceType
- BackupInfo
- EncryptionConfig
- QuorumInfo
- QuorumType
- SingleRegionQuorum
- DualRegionQuorum
- Initiator
- Methods
Resource: Database
A Cloud Spanner database.
JSON representation |
---|
{ "name": string, "state": enum ( |
Fields | |
---|---|
name |
Required. The name of the database. Values are of the form |
state |
Output only. The current database state. |
create |
Output only. If exists, the time at which the database creation started. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
restore |
Output only. Applicable only for restored databases. Contains information about the restore source. |
encryption |
Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty. |
encryption |
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 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. |
version |
Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of versionRetentionPeriod database option set using |
earliest |
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. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
default |
Output only. The read-write region which contains the database's leader replicas. This is the same as the value of defaultLeader database option set using DatabaseAdmin.CreateDatabase or DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty. |
database |
Output only. The dialect of the Cloud Spanner Database. |
enable |
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. |
reconciling |
Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database. |
quorum |
Output only. Applicable only for databases that use dual-region instance configurations. Contains information about the quorum. |
State
Indicates the current state of the database.
Enums | |
---|---|
STATE_UNSPECIFIED |
Not specified. |
CREATING |
The database is still being created. Operations on the database may fail with FAILED_PRECONDITION in this state. |
READY |
The database is fully created and ready for use. |
READY_OPTIMIZING |
The database is fully created and ready for use, but is still being optimized for performance and cannot handle full load. In this state, the database still references the backup it was restore from, preventing the backup from being deleted. When optimizations are complete, the full performance of the database will be restored, and the database will transition to |
RestoreInfo
Information about the database restore.
JSON representation |
---|
{ "sourceType": enum ( |
Fields | |
---|---|
source |
The type of the restore source. |
Union field source_info . Information about the source used to restore the database. source_info can be only one of the following: |
|
backup |
Information about the backup used to restore the database. The backup may no longer exist. |
RestoreSourceType
Indicates the type of the restore source.
Enums | |
---|---|
TYPE_UNSPECIFIED |
No restore associated. |
BACKUP |
A backup was used as the source of the restore. |
BackupInfo
Information about a backup.
JSON representation |
---|
{ "backup": string, "versionTime": string, "createTime": string, "sourceDatabase": string } |
Fields | |
---|---|
backup |
Name of the backup. |
version |
The backup contains an externally consistent copy of A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
create |
The time the A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
source |
Name of the database the backup was created from. |
EncryptionConfig
Encryption configuration for a Cloud Spanner database.
JSON representation |
---|
{ "kmsKeyName": string, "kmsKeyNames": [ string ] } |
Fields | |
---|---|
kms |
The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form |
kms |
Specifies the KMS configuration for one or more keys used to encrypt the database. Values are of the form The keys referenced by
|
QuorumInfo
Information about the dual-region quorum.
JSON representation |
---|
{ "quorumType": { object ( |
Fields | |
---|---|
quorum |
Output only. The type of this quorum. See |
initiator |
Output only. Whether this |
start |
Output only. The timestamp when the request was triggered. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
etag |
Output only. The etag is used for optimistic concurrency control as a way to help prevent simultaneous |
QuorumType
Information about the database quorum type. This only applies to dual-region instance configs.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field type . The type of quorum. type can be only one of the following: |
|
single |
Single-region quorum type. |
dual |
Dual-region quorum type. |
SingleRegionQuorum
Message type for a single-region quorum.
JSON representation |
---|
{ "servingLocation": string } |
Fields | |
---|---|
serving |
Required. The location of the serving region, e.g. "us-central1". The location must be one of the regions within the dual-region instance configuration of your database. The list of valid locations is available using the [instanceConfigs.get][InstanceAdmin.GetInstanceConfig] API. This should only be used if you plan to change quorum to the single-region quorum type. |
DualRegionQuorum
This type has no fields.
Message type for a dual-region quorum. Currently this type has no options.
Initiator
Describes who initiated databases.changequorum
.
Enums | |
---|---|
INITIATOR_UNSPECIFIED |
Unspecified. |
GOOGLE |
databases.changequorum initiated by Google. |
USER |
databases.changequorum initiated by User. |
Methods |
|
---|---|
|
ChangeQuorum is strictly restricted to databases that use dual-region instance configurations. |
|
Creates a new Spanner database and starts to prepare it for serving. |
|
Drops (aka deletes) a Cloud Spanner database. |
|
Gets the state of a Cloud Spanner database. |
|
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. |
|
Gets the access control policy for a database or backup resource. |
|
Lists Cloud Spanner databases. |
|
Updates a Cloud Spanner database. |
|
Create a new database by restoring from a completed backup. |
|
Sets the access control policy on a database or backup resource. |
|
Returns permissions that the caller has on the specified database or backup resource. |
|
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. |