Types for Google Cloud Spanner Admin Database v1 API¶
- class google.cloud.spanner_admin_database_v1.types.Backup(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A backup of a Cloud Spanner database.
- database¶
Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. Name of the database from which this backup was created. This needs to be in the same instance as the backup. Values are of the form
projects/<project>/instances/<instance>/databases/<database>
.- Type
- version_time¶
The backup will contain an externally consistent copy of the database at the timestamp specified by
version_time
. Ifversion_time
is not specified, the system will setversion_time
to thecreate_time
of the backup.
- expire_time¶
Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the CreateBackup request is processed. Once the
expire_time
has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
- name¶
Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation. Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
A globally unique identifier for the backup which cannot be changed. Values are of the form
projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]
The final segment of the name must be between 2 and 60 characters in length.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
projects/<project>/instances/<instance>
.- Type
- create_time¶
Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received. If the request does not specify
version_time
, theversion_time
of the backup will be equivalent to thecreate_time
.
- 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
projects/<project>/instances/<instance>/databases/<database>
. Referencing databases may exist in different instances. The existence of any referencing database prevents the backup from being deleted. When a restored database from the backup enters theREADY
state, the reference to the backup is removed.- Type
MutableSequence[str]
- encryption_info¶
Output only. The encryption information for the backup.
- database_dialect¶
Output only. The database dialect information for the backup.
- referencing_backups¶
Output only. The names of the destination backups being created by copying this source backup. The backup names are of the form
projects/<project>/instances/<instance>/backups/<backup>
. Referencing backups may exist in different instances. The existence of any referencing backup prevents the backup from being deleted. When the copy operation is done (either successfully completed or cancelled or the destination backup is deleted), the reference to the backup is removed.- Type
MutableSequence[str]
- max_expire_time¶
Output only. The max allowed expiration time of the backup, with microseconds granularity. A backup’s expiration time can be configured in multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or copying an existing backup, the expiration time specified must be less than
Backup.max_expire_time
.
- class State(value)[source]¶
Bases:
proto.enums.Enum
Indicates the current state of the backup.
- Values:
- STATE_UNSPECIFIED (0):
Not specified.
- CREATING (1):
The pending backup is still being created. Operations on the backup may fail with
FAILED_PRECONDITION
in this state.- READY (2):
The backup is complete and ready for use.
- class google.cloud.spanner_admin_database_v1.types.BackupInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Information about a backup.
- version_time¶
The backup contains an externally consistent copy of
source_database
at the timestamp specified byversion_time
. If the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specifyversion_time
, theversion_time
of the backup is equivalent to thecreate_time
.
- create_time¶
The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was received.
- class google.cloud.spanner_admin_database_v1.types.CopyBackupEncryptionConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Encryption configuration for the copied backup.
- encryption_type¶
Required. The encryption type of the backup.
- kms_key_name¶
Optional. The Cloud KMS key that will be used to protect the backup. This field should be set only when [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] is
CUSTOMER_MANAGED_ENCRYPTION
. Values are of the formprojects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>
.- Type
- class EncryptionType(value)[source]¶
Bases:
proto.enums.Enum
Encryption types for the backup.
- Values:
- ENCRYPTION_TYPE_UNSPECIFIED (0):
Unspecified. Do not use.
- USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION (1):
This is the default option for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] when [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] is not specified. For example, if the source backup is using
Customer_Managed_Encryption
, the backup will be using the same Cloud KMS key as the source backup.- GOOGLE_DEFAULT_ENCRYPTION (2):
Use Google default encryption.
- CUSTOMER_MANAGED_ENCRYPTION (3):
Use customer managed encryption. If specified,
kms_key_name
must contain a valid Cloud KMS key.
- class google.cloud.spanner_admin_database_v1.types.CopyBackupMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata type for the google.longrunning.Operation returned by [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
- name¶
The name of the backup being created through the copy operation. Values are of the form
projects/<project>/instances/<instance>/backups/<backup>
.- Type
- source_backup¶
The name of the source backup that is being copied. Values are of the form
projects/<project>/instances/<instance>/backups/<backup>
.- Type
- progress¶
The progress of the [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation.
- cancel_time¶
The time at which cancellation of CopyBackup operation was received. [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients can use [Operations.GetOperation][google.longrunning.Operations.GetOperation] or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
Code.CANCELLED
.
- class google.cloud.spanner_admin_database_v1.types.CopyBackupRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
- parent¶
Required. The name of the destination instance that will contain the backup copy. Values are of the form:
projects/<project>/instances/<instance>
.- Type
- backup_id¶
Required. The id of the backup copy. The
backup_id
appended toparent
forms the full backup_uri of the formprojects/<project>/instances/<instance>/backups/<backup>
.- Type
- source_backup¶
Required. The source backup to be copied. The source backup needs to be in READY state for it to be copied. Once CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration until CopyBackup is finished. Values are of the form:
projects/<project>/instances/<instance>/backups/<backup>
.- Type
- expire_time¶
Required. The expiration time of the backup in microsecond granularity. The expiration time must be at least 6 hours and at most 366 days from the
create_time
of the source backup. Once theexpire_time
has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
- encryption_config¶
Optional. The encryption configuration used to encrypt the backup. If this field is not specified, the backup will use the same encryption configuration as the source backup by default, namely [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] =
USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION
.
- class google.cloud.spanner_admin_database_v1.types.CreateBackupEncryptionConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Encryption configuration for the backup to create.
- encryption_type¶
Required. The encryption type of the backup.
- kms_key_name¶
Optional. The Cloud KMS key that will be used to protect the backup. This field should be set only when [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is
CUSTOMER_MANAGED_ENCRYPTION
. Values are of the formprojects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>
.- Type
- class EncryptionType(value)[source]¶
Bases:
proto.enums.Enum
Encryption types for the backup.
- Values:
- ENCRYPTION_TYPE_UNSPECIFIED (0):
Unspecified. Do not use.
- USE_DATABASE_ENCRYPTION (1):
Use the same encryption configuration as the database. This is the default option when [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] is empty. For example, if the database is using
Customer_Managed_Encryption
, the backup will be using the same Cloud KMS key as the database.- GOOGLE_DEFAULT_ENCRYPTION (2):
Use Google default encryption.
- CUSTOMER_MANAGED_ENCRYPTION (3):
Use customer managed encryption. If specified,
kms_key_name
must contain a valid Cloud KMS key.
- class google.cloud.spanner_admin_database_v1.types.CreateBackupMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata type for the operation returned by [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
- progress¶
The progress of the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
- cancel_time¶
The time at which cancellation of this operation was received. [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients can use [Operations.GetOperation][google.longrunning.Operations.GetOperation] or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
Code.CANCELLED
.
- class google.cloud.spanner_admin_database_v1.types.CreateBackupRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
- 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
projects/<project>/instances/<instance>
.- Type
- backup_id¶
Required. The id of the backup to be created. The
backup_id
appended toparent
forms the full backup name of the formprojects/<project>/instances/<instance>/backups/<backup_id>
.- Type
- backup¶
Required. The backup to create.
- encryption_config¶
Optional. The encryption configuration used to encrypt the backup. If this field is not specified, the backup will use the same encryption configuration as the database by default, namely [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] =
USE_DATABASE_ENCRYPTION
.
- class google.cloud.spanner_admin_database_v1.types.CreateDatabaseMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata type for the operation returned by [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
- class google.cloud.spanner_admin_database_v1.types.CreateDatabaseRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
- parent¶
Required. The name of the instance that will serve the new database. Values are of the form
projects/<project>/instances/<instance>
.- Type
- create_statement¶
Required. A
CREATE DATABASE
statement, which specifies the ID of the new database. The database ID must conform to the regular expression[a-z][a-z0-9_\-]*[a-z0-9]
and be between 2 and 30 characters in length. If the database ID is a reserved word or if it contains a hyphen, the database ID must be enclosed in backticks (`
).- Type
- 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.
- Type
MutableSequence[str]
- encryption_config¶
Optional. The encryption configuration for the database. If this field is not specified, Cloud Spanner will encrypt/decrypt all data at rest using Google default encryption.
- database_dialect¶
Optional. The dialect of the Cloud Spanner Database.
- class google.cloud.spanner_admin_database_v1.types.Database(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A Cloud Spanner database.
- name¶
Required. The name of the database. Values are of the form
projects/<project>/instances/<instance>/databases/<database>
, where<database>
is as specified in theCREATE DATABASE
statement. This name can be passed to other API methods to identify the database.- Type
- 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.
- encryption_config¶
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_info¶
Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as encryption state and the Cloud KMS key versions that are in use. 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.
- Type
MutableSequence[google.cloud.spanner_admin_database_v1.types.EncryptionInfo]
- version_retention_period¶
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][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour, if not set.
- Type
- earliest_version_time¶
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.
- default_leader¶
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.
- Type
- database_dialect¶
Output only. The dialect of the Cloud Spanner Database.
- enable_drop_protection¶
Whether drop protection is enabled for this database. Defaults to false, if not set.
- Type
- reconciling¶
Output only. If true, the database is being updated. If false, there are no ongoing update operations for the database.
- Type
- class State(value)[source]¶
Bases:
proto.enums.Enum
Indicates the current state of the database.
- Values:
- STATE_UNSPECIFIED (0):
Not specified.
- CREATING (1):
The database is still being created. Operations on the database may fail with
FAILED_PRECONDITION
in this state.- READY (2):
The database is fully created and ready for use.
- READY_OPTIMIZING (3):
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
READY
state.
- class google.cloud.spanner_admin_database_v1.types.DatabaseDialect(value)[source]¶
Bases:
proto.enums.Enum
Indicates the dialect type of a database.
- Values:
- DATABASE_DIALECT_UNSPECIFIED (0):
Default value. This value will create a database with the GOOGLE_STANDARD_SQL dialect.
- GOOGLE_STANDARD_SQL (1):
Google standard SQL.
- POSTGRESQL (2):
PostgreSQL supported SQL.
- class google.cloud.spanner_admin_database_v1.types.DatabaseRole(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A Cloud Spanner database role.
- name¶
Required. The name of the database role. Values are of the form
projects/<project>/instances/<instance>/databases/<database>/databaseRoles/ {role}
, where<role>
is as specified in theCREATE ROLE
DDL statement. This name can be passed to Get/Set IAMPolicy methods to identify the database role.- Type
- class google.cloud.spanner_admin_database_v1.types.DdlStatementActionInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Action information extracted from a DDL statement. This proto is used to display the brief info of the DDL statement for the operation [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
- action¶
The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc. This field is a non-empty string.
- Type
- entity_type¶
The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc. This field can be empty string for some DDL statement, e.g. for statement “ANALYZE”,
entity_type
= “”.- Type
- class google.cloud.spanner_admin_database_v1.types.DeleteBackupRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
- class google.cloud.spanner_admin_database_v1.types.DropDatabaseRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].
- class google.cloud.spanner_admin_database_v1.types.EncryptionConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Encryption configuration for a Cloud Spanner database.
- class google.cloud.spanner_admin_database_v1.types.EncryptionInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Encryption information for a Cloud Spanner database or backup.
- encryption_type¶
Output only. The type of encryption.
- encryption_status¶
Output only. If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
- Type
google.rpc.status_pb2.Status
- kms_key_version¶
Output only. A Cloud KMS key version that is being used to protect the database or backup.
- Type
- class Type(value)[source]¶
Bases:
proto.enums.Enum
Possible encryption types.
- Values:
- TYPE_UNSPECIFIED (0):
Encryption type was not specified, though data at rest remains encrypted.
- GOOGLE_DEFAULT_ENCRYPTION (1):
The data is encrypted at rest with a key that is fully managed by Google. No key version or status will be populated. This is the default state.
- CUSTOMER_MANAGED_ENCRYPTION (2):
The data is encrypted at rest with a key that is managed by the customer. The active version of the key.
kms_key_version
will be populated, andencryption_status
may be populated.
- class google.cloud.spanner_admin_database_v1.types.GetBackupRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
- class google.cloud.spanner_admin_database_v1.types.GetDatabaseDdlRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
- class google.cloud.spanner_admin_database_v1.types.GetDatabaseDdlResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
- class google.cloud.spanner_admin_database_v1.types.GetDatabaseRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase].
- class google.cloud.spanner_admin_database_v1.types.ListBackupOperationsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
- parent¶
Required. The instance of the backup operations. Values are of the form
projects/<project>/instances/<instance>
.- Type
- 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:
<
,>
,<=
,>=
,!=
,=
, or:
. Colon:
is the contains operator. Filter rules are not case sensitive.The following fields in the [operation][google.longrunning.Operation] are eligible for filtering:
name
- The name of the long-running operationdone
- False if the operation is in progress, else true.metadata.@type
- the type of metadata. For example, the type string for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] istype.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata
.metadata.<field_name>
- any field in metadata.value.metadata.@type
must be specified first if filtering on metadata fields.error
- Error associated with the long-running operation.response.@type
- the type of response.response.<field_name>
- any field in response.value.
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:
done:true
- The operation is complete.(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND
metadata.database:prod
- Returns operations where:The operation’s metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
The database the backup was taken from has a name containing the string “prod”.
(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND
(metadata.name:howl) AND
(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND
(error:*)
- Returns operations where:The operation’s metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
The backup name contains the string “howl”.
The operation started before 2018-03-28T14:50:00Z.
The operation resulted in an error.
(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND
(metadata.source_backup:test) AND
(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND
(error:*)
- Returns operations where:The operation’s metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The source backup of the copied backup name contains the string “test”.
The operation started before 2022-01-18T14:50:00Z.
The operation resulted in an error.
((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND
(metadata.database:test_db)) OR
((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND
(metadata.source_backup:test_bkp)) AND
(error:*)
- Returns operations where:The operation’s metadata matches either of criteria:
The operation’s metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the database the backup was taken from has name containing string “test_db”
The operation’s metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the backup the backup was copied from has name containing string “test_bkp”
The operation resulted in an error.
- Type
- page_size¶
Number of operations to be returned in the response. If 0 or less, defaults to the server’s maximum allowed page size.
- Type
- page_token¶
If non-empty,
page_token
should contain a [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token] from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the sameparent
and with the samefilter
.- Type
- class google.cloud.spanner_admin_database_v1.types.ListBackupOperationsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response for [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
- operations¶
The list of matching backup [long-running operations][google.longrunning.Operation]. Each operation’s name will be prefixed by the backup’s name. The operation’s [metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata. Operations returned include those that are pending or have completed/failed/canceled within the last 7 days. Operations returned are ordered byoperation.metadata.value.progress.start_time
in descending order starting from the most recently started operation.- Type
MutableSequence[google.longrunning.operations_pb2.Operation]
- class google.cloud.spanner_admin_database_v1.types.ListBackupsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
- parent¶
Required. The instance to list backups from. Values are of the form
projects/<project>/instances/<instance>
.- Type
- 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:
<
,>
,<=
,>=
,!=
,=
, or:
. Colon:
is the contains operator. Filter rules are not case sensitive.The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
name
database
state
create_time
(and values are of the format YYYY-MM-DDTHH:MM:SSZ)expire_time
(and values are of the format YYYY-MM-DDTHH:MM:SSZ)version_time
(and values are of the format YYYY-MM-DDTHH:MM:SSZ)size_bytes
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:
name:Howl
- The backup’s name contains the string “howl”.database:prod
- The database’s name contains the string “prod”.state:CREATING
- The backup is pending creation.state:READY
- The backup is fully created and ready for use.(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")
- The backup name contains the string “howl” andcreate_time
of the backup is before 2018-03-28T14:50:00Z.expire_time < \"2018-03-28T14:50:00Z\"
- The backupexpire_time
is before 2018-03-28T14:50:00Z.size_bytes > 10000000000
- The backup’s size is greater than 10GB
- Type
- page_size¶
Number of backups to be returned in the response. If 0 or less, defaults to the server’s maximum allowed page size.
- Type
- class google.cloud.spanner_admin_database_v1.types.ListBackupsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
- backups¶
The list of matching backups. Backups returned are ordered by
create_time
in descending order, starting from the most recentcreate_time
.- Type
MutableSequence[google.cloud.spanner_admin_database_v1.types.Backup]
- class google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
- parent¶
Required. The instance of the database operations. Values are of the form
projects/<project>/instances/<instance>
.- Type
- 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:
<
,>
,<=
,>=
,!=
,=
, or:
. Colon:
is the contains operator. Filter rules are not case sensitive.The following fields in the [Operation][google.longrunning.Operation] are eligible for filtering:
name
- The name of the long-running operationdone
- False if the operation is in progress, else true.metadata.@type
- the type of metadata. For example, the type string for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] istype.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata
.metadata.<field_name>
- any field in metadata.value.metadata.@type
must be specified first, if filtering on metadata fields.error
- Error associated with the long-running operation.response.@type
- the type of response.response.<field_name>
- any field in response.value.
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:
done:true
- The operation is complete.(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND
(metadata.source_type:BACKUP) AND
(metadata.backup_info.backup:backup_howl) AND
(metadata.name:restored_howl) AND
(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND
(error:*)
- Return operations where:The operation’s metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
The database is restored from a backup.
The backup name contains “backup_howl”.
The restored database’s name contains “restored_howl”.
The operation started before 2018-03-28T14:50:00Z.
The operation resulted in an error.
- Type
- page_size¶
Number of operations to be returned in the response. If 0 or less, defaults to the server’s maximum allowed page size.
- Type
- page_token¶
If non-empty,
page_token
should contain a [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the sameparent
and with the samefilter
.- Type
- class google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response for [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
- operations¶
The list of matching database [long-running operations][google.longrunning.Operation]. Each operation’s name will be prefixed by the database’s name. The operation’s [metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata.- Type
MutableSequence[google.longrunning.operations_pb2.Operation]
- class google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
- parent¶
Required. The database whose roles should be listed. Values are of the form
projects/<project>/instances/<instance>/databases/<database>/databaseRoles
.- Type
- page_size¶
Number of database roles to be returned in the response. If 0 or less, defaults to the server’s maximum allowed page size.
- Type
- class google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
- database_roles¶
Database roles that matched the request.
- Type
MutableSequence[google.cloud.spanner_admin_database_v1.types.DatabaseRole]
- class google.cloud.spanner_admin_database_v1.types.ListDatabasesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
- parent¶
Required. The instance whose databases should be listed. Values are of the form
projects/<project>/instances/<instance>
.- Type
- page_size¶
Number of databases to be returned in the response. If 0 or less, defaults to the server’s maximum allowed page size.
- Type
- class google.cloud.spanner_admin_database_v1.types.ListDatabasesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
- databases¶
Databases that matched the request.
- Type
MutableSequence[google.cloud.spanner_admin_database_v1.types.Database]
- class google.cloud.spanner_admin_database_v1.types.OperationProgress(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Encapsulates progress related information for a Cloud Spanner long running operation.
- progress_percent¶
Percent completion of the operation. Values are between 0 and 100 inclusive.
- Type
- start_time¶
Time the request was received.
- end_time¶
If set, the time at which this operation failed or was completed successfully.
- class google.cloud.spanner_admin_database_v1.types.OptimizeRestoredDatabaseMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
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.
- progress¶
The progress of the post-restore optimizations.
- class google.cloud.spanner_admin_database_v1.types.RestoreDatabaseEncryptionConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Encryption configuration for the restored database.
- encryption_type¶
Required. The encryption type of the restored database.
- kms_key_name¶
Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored database. This field should be set only when [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] is
CUSTOMER_MANAGED_ENCRYPTION
. Values are of the formprojects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>
.- Type
- class EncryptionType(value)[source]¶
Bases:
proto.enums.Enum
Encryption types for the database to be restored.
- Values:
- ENCRYPTION_TYPE_UNSPECIFIED (0):
Unspecified. Do not use.
- USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION (1):
This is the default option when [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] is not specified.
- GOOGLE_DEFAULT_ENCRYPTION (2):
Use Google default encryption.
- CUSTOMER_MANAGED_ENCRYPTION (3):
Use customer managed encryption. If specified,
kms_key_name
must must contain a valid Cloud KMS key.
- class google.cloud.spanner_admin_database_v1.types.RestoreDatabaseMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata type for the long-running operation returned by [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
- source_type¶
The type of the restore source.
- backup_info¶
Information about the backup used to restore the database.
This field is a member of oneof
source_info
.
- progress¶
The progress of the [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase] operation.
- cancel_time¶
The time at which cancellation of this operation was received. [Operations.CancelOperation][google.longrunning.Operations.CancelOperation] starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients can use [Operations.GetOperation][google.longrunning.Operations.GetOperation] or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
Code.CANCELLED
.
- 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
projects/<project>/instances/<instance>/databases/<database>/operations/<operation>
where the is the name of database being created and restored to. The metadata type of the long-running operation is [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be automatically created by the system after the RestoreDatabase long-running operation completes successfully. This operation will not be created if the restore was not successful.- Type
- class google.cloud.spanner_admin_database_v1.types.RestoreDatabaseRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
- 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
projects/<project>/instances/<instance>
.- Type
- database_id¶
Required. The id of the database to create and restore to. This database must not already exist. The
database_id
appended toparent
forms the full database name of the formprojects/<project>/instances/<instance>/databases/<database_id>
.- Type
- backup¶
Name of the backup from which to restore. Values are of the form
projects/<project>/instances/<instance>/backups/<backup>
.This field is a member of oneof
source
.- Type
- encryption_config¶
Optional. An encryption configuration describing the encryption type and key resources in Cloud KMS used to encrypt/decrypt the database to restore to. If this field is not specified, the restored database will use the same encryption configuration as the backup by default, namely [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] =
USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION
.
- class google.cloud.spanner_admin_database_v1.types.RestoreInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Information about the database restore.
- source_type¶
The type of the restore source.
- class google.cloud.spanner_admin_database_v1.types.RestoreSourceType(value)[source]¶
Bases:
proto.enums.Enum
Indicates the type of the restore source.
- Values:
- TYPE_UNSPECIFIED (0):
No restore associated.
- BACKUP (1):
A backup was used as the source of the restore.
- class google.cloud.spanner_admin_database_v1.types.UpdateBackupRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
- backup¶
Required. The backup to update.
backup.name
, and the fields to be updated as specified byupdate_mask
are required. Other fields are ignored. Update is only supported for the following fields:backup.expire_time
.
- update_mask¶
Required. A mask specifying which fields (e.g.
expire_time
) in the Backup resource should be updated. This mask is relative to the Backup resource, not to the request message. The field mask must always be specified; this prevents any future fields from being erased accidentally by clients that do not know about them.
- class google.cloud.spanner_admin_database_v1.types.UpdateDatabaseDdlMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata type for the operation returned by [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
- statements¶
For an update this list contains all the statements. For an individual statement, this list contains only that statement.
- Type
MutableSequence[str]
- commit_timestamps¶
Reports the commit timestamps of all statements that have succeeded so far, where
commit_timestamps[i]
is the commit timestamp for the statementstatements[i]
.- Type
MutableSequence[google.protobuf.timestamp_pb2.Timestamp]
- throttled¶
Output only. When true, indicates that the operation is throttled e.g. due to resource constraints. When resources become available the operation will resume and this field will be false again.
- Type
- progress¶
The progress of the [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] operations. All DDL statements will have continuously updating progress, and
progress[i]
is the operation progress forstatements[i]
. Also,progress[i]
will have start time and end time populated with commit timestamp of operation, as well as a progress of 100% once the operation has completed.- Type
MutableSequence[google.cloud.spanner_admin_database_v1.types.OperationProgress]
- actions¶
The brief action info for the DDL statements.
actions[i]
is the brief info forstatements[i]
.- Type
MutableSequence[google.cloud.spanner_admin_database_v1.types.DdlStatementActionInfo]
- class google.cloud.spanner_admin_database_v1.types.UpdateDatabaseDdlRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
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 whichNOT 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][google.longrunning.Operations] API to monitor progress. See the [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more details.
- operation_id¶
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise,
operation_id
is used to construct the name of the resulting [Operation][google.longrunning.Operation].Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
operation_id
fields can be combined to form the [name][google.longrunning.Operation.name] of the resulting [longrunning.Operation][google.longrunning.Operation]:<database>/operations/<operation_id>
.operation_id
should be unique within the database, and must be a valid identifier:[a-z][a-z0-9_]*
. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returnsALREADY_EXISTS
.- Type
- class google.cloud.spanner_admin_database_v1.types.UpdateDatabaseMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata type for the operation returned by [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase].
- request¶
The request for [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase].
- progress¶
The progress of the [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase] operation.
- cancel_time¶
The time at which this operation was cancelled. If set, this operation is in the process of undoing itself (which is best-effort).
- class google.cloud.spanner_admin_database_v1.types.UpdateDatabaseRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request for [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase].
- database¶
Required. The database to update. The
name
field of the database is of the formprojects/<project>/instances/<instance>/databases/<database>
.
- update_mask¶
Required. The list of fields to update. Currently, only
enable_drop_protection
field can be updated.