public class Instance extends InstanceInfo
Instance
adds a layer of service related
functionality over InstanceInfo
.Modifier and Type | Class and Description |
---|---|
static class |
Instance.Builder
Builder of
Instance . |
InstanceInfo.InstanceField, InstanceInfo.State
Modifier and Type | Method and Description |
---|---|
OperationFuture<Database,CreateDatabaseMetadata> |
createDatabase(String databaseId,
Iterable<String> statements)
Creates a new database in this instance.
|
void |
delete() |
Backup |
getBackup(String backupId)
Returns the backup with the given id on this instance.
|
Database |
getDatabase(String databaseId) |
com.google.cloud.Policy |
getIAMPolicy()
Returns the IAM
Policy for this instance. |
Page<Operation> |
listBackupOperations(Options.ListOption... options)
Returns the long-running backup operations on this instance.
|
Page<Backup> |
listBackups(Options.ListOption... options)
Returns the backups belonging to this instance.
|
Page<Operation> |
listDatabaseOperations(Options.ListOption... options)
Returns the long-running database operations on this instance.
|
Page<Database> |
listDatabases(Options.ListOption... options) |
Instance |
reload() |
com.google.cloud.Policy |
setIAMPolicy(com.google.cloud.Policy policy)
Updates the IAM policy for this instance and returns the resulting policy.
|
Iterable<String> |
testIAMPermissions(Iterable<String> permissions)
Tests for the given permissions on this instance for the caller.
|
Instance.Builder |
toBuilder() |
OperationFuture<Instance,UpdateInstanceMetadata> |
update(InstanceInfo.InstanceField... fieldsToUpdate) |
equals, getDisplayName, getId, getInstanceConfigId, getLabels, getNodeCount, getProcessingUnits, getState, hashCode, newBuilder, toString
public Instance reload()
public void delete()
public OperationFuture<Instance,UpdateInstanceMetadata> update(InstanceInfo.InstanceField... fieldsToUpdate)
public Page<Database> listDatabases(Options.ListOption... options)
public OperationFuture<Database,CreateDatabaseMetadata> createDatabase(String databaseId, Iterable<String> statements) throws SpannerException
databaseId
- the id of the database which will be created. It must conform to the regular
expression [a-z][a-z0-9_\-]*[a-z0-9] and be between 2 and 30 characters in lengthstatements
- DDL statements to run while creating the database, for example CREATE
TABLE MyTable ( ... )
. This should not include CREATE DATABASE
statement.SpannerException
public Page<Backup> listBackups(Options.ListOption... options)
public Backup getBackup(String backupId)
public Page<Operation> listDatabaseOperations(Options.ListOption... options)
public Page<Operation> listBackupOperations(Options.ListOption... options)
public com.google.cloud.Policy getIAMPolicy()
Policy
for this instance.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 Instance.Builder toBuilder()
toBuilder
in class InstanceInfo
Copyright © 2022 Google LLC. All rights reserved.