Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::spanner_admin::DatabaseAdminClient Class Reference

Cloud Spanner Database Admin API. More...

#include <google/cloud/spanner/admin/database_admin_client.h>

Public Member Functions

 DatabaseAdminClient (std::shared_ptr< DatabaseAdminConnection > connection, Options opts={})
 
 ~DatabaseAdminClient ()
 
StreamRange< google::spanner::admin::database::v1::Database > ListDatabases (std::string const &parent, Options opts={})
 Lists Cloud Spanner databases. More...
 
StreamRange< google::spanner::admin::database::v1::Database > ListDatabases (google::spanner::admin::database::v1::ListDatabasesRequest request, Options opts={})
 Lists Cloud Spanner databases. More...
 
future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase (std::string const &parent, std::string const &create_statement, Options opts={})
 Creates a new Cloud Spanner database and starts to prepare it for serving. More...
 
future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase (google::spanner::admin::database::v1::CreateDatabaseRequest const &request, Options opts={})
 Creates a new Cloud Spanner database and starts to prepare it for serving. More...
 
StatusOr< google::spanner::admin::database::v1::Database > GetDatabase (std::string const &name, Options opts={})
 Gets the state of a Cloud Spanner database. More...
 
StatusOr< google::spanner::admin::database::v1::Database > GetDatabase (google::spanner::admin::database::v1::GetDatabaseRequest const &request, Options opts={})
 Gets the state of a Cloud Spanner database. More...
 
