public class Backup extends BackupInfo
Backup
adds a layer of service related
functionality over BackupInfo
.Modifier and Type | Class and Description |
---|---|
static class |
Backup.Builder |
BackupInfo.State
Modifier and Type | Method and Description |
---|---|
OperationFuture<Backup,CreateBackupMetadata> |
create()
Creates a backup on the server based on the source of this
Backup instance. |
void |
delete()
Deletes this backup on Cloud Spanner.
|
boolean |
exists()
Returns
true if a backup with the id of this Backup exists on Cloud
Spanner. |
com.google.cloud.Policy |
getIAMPolicy()
Returns the IAM
Policy for this backup. |
boolean |
isReady()
Returns
true if this backup is ready to use. |
Page<Operation> |
listBackupOperations()
Returns all long-running backup operations for this
Backup . |
Backup |
reload()
Fetches the backup's current information and returns a new
Backup instance. |
OperationFuture<Database,RestoreDatabaseMetadata> |
restore(DatabaseId database)
Restores this backup to the specified database.
|
com.google.cloud.Policy |
setIAMPolicy(com.google.cloud.Policy policy)
Updates the IAM policy for this backup and returns the resulting policy.
|
Iterable<String> |
testIAMPermissions(Iterable<String> permissions)
Tests for the given permissions on this backup for the caller.
|
Backup.Builder |
toBuilder() |
void |
updateExpireTime()
Updates the expire time of this backup on Cloud Spanner.
|
equals, getDatabase, getEncryptionConfig, getEncryptionInfo, getExpireTime, getId, getInstanceId, getMaxExpireTime, getProto, getReferencingBackups, getSize, getState, getVersionTime, hashCode, toString
public OperationFuture<Backup,CreateBackupMetadata> create()
Backup
instance.public boolean exists()
true
if a backup with the id of this Backup
exists on Cloud
Spanner.public boolean isReady()
true
if this backup is ready to use. The value returned by this method
could be out-of-sync with the value returned by BackupInfo.getState()
, as this method will make a
round-trip to the server and return a value based on the response from the server.public Backup reload() throws SpannerException
Backup
instance. It does not
update this instance.SpannerException
public void delete() throws SpannerException
SpannerException
public void updateExpireTime()
Backup
does not have
an expire time, the method will throw an IllegalStateException
.public OperationFuture<Database,RestoreDatabaseMetadata> restore(DatabaseId database)
public Page<Operation> listBackupOperations()
Backup
.public com.google.cloud.Policy getIAMPolicy()
Policy
for this backup.public com.google.cloud.Policy setIAMPolicy(com.google.cloud.Policy policy)
Policy.Builder#setEtag(String)
for information on the recommended read-modify-write
cycle.public Iterable<String> testIAMPermissions(Iterable<String> permissions)
permissions
- the permissions to test for. Permissions with wildcards (such as '*',
'spanner.*', 'spanner.instances.*') are not allowed.public Backup.Builder toBuilder()
Copyright © 2022 Google LLC. All rights reserved.