Backup
(
backup_id
,
instance
,
cluster_id
=
None
,
table_id
=
None
,
expire_time
=
None
,
encryption_info
=
None
,
)
Representation of a Google Cloud Bigtable Backup.
A :class: Backup
can be used to:
-
create
the backup -
update
the backup -
delete
the backup
Parameters
backup_id
str
The ID of the backup.
instance
cluster_id
str
(Optional) The ID of the Cluster that contains this Backup. Required for calling 'delete', 'exists' etc. methods.
table_id
str
(Optional) The ID of the Table that the Backup is for. Required if the 'create' method will be called.
expire_time
datetime.datetime
(Optional) The expiration time after which the Backup will be automatically deleted. Required if the create
method will be called.
Properties
cluster
The ID of the [parent] cluster used in requests.
str
encryption_info
Encryption info for this Backup.
EncryptionInfo
end_time
The time this Backup was finished.
datetime.datetime
expire_time
Expiration time used in the creation requests.
datetime.datetime
name
Backup name used in requests.
The Backup name is of the form
`"projects/../instances/../clusters/../backups/{backup_id}"`
ValueError
str
parent
Name of the parent cluster used in requests.
The parent name is of the form `"projects/{project}/instances/{instance_id}/clusters/{cluster}"`
str
size_bytes
The size of this Backup, in bytes.
int
source_table
The full name of the Table from which this Backup is created.
The table name is of the form `"projects/../instances/../tables/{source_table}"`
str
start_time
The time this Backup was started.
datetime.datetime
state
The current state of this Backup.
State
Methods
create
create
(
cluster_id
=
None
)
Creates this backup within its instance.
cluster_id
str
(Optional) The ID of the Cluster for the newly created Backup.
Conflict
NotFound
BadRequest
table
or expire_time
values are invalid, or expire_time
is not set google.api_core.operation.Operation
delete
delete
()
Delete this Backup.
exists
exists
()
Tests whether this Backup exists.
bool
from_pb
from_pb
(
backup_pb
,
instance
)
Creates a Backup instance from a protobuf message.
backup_pb
table.Backup
A Backup protobuf object.
instance
ValueError
get
get
()
Retrieves metadata of a pending or completed Backup.
google.api_core.exceptions.GoogleAPICallError
google.api_core.exceptions.RetryError
ValueError
get_iam_policy
get_iam_policy
()
Gets the IAM access control policy for this backup.
Policy
reload
reload
()
Refreshes the stored backup properties.
restore
restore
(
table_id
,
instance_id
=
None
)
Creates a new Table by restoring from this Backup. The new Table
can be created in the same Instance as the Instance containing the
Backup, or another Instance whose ID can be specified in the arguments.
The returned Table long-running operation
can be used to track the
progress of the operation and to cancel it. The response
type is Table
, if successful.
table_id
str
The ID of the Table to create and restore to. This Table must not already exist.
instance_id
str
(Optional) The ID of the Instance to restore the backup into, if different from the current one.
google.api_core.exceptions.AlreadyExists
google.api_core.exceptions.GoogleAPICallError
google.api_core.exceptions.RetryError
ValueError
_OperationFuture
set_iam_policy
set_iam_policy
(
policy
)
Sets the IAM access control policy for this backup. Replaces any existing policy.
For more information about policy, please see documentation of
class google.cloud.bigtable.policy.Policy
policy
Policy
A new IAM policy to replace the current IAM policy of this backup.
Policy
test_iam_permissions
test_iam_permissions
(
permissions
)
Tests whether the caller has the given permissions for this backup. Returns the permissions that the caller has.
permissions
list
The set of permissions to check for the resource
. Permissions with wildcards (such as ' ' or 'storage.
') are not allowed. For more information see IAM Overview https://cloud.google.com/iam/docs/overview#permissions
. Bigtable Permissions https://cloud.google.com/bigtable/docs/access-control
.
list
update_expire_time
update_expire_time
(
new_expire_time
)
Update the expire time of this Backup.
new_expire_time
datetime.datetime
the new expiration time timestamp