future< StatusOr< google::spanner::admin::database::v1::Database > > UpdateDatabase (google::spanner::admin::database::v1::Database const &database, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates a Cloud Spanner database. More...
 
future< StatusOr< google::spanner::admin::database::v1::Database > > UpdateDatabase (google::spanner::admin::database::v1::UpdateDatabaseRequest const &request, Options opts={})
 Updates a Cloud Spanner database. More...
 
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabaseDdl (std::string const &database, std::vector< std::string > const &statements, Options opts={})
 Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. More...
 
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabaseDdl (google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const &request, Options opts={})
 Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. More...
 
Status DropDatabase (std::string const &database, Options opts={})
 Drops (aka deletes) a Cloud Spanner database. More...
 
Status DropDatabase (google::spanner::admin::database::v1::DropDatabaseRequest const &request, Options opts={})
 Drops (aka deletes) a Cloud Spanner database. More...
 
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl (std::string const &database, Options opts={})
 Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. More...
 
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl (google::spanner::admin::database::v1::GetDatabaseDdlRequest const &request, Options opts={})
 Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. More...
 
StatusOr< google::iam::v1::Policy > SetIamPolicy (std::string const &resource, google::iam::v1::Policy const &policy, Options opts={})
 Sets the access control policy on a database or backup resource. More...
 
StatusOr< google::iam::v1::Policy > SetIamPolicy (std::string const &resource, IamUpdater const &updater, Options opts={})
 Updates the IAM policy for resource using an optimistic concurrency control loop. More...
 
StatusOr< google::iam::v1::Policy > SetIamPolicy (google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
 Sets the access control policy on a database or backup resource. More...
 
StatusOr< google::iam::v1::Policy > GetIamPolicy (std::string const &resource, Options opts={})
 Gets the access control policy for a database or backup resource. More...
 
StatusOr< google::iam::v1::Policy > GetIamPolicy (google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
 Gets the access control policy for a database or backup resource. More...
 
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions (std::string const &resource, std::vector< std::string > const &permissions, Options opts={})
 Returns permissions that the caller has on the specified database or backup resource. More...
 
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions (google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
 Returns permissions that the caller has on the specified database or backup resource. More...
 
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup (std::string const &parent, google::spanner::admin::database::v1::Backup const &backup, std::string const &backup_id, Options opts={})
 Starts creating a new Cloud Spanner Backup. More...
 
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup (google::spanner::admin::database::v1::CreateBackupRequest const &request, Options opts={})
 Starts creating a new Cloud Spanner Backup. More...
 
future< StatusOr< google::spanner::admin::database::v1::Backup > > CopyBackup (std::string const &parent, std::string const &backup_id, std::string const &source_backup, google::protobuf::Timestamp const &expire_time, Options opts={})
 Starts copying a Cloud Spanner Backup. More...
 
future< StatusOr< google::spanner::admin::database::v1::Backup > > CopyBackup (google::spanner::admin::database::v1::CopyBackupRequest const &request, Options opts={})
 Starts copying a Cloud Spanner Backup. More...
 
StatusOr< google::spanner::admin::database::v1::Backup > GetBackup (std::string const &name, Options opts={})
 Gets metadata on a pending or completed Backup. More...
 
StatusOr< google::spanner::admin::database::v1::Backup > GetBackup (google::spanner::admin::database::v1::GetBackupRequest const &request, Options opts={})
 Gets metadata on a pending or completed Backup. More...
 
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup (google::spanner::admin::database::v1::Backup const &backup, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates a pending or completed Backup. More...
 
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup (google::spanner::admin::database::v1::UpdateBackupRequest const &request, Options opts={})
 Updates a pending or completed Backup. More...
 
Status DeleteBackup (std::string const &name, Options opts={})
 Deletes a pending or completed Backup. More...
 
Status DeleteBackup (google::spanner::admin::database::v1::DeleteBackupRequest const &request, Options opts={})
 Deletes a pending or completed Backup. More...
 
StreamRange< google::spanner::admin::database::v1::Backup > ListBackups (std::string const &parent, Options opts={})
 Lists completed and pending backups. More...
 
StreamRange< google::spanner::admin::database::v1::Backup > ListBackups (google::spanner::admin::database::v1::ListBackupsRequest request, Options opts={})
 Lists completed and pending backups. More...
 
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase (std::string const &parent, std::string const &database_id, std::string const &backup, Options opts={})
 Create a new database by restoring from a completed backup. More...
 
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase (google::spanner::admin::database::v1::RestoreDatabaseRequest const &request, Options opts={})
 Create a new database by restoring from a completed backup. More...
 
StreamRange< google::longrunning::Operation > ListDatabaseOperations (std::string const &parent, Options opts={})
 Lists database longrunning-operations. More...
 
StreamRange< google::longrunning::Operation > ListDatabaseOperations (google::spanner::admin::database::v1::ListDatabaseOperationsRequest request, Options opts={})
 Lists database longrunning-operations. More...
 
StreamRange< google::longrunning::Operation > ListBackupOperations (std::string const &parent, Options opts={})
 Lists the backup long-running operations in the given instance. More...
 
StreamRange< google::longrunning::Operation > ListBackupOperations (google::spanner::admin::database::v1::ListBackupOperationsRequest request, Options opts={})
 Lists the backup long-running operations in the given instance. More...
 
StreamRange< google::spanner::admin::database::v1::DatabaseRole > ListDatabaseRoles (std::string const &parent, Options opts={})
 Lists Cloud Spanner database roles. More...
 
StreamRange< google::spanner::admin::database::v1::DatabaseRole > ListDatabaseRoles (google::spanner::admin::database::v1::ListDatabaseRolesRequest request, Options opts={})
 Lists Cloud Spanner database roles. More...
 
Copy and move support
 DatabaseAdminClient (DatabaseAdminClient const &)=default
 
DatabaseAdminClientoperator= (DatabaseAdminClient const &)=default
 
 DatabaseAdminClient (DatabaseAdminClient &&)=default
 
DatabaseAdminClientoperator= (DatabaseAdminClient &&)=default
 

Friends

Equality
bool operator== (DatabaseAdminClient const &a, DatabaseAdminClient const &b)
 
bool operator!= (DatabaseAdminClient const &a, DatabaseAdminClient const &b)
 

Detailed Description

Cloud Spanner Database Admin API.

The Cloud Spanner Database Admin API can be used to:

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructor & Destructor Documentation

◆ DatabaseAdminClient() [1/3]

google::cloud::spanner_admin::DatabaseAdminClient::DatabaseAdminClient ( std::shared_ptr< DatabaseAdminConnection connection,
Options  opts = {} 
)
explicit

◆ ~DatabaseAdminClient()

google::cloud::spanner_admin::DatabaseAdminClient::~DatabaseAdminClient ( )

◆ DatabaseAdminClient() [2/3]

google::cloud::spanner_admin::DatabaseAdminClient::DatabaseAdminClient ( DatabaseAdminClient const &  )
default

◆ DatabaseAdminClient() [3/3]

google::cloud::spanner_admin::DatabaseAdminClient::DatabaseAdminClient ( DatabaseAdminClient &&  )
default

Member Function Documentation

◆ CopyBackup() [1/2]

future< StatusOr< google::spanner::admin::database::v1::Backup > > google::cloud::spanner_admin::DatabaseAdminClient::CopyBackup ( google::spanner::admin::database::v1::CopyBackupRequest const &  request,
Options  opts = {} 
)

Starts copying a Cloud Spanner Backup.

The returned backup long-running operation will have a name of the format projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id> and can be used to track copying of the backup. The operation is associated with the destination backup. The metadata field type is CopyBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the copying and delete the backup. Concurrent CopyBackup requests can run on the same source backup.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.CopyBackupRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Backup proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ CopyBackup() [2/2]

future< StatusOr< google::spanner::admin::database::v1::Backup > > google::cloud::spanner_admin::DatabaseAdminClient::CopyBackup ( std::string const &  parent,
std::string const &  backup_id,
std::string const &  source_backup,
google::protobuf::Timestamp const &  expire_time,
Options  opts = {} 
)

Starts copying a Cloud Spanner Backup.

The returned backup long-running operation will have a name of the format projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id> and can be used to track copying of the backup. The operation is associated with the destination backup. The metadata field type is CopyBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the copying and delete the backup. Concurrent CopyBackup requests can run on the same source backup.

Parameters
parentRequired. The name of the destination instance that will contain the backup copy. Values are of the form: projects/<project>/instances/<instance>.
backup_idRequired. The id of the backup copy. The backup_id appended to parent forms the full backup_uri of the form projects/<project>/instances/<instance>/backups/<backup>.
source_backupRequired. 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>.
expire_timeRequired. 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 the expire_time has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Backup proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ CreateBackup() [1/2]

future< StatusOr< google::spanner::admin::database::v1::Backup > > google::cloud::spanner_admin::DatabaseAdminClient::CreateBackup ( google::spanner::admin::database::v1::CreateBackupRequest const &  request,
Options  opts = {} 
)

Starts creating a new Cloud Spanner Backup.

The returned backup long-running operation will have a name of the format projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id> and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.CreateBackupRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Backup proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ CreateBackup() [2/2]

future< StatusOr< google::spanner::admin::database::v1::Backup > > google::cloud::spanner_admin::DatabaseAdminClient::CreateBackup ( std::string const &  parent,
google::spanner::admin::database::v1::Backup const &  backup,
std::string const &  backup_id,
Options  opts = {} 
)

Starts creating a new Cloud Spanner Backup.

The returned backup long-running operation will have a name of the format projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id> and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently.

Parameters
parentRequired. 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>.
backupRequired. The backup to create.
backup_idRequired. The id of the backup to be created. The backup_id appended to parent forms the full backup name of the form projects/<project>/instances/<instance>/backups/<backup_id>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Backup proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ CreateDatabase() [1/2]

future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::DatabaseAdminClient::CreateDatabase ( google::spanner::admin::database::v1::CreateDatabaseRequest const &  request,
Options  opts = {} 
)

Creates a new Cloud Spanner database and starts to prepare it for serving.

The returned long-running operation will have a name of the format <database_name>/operations/<operation_id> and can be used to track preparation of the database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if successful.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.CreateDatabaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Database proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ CreateDatabase() [2/2]

future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::DatabaseAdminClient::CreateDatabase ( std::string const &  parent,
std::string const &  create_statement,
Options  opts = {} 
)

Creates a new Cloud Spanner database and starts to prepare it for serving.

The returned long-running operation will have a name of the format <database_name>/operations/<operation_id> and can be used to track preparation of the database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if successful.

Parameters
parentRequired. The name of the instance that will serve the new database. Values are of the form projects/<project>/instances/<instance>.
create_statementRequired. 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 (`).
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Database proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ DeleteBackup() [1/2]

Status google::cloud::spanner_admin::DatabaseAdminClient::DeleteBackup ( google::spanner::admin::database::v1::DeleteBackupRequest const &  request,
Options  opts = {} 
)

Deletes a pending or completed Backup.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.DeleteBackupRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ DeleteBackup() [2/2]

Status google::cloud::spanner_admin::DatabaseAdminClient::DeleteBackup ( std::string const &  name,
Options  opts = {} 
)

Deletes a pending or completed Backup.

Parameters
nameRequired. Name of the backup to delete. Values are of the form projects/<project>/instances/<instance>/backups/<backup>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ DropDatabase() [1/2]

Status google::cloud::spanner_admin::DatabaseAdminClient::DropDatabase ( google::spanner::admin::database::v1::DropDatabaseRequest const &  request,
Options  opts = {} 
)

Drops (aka deletes) a Cloud Spanner database.

Completed backups for the database will be retained according to their expire_time. Note: Cloud Spanner might continue to accept requests for a few seconds after the database has been deleted.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.DropDatabaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ DropDatabase() [2/2]

Status google::cloud::spanner_admin::DatabaseAdminClient::DropDatabase ( std::string const &  database,
Options  opts = {} 
)

Drops (aka deletes) a Cloud Spanner database.

Completed backups for the database will be retained according to their expire_time. Note: Cloud Spanner might continue to accept requests for a few seconds after the database has been deleted.

Parameters
databaseRequired. The database to be dropped.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ GetBackup() [1/2]

StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::DatabaseAdminClient::GetBackup ( google::spanner::admin::database::v1::GetBackupRequest const &  request,
Options  opts = {} 
)

Gets metadata on a pending or completed Backup.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.GetBackupRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.Backup) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetBackup() [2/2]

StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::DatabaseAdminClient::GetBackup ( std::string const &  name,
Options  opts = {} 
)

Gets metadata on a pending or completed Backup.

Parameters
nameRequired. Name of the backup. Values are of the form projects/<project>/instances/<instance>/backups/<backup>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.Backup) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetDatabase() [1/2]

StatusOr< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::DatabaseAdminClient::GetDatabase ( google::spanner::admin::database::v1::GetDatabaseRequest const &  request,
Options  opts = {} 
)

Gets the state of a Cloud Spanner database.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.GetDatabaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.Database) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetDatabase() [2/2]

StatusOr< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::DatabaseAdminClient::GetDatabase ( std::string const &  name,
Options  opts = {} 
)

Gets the state of a Cloud Spanner database.

Parameters
nameRequired. The name of the requested database. Values are of the form projects/<project>/instances/<instance>/databases/<database>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.Database) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetDatabaseDdl() [1/2]

StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > google::cloud::spanner_admin::DatabaseAdminClient::GetDatabaseDdl ( google::spanner::admin::database::v1::GetDatabaseDdlRequest const &  request,
Options  opts = {} 
)

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 Operations API.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.GetDatabaseDdlRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.GetDatabaseDdlResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetDatabaseDdl() [2/2]

StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > google::cloud::spanner_admin::DatabaseAdminClient::GetDatabaseDdl ( std::string const &  database,
Options  opts = {} 
)

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 Operations API.

Parameters
databaseRequired. The database whose schema we wish to get. Values are of the form projects/<project>/instances/<instance>/databases/<database>
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.GetDatabaseDdlResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetIamPolicy() [1/2]

StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::DatabaseAdminClient::GetIamPolicy ( google::iam::v1::GetIamPolicyRequest const &  request,
Options  opts = {} 
)

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 spanner.databases.getIamPolicy permission on resource. For backups, authorization requires spanner.backups.getIamPolicy permission on resource.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.GetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetIamPolicy() [2/2]

StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::DatabaseAdminClient::GetIamPolicy ( std::string const &  resource,
Options  opts = {} 
)

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 spanner.databases.getIamPolicy permission on resource. For backups, authorization requires spanner.backups.getIamPolicy permission on resource.

Parameters
resourceREQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ListBackupOperations() [1/2]

StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::DatabaseAdminClient::ListBackupOperations ( google::spanner::admin::database::v1::ListBackupOperationsRequest  request,
Options  opts = {} 
)

Lists the backup long-running operations in the given instance.

A backup operation has a name of the form projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by operation.metadata.value.progress.start_time in descending order starting from the most recently started operation.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.ListBackupOperationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListBackupOperations() [2/2]

StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::DatabaseAdminClient::ListBackupOperations ( std::string const &  parent,
Options  opts = {} 
)

Lists the backup long-running operations in the given instance.

A backup operation has a name of the form projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by operation.metadata.value.progress.start_time in descending order starting from the most recently started operation.

Parameters
parentRequired. The instance of the backup operations. Values are of the form projects/<project>/instances/<instance>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListBackups() [1/2]

StreamRange< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::DatabaseAdminClient::ListBackups ( google::spanner::admin::database::v1::ListBackupsRequest  request,
Options  opts = {} 
)

Lists completed and pending backups.

Backups returned are ordered by create_time in descending order, starting from the most recent create_time.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.ListBackupsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.database.v1.Backup, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListBackups() [2/2]

StreamRange< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::DatabaseAdminClient::ListBackups ( std::string const &  parent,
Options  opts = {} 
)

Lists completed and pending backups.

Backups returned are ordered by create_time in descending order, starting from the most recent create_time.

Parameters
parentRequired. The instance to list backups from. Values are of the form projects/<project>/instances/<instance>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.database.v1.Backup, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListDatabaseOperations() [1/2]

StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::DatabaseAdminClient::ListDatabaseOperations ( google::spanner::admin::database::v1::ListDatabaseOperationsRequest  request,
Options  opts = {} 
)

Lists database longrunning-operations.

A database operation has a name of the form projects/<project>/instances/<instance>/databases/<database>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.ListDatabaseOperationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListDatabaseOperations() [2/2]

StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::DatabaseAdminClient::ListDatabaseOperations ( std::string const &  parent,
Options  opts = {} 
)

Lists database longrunning-operations.

A database operation has a name of the form projects/<project>/instances/<instance>/databases/<database>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations.

Parameters
parentRequired. The instance of the database operations. Values are of the form projects/<project>/instances/<instance>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListDatabaseRoles() [1/2]

StreamRange< google::spanner::admin::database::v1::DatabaseRole > google::cloud::spanner_admin::DatabaseAdminClient::ListDatabaseRoles ( google::spanner::admin::database::v1::ListDatabaseRolesRequest  request,
Options  opts = {} 
)

Lists Cloud Spanner database roles.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.ListDatabaseRolesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.database.v1.DatabaseRole, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListDatabaseRoles() [2/2]

StreamRange< google::spanner::admin::database::v1::DatabaseRole > google::cloud::spanner_admin::DatabaseAdminClient::ListDatabaseRoles ( std::string const &  parent,
Options  opts = {} 
)

Lists Cloud Spanner database roles.

Parameters
parentRequired. The database whose roles should be listed. Values are of the form projects/<project>/instances/<instance>/databases/<database>/databaseRoles.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.database.v1.DatabaseRole, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListDatabases() [1/2]

StreamRange< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::DatabaseAdminClient::ListDatabases ( google::spanner::admin::database::v1::ListDatabasesRequest  request,
Options  opts = {} 
)

Lists Cloud Spanner databases.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.ListDatabasesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.database.v1.Database, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListDatabases() [2/2]

StreamRange< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::DatabaseAdminClient::ListDatabases ( std::string const &  parent,
Options  opts = {} 
)

Lists Cloud Spanner databases.

Parameters
parentRequired. The instance whose databases should be listed. Values are of the form projects/<project>/instances/<instance>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.database.v1.Database, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ operator=() [1/2]

DatabaseAdminClient & google::cloud::spanner_admin::DatabaseAdminClient::operator= ( DatabaseAdminClient &&  )
default

◆ operator=() [2/2]

DatabaseAdminClient & google::cloud::spanner_admin::DatabaseAdminClient::operator= ( DatabaseAdminClient const &  )
default

◆ RestoreDatabase() [1/2]

future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::DatabaseAdminClient::RestoreDatabase ( google::spanner::admin::database::v1::RestoreDatabaseRequest const &  request,
Options  opts = {} 
)

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 long-running operation has a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.RestoreDatabaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Database proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ RestoreDatabase() [2/2]

future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::DatabaseAdminClient::RestoreDatabase ( std::string const &  parent,
std::string const &  database_id,
std::string const &  backup,
Options  opts = {} 
)

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 long-running operation has a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete.

Parameters
parentRequired. 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>.
database_idRequired. The id of the database to create and restore to. This database must not already exist. The database_id appended to parent forms the full database name of the form projects/<project>/instances/<instance>/databases/<database_id>.
backupName of the backup from which to restore. Values are of the form projects/<project>/instances/<instance>/backups/<backup>.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Database proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ SetIamPolicy() [1/3]

StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::DatabaseAdminClient::SetIamPolicy ( google::iam::v1::SetIamPolicyRequest const &  request,
Options  opts = {} 
)

Sets the access control policy on a database or backup resource.

Replaces any existing policy.

Authorization requires spanner.databases.setIamPolicy permission on resource. For backups, authorization requires spanner.backups.setIamPolicy permission on resource.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.SetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ SetIamPolicy() [2/3]

StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::DatabaseAdminClient::SetIamPolicy ( std::string const &  resource,
google::iam::v1::Policy const &  policy,
Options  opts = {} 
)

Sets the access control policy on a database or backup resource.

Replaces any existing policy.

Authorization requires spanner.databases.setIamPolicy permission on resource. For backups, authorization requires spanner.backups.setIamPolicy permission on resource.

Parameters
resourceREQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
policyREQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ SetIamPolicy() [3/3]

StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::DatabaseAdminClient::SetIamPolicy ( std::string const &  resource,
IamUpdater const &  updater,
Options  opts = {} 
)

Updates the IAM policy for resource using an optimistic concurrency control loop.

The loop fetches the current policy for resource, and passes it to updater, which should return the new policy. This new policy should use the current etag so that the read-modify-write cycle can detect races and rerun the update when there is a mismatch. If the new policy does not have an etag, the existing policy will be blindly overwritten. If updater does not yield a policy, the control loop is terminated and kCancelled is returned.

Parameters
resourceRequired. The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
updaterRequired. Functor to map the current policy to a new one.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::iam::v1::Policy

◆ TestIamPermissions() [1/2]

StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::spanner_admin::DatabaseAdminClient::TestIamPermissions ( google::iam::v1::TestIamPermissionsRequest const &  request,
Options  opts = {} 
)

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 spanner.databases.list permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has spanner.backups.list permission on the containing instance.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.TestIamPermissionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ TestIamPermissions() [2/2]

StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::spanner_admin::DatabaseAdminClient::TestIamPermissions ( std::string const &  resource,
std::vector< std::string > const &  permissions,
Options  opts = {} 
)

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 spanner.databases.list permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has spanner.backups.list permission on the containing instance.

Parameters
resourceREQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
permissionsThe set of permissions to check for the resource. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see IAM Overview.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ UpdateBackup() [1/2]

StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::DatabaseAdminClient::UpdateBackup ( google::spanner::admin::database::v1::Backup const &  backup,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

Updates a pending or completed Backup.

Parameters
backupRequired. The backup to update. backup.name, and the fields to be updated as specified by update_mask are required. Other fields are ignored. Update is only supported for the following fields:
  • backup.expire_time.
update_maskRequired. 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.Backup) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ UpdateBackup() [2/2]

StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::DatabaseAdminClient::UpdateBackup ( google::spanner::admin::database::v1::UpdateBackupRequest const &  request,
Options  opts = {} 
)

Updates a pending or completed Backup.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.UpdateBackupRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.spanner.admin.database.v1.Backup) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ UpdateDatabase() [1/2]

future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::DatabaseAdminClient::UpdateDatabase ( google::spanner::admin::database::v1::Database const &  database,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

Updates a Cloud Spanner database.

The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returns NOT_FOUND.

While the operation is pending:

  • The database's reconciling field is set to true.
  • Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's cancel_time is set, the updates are reverted, and the operation terminates with a CANCELLED status.
  • New UpdateDatabase requests will return a FAILED_PRECONDITION error until the pending operation is done (returns successfully or with error).
  • Reading the database via the API continues to give the pre-request values.

Upon completion of the returned operation:

  • The new values are in effect and readable via the API.
  • The database's reconciling field becomes false.

The returned long-running operation will have a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id> and can be used to track the database modification. The metadata field type is UpdateDatabaseMetadata. The response field type is Database, if successful.

Parameters
databaseRequired. The database to update. The name field of the database is of the form projects/<project>/instances/<instance>/databases/<database>.
update_maskRequired. The list of fields to update. Currently, only enable_drop_protection field can be updated.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Database proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ UpdateDatabase() [2/2]

future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::DatabaseAdminClient::UpdateDatabase ( google::spanner::admin::database::v1::UpdateDatabaseRequest const &  request,
Options  opts = {} 
)

Updates a Cloud Spanner database.

The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returns NOT_FOUND.

While the operation is pending:

  • The database's reconciling field is set to true.
  • Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's cancel_time is set, the updates are reverted, and the operation terminates with a CANCELLED status.
  • New UpdateDatabase requests will return a FAILED_PRECONDITION error until the pending operation is done (returns successfully or with error).
  • Reading the database via the API continues to give the pre-request values.

Upon completion of the returned operation:

  • The new values are in effect and readable via the API.
  • The database's reconciling field becomes false.

The returned long-running operation will have a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id> and can be used to track the database modification. The metadata field type is UpdateDatabaseMetadata. The response field type is Database, if successful.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.UpdateDatabaseRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.Database proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ UpdateDatabaseDdl() [1/2]

future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > google::cloud::spanner_admin::DatabaseAdminClient::UpdateDatabaseDdl ( google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const &  request,
Options  opts = {} 
)

Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc.

The returned long-running operation will have a name of the format <database_name>/operations/<operation_id> and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.database.v1.UpdateDatabaseDdlRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

◆ UpdateDatabaseDdl() [2/2]

future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > google::cloud::spanner_admin::DatabaseAdminClient::UpdateDatabaseDdl ( std::string const &  database,
std::vector< std::string > const &  statements,
Options  opts = {} 
)

Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc.

The returned long-running operation will have a name of the format <database_name>/operations/<operation_id> and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response.

Parameters
databaseRequired. The database to update.
statementsRequired. DDL statements to be applied to the database.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
A `future` that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the `StatusOr` returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( DatabaseAdminClient const &  a,
DatabaseAdminClient const &  b 
)
friend

◆ operator==

bool operator== ( DatabaseAdminClient const &  a,
DatabaseAdminClient const &  b 
)
friend