Index
DatabaseAdmin
(interface)Backup
(message)Backup.State
(enum)BackupInfo
(message)CreateBackupMetadata
(message)CreateBackupRequest
(message)CreateDatabaseMetadata
(message)CreateDatabaseRequest
(message)Database
(message)Database.State
(enum)DeleteBackupRequest
(message)DropDatabaseRequest
(message)GetBackupRequest
(message)GetDatabaseDdlRequest
(message)GetDatabaseDdlResponse
(message)GetDatabaseRequest
(message)ListBackupOperationsRequest
(message)ListBackupOperationsResponse
(message)ListBackupsRequest
(message)ListBackupsResponse
(message)ListDatabaseOperationsRequest
(message)ListDatabaseOperationsResponse
(message)ListDatabasesRequest
(message)ListDatabasesResponse
(message)OperationProgress
(message)OptimizeRestoredDatabaseMetadata
(message)RestoreDatabaseMetadata
(message)RestoreDatabaseRequest
(message)RestoreInfo
(message)RestoreSourceType
(enum)UpdateBackupRequest
(message)UpdateDatabaseDdlMetadata
(message)UpdateDatabaseDdlRequest
(message)
DatabaseAdmin
Cloud Spanner Database Admin API
The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also enables updating the schema of pre-existing databases. It can be also used to create, delete and list backups for a database and to restore from an existing backup.
CreateBackup | |
---|---|
Starts creating a new Cloud Spanner Backup. The returned backup
|
CreateDatabase | |
---|---|
Creates a new Cloud Spanner database and starts to prepare it for serving. The returned
|
DeleteBackup | |
---|---|
Deletes a pending or completed
|
DropDatabase | |
---|---|
Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their
|
GetBackup | |
---|---|
Gets metadata on a pending or completed
|
GetDatabase | |
---|---|
Gets the state of a Cloud Spanner database.
|
GetDatabaseDdl | |
---|---|
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the
|
GetIamPolicy | |
---|---|
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set. Authorization requires
|
ListBackupOperations | |
---|---|
Lists the backup
|
ListBackups | |
---|---|
Lists completed and pending backups. Backups returned are ordered by
|
ListDatabaseOperations | |
---|---|
Lists database
|
ListDatabases | |
---|---|
Lists Cloud Spanner databases.
|
RestoreDatabase | |
---|---|
Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database
|
SetIamPolicy | |
---|---|
Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires
|
TestIamPermissions | |
---|---|
Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has
|
UpdateBackup | |
---|---|
Updates a pending or completed
|
UpdateDatabaseDdl | |
---|---|
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned
|
Backup
A backup of a Cloud Spanner database.
Fields | |
---|---|
database |
Required for the |
expire_time |
Required for the |
name |
Output only for the A globally unique identifier for the backup which cannot be changed. Values are of the form The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form |
create_time |
Output only. The backup will contain an externally consistent copy of the database at the timestamp specified by |
size_bytes |
Output only. Size of the backup in bytes. |
state |
Output only. The current state of the backup. |
referencing_databases[] |
Output only. The names of the restored databases that reference the backup. The database names are of the form |
State
Indicates the current state of the backup.
Enums | |
---|---|
STATE_UNSPECIFIED |
Not specified. |
CREATING |
The pending backup is still being created. Operations on the backup may fail with FAILED_PRECONDITION in this state. |
READY |
The backup is complete and ready for use. |
BackupInfo
Information about a backup.
Fields | |
---|---|
backup |
Name of the backup. |
create_time |
The backup contains an externally consistent copy of |
source_database |
Name of the database the backup was created from. |
CreateBackupMetadata
Metadata type for the operation returned by CreateBackup
.
Fields | |
---|---|
name |
The name of the backup being created. |
database |
The name of the database the backup is created from. |
progress |
The progress of the |
cancel_time |
The time at which cancellation of this operation was received. |
CreateBackupRequest
The request for CreateBackup
.
Fields | |
---|---|
parent |
Required. The name of the instance in which the backup will be created. This must be the same instance that contains the database the backup will be created from. The backup will be stored in the location(s) specified in the instance configuration of this instance. Values are of the form Authorization requires the following IAM permission on the specified resource
|
backup_id |
Required. The id of the backup to be created. The |
backup |
Required. The backup to create. |
CreateDatabaseMetadata
Metadata type for the operation returned by CreateDatabase
.
Fields | |
---|---|
database |
The database being created. |
CreateDatabaseRequest
The request for CreateDatabase
.
Fields | |
---|---|
parent |
Required. The name of the instance that will serve the new database. Values are of the form Authorization requires the following IAM permission on the specified resource
|
create_statement |
Required. A |
extra_statements[] |
Optional. A list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created. |
Database
A Cloud Spanner database.
Fields | |
---|---|
name |
Required. The name of the database. Values are of the form |
state |
Output only. The current database state. |
create_time |
Output only. If exists, the time at which the database creation started. |
restore_info |
Output only. Applicable only for restored databases. Contains information about the restore source. |
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 |
DeleteBackupRequest
The request for DeleteBackup
.
Fields | |
---|---|
name |
Required. Name of the backup to delete. Values are of the form Authorization requires the following IAM permission on the specified resource
|
DropDatabaseRequest
The request for DropDatabase
.
Fields | |
---|---|
database |
Required. The database to be dropped. Authorization requires the following IAM permission on the specified resource
|
GetBackupRequest
The request for GetBackup
.
Fields | |
---|---|
name |
Required. Name of the backup. Values are of the form Authorization requires the following IAM permission on the specified resource
|
GetDatabaseDdlRequest
The request for GetDatabaseDdl
.
Fields | |
---|---|
database |
Required. The database whose schema we wish to get. Values are of the form Authorization requires the following IAM permission on the specified resource
|
GetDatabaseDdlResponse
The response for GetDatabaseDdl
.
Fields | |
---|---|
statements[] |
A list of formatted DDL statements defining the schema of the database specified in the request. |
GetDatabaseRequest
The request for GetDatabase
.
Fields | |
---|---|
name |
Required. The name of the requested database. Values are of the form Authorization requires the following IAM permission on the specified resource
|
ListBackupOperationsRequest
The request for ListBackupOperations
.
Fields | |
---|---|
parent |
Required. The instance of the backup operations. Values are of the form Authorization requires the following IAM permission on the specified resource
|
filter |
An expression that filters the list of returned backup operations. A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string, a number, or a boolean. The comparison operator must be one of: The following fields in the
You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are combined with AND logic, but you can specify AND, OR, and NOT logic explicitly. Here are a few examples:
|
page_size |
Number of operations to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. |
page_token |
If non-empty, |
ListBackupOperationsResponse
The response for ListBackupOperations
.
Fields | |
---|---|
operations[] |
The list of matching backup |
next_page_token |
|
ListBackupsRequest
The request for ListBackups
.
Fields | |
---|---|
parent |
Required. The instance to list backups from. Values are of the form Authorization requires the following IAM permission on the specified resource
|
filter |
An expression that filters the list of returned backups. A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string, a number, or a boolean. The comparison operator must be one of: The following fields in the
You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are combined with AND logic, but you can specify AND, OR, and NOT logic explicitly. Here are a few examples:
|
page_size |
Number of backups to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. |
page_token |
If non-empty, |
ListBackupsResponse
The response for ListBackups
.
Fields | |
---|---|
backups[] |
The list of matching backups. Backups returned are ordered by |
next_page_token |
|
ListDatabaseOperationsRequest
The request for ListDatabaseOperations
.
Fields | |
---|---|
parent |
Required. The instance of the database operations. Values are of the form Authorization requires the following IAM permission on the specified resource
|
filter |
An expression that filters the list of returned operations. A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string, a number, or a boolean. The comparison operator must be one of: The following fields in the
You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are combined with AND logic. However, you can specify AND, OR, and NOT logic explicitly. Here are a few examples:
|
page_size |
Number of operations to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. |
page_token |
If non-empty, |
ListDatabaseOperationsResponse
The response for ListDatabaseOperations
.
Fields | |
---|---|
operations[] |
The list of matching database |
next_page_token |
|
ListDatabasesRequest
The request for ListDatabases
.
Fields | |
---|---|
parent |
Required. The instance whose databases should be listed. Values are of the form Authorization requires the following IAM permission on the specified resource
|
page_size |
Number of databases to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. |
page_token |
If non-empty, |
ListDatabasesResponse
The response for ListDatabases
.
Fields | |
---|---|
databases[] |
Databases that matched the request. |
next_page_token |
|
OperationProgress
Encapsulates progress related information for a Cloud Spanner long running operation.
Fields | |
---|---|
progress_percent |
Percent completion of the operation. Values are between 0 and 100 inclusive. |
start_time |
Time the request was received. |
end_time |
If set, the time at which this operation failed or was completed successfully. |
OptimizeRestoredDatabaseMetadata
Metadata type for the long-running operation used to track the progress of optimizations performed on a newly restored database. This long-running operation is automatically created by the system after the successful completion of a database restore, and cannot be cancelled.
Fields | |
---|---|
name |
Name of the restored database being optimized. |
progress |
The progress of the post-restore optimizations. |
RestoreDatabaseMetadata
Metadata type for the long-running operation returned by RestoreDatabase
.
Fields | |
---|---|
name |
Name of the database being created and restored to. |
source_type |
The type of the restore source. |
progress |
The progress of the |
cancel_time |
The time at which cancellation of this operation was received. |
optimize_database_operation_name |
If exists, the name of the long-running operation that will be used to track the post-restore optimization process to optimize the performance of the restored database, and remove the dependency on the restore source. The name is of the form |
backup_info |
Information about the backup used to restore the database. |
RestoreDatabaseRequest
The request for RestoreDatabase
.
Fields | |
---|---|
parent |
Required. The name of the instance in which to create the restored database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form Authorization requires the following IAM permission on the specified resource
|
database_id |
Required. The id of the database to create and restore to. This database must not already exist. The |
backup |
Name of the backup from which to restore. Values are of the form Authorization requires the following IAM permission on the specified resource
|
RestoreInfo
Information about the database restore.
Fields | |
---|---|
source_type |
The type of the restore source. |
backup_info |
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. |
UpdateBackupRequest
The request for UpdateBackup
.
Fields | |
---|---|
backup |
Required. The backup to update. |
update_mask |
Required. A mask specifying which fields (e.g. |
UpdateDatabaseDdlMetadata
Metadata type for the operation returned by UpdateDatabaseDdl
.
Fields | |
---|---|
database |
The database being modified. |
statements[] |
For an update this list contains all the statements. For an individual statement, this list contains only that statement. |
commit_timestamps[] |
Reports the commit timestamps of all statements that have succeeded so far, where |
UpdateDatabaseDdlRequest
Enqueues the given DDL statements to be applied, in order but not necessarily all at once, to the database schema at some point (or points) in the future. The server checks that the statements are executable (syntactically valid, name tables that exist, etc.) before enqueueing them, but they may still fail upon later execution (e.g., if a statement from another batch of statements is applied first and it conflicts in some way, or if there is some data-related problem like a NULL
value in a column to which NOT NULL
would be added). If a statement fails, all subsequent statements in the batch are automatically cancelled.
Each batch of statements is assigned a name which can be used with the Operations
API to monitor progress. See the operation_id
field for more details.
Fields | |
---|---|
database |
Required. The database to update. Authorization requires the following IAM permission on the specified resource
|
statements[] |
Required. DDL statements to be applied to the database. |
operation_id |
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the
|