Google Cloud Spanner C++ Client
1.32.0
A C++ Client Library for Google Cloud Spanner
|
Cloud Spanner Database Admin API. More...
#include <google/cloud/spanner/admin/database_admin_client.h>
Public Member Functions | |
DatabaseAdminClient (std::shared_ptr< DatabaseAdminConnection > connection) | |
~DatabaseAdminClient () | |
DatabaseAdminClient (DatabaseAdminClient const &)=default | |
DatabaseAdminClient & | operator= (DatabaseAdminClient const &)=default |
DatabaseAdminClient (DatabaseAdminClient &&)=default | |
DatabaseAdminClient & | operator= (DatabaseAdminClient &&)=default |
StreamRange< google::spanner::admin::database::v1::Database > | ListDatabases (std::string const &parent) |
Lists Cloud Spanner databases. More... | |
future< StatusOr< google::spanner::admin::database::v1::Database > > | CreateDatabase (std::string const &parent, std::string const &create_statement) |
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) |
Gets the state of a Cloud Spanner database. More... | |
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > | UpdateDatabaseDdl (std::string const &database, std::vector< std::string > const &statements) |
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. More... | |
Status | DropDatabase (std::string const &database) |
Drops (aka deletes) a Cloud Spanner database. More... | |
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > | GetDatabaseDdl (std::string const &database) |
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) |
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 options={}) |
Updates the IAM policy for resource using an optimistic concurrency control loop. More... | |
StatusOr< google::iam::v1::Policy > | GetIamPolicy (std::string const &resource) |
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) |
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) |
Starts creating a new Cloud Spanner Backup. More... | |
StatusOr< google::spanner::admin::database::v1::Backup > | GetBackup (std::string const &name) |
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. More... | |
StatusOr< google::spanner::admin::database::v1::Backup > | UpdateBackup (google::spanner::admin::database::v1::Backup const &backup, google::protobuf::FieldMask const &update_mask) |
Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. More... | |
Status | DeleteBackup (std::string const &name) |
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. More... | |
StreamRange< google::spanner::admin::database::v1::Backup > | ListBackups (std::string const &parent) |
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) |
Create a new database by restoring from a completed backup. More... | |
StreamRange< google::longrunning::Operation > | ListDatabaseOperations (std::string const &parent) |
Lists database [longrunning-operations][google.longrunning.Operation]. More... | |
StreamRange< google::longrunning::Operation > | ListBackupOperations (std::string const &parent) |
Lists the backup [long-running operations][google.longrunning.Operation] in the given instance. More... | |
StreamRange< google::spanner::admin::database::v1::Database > | ListDatabases (google::spanner::admin::database::v1::ListDatabasesRequest request) |
Lists Cloud Spanner databases. More... | |
future< StatusOr< google::spanner::admin::database::v1::Database > > | CreateDatabase (google::spanner::admin::database::v1::CreateDatabaseRequest const &request) |
Creates a new Cloud Spanner database and starts to prepare it for serving. More... | |
StatusOr< google::spanner::admin::database::v1::Database > | GetDatabase (google::spanner::admin::database::v1::GetDatabaseRequest const &request) |
Gets the state of a Cloud Spanner database. More... | |
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > | UpdateDatabaseDdl (google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const &request) |
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. More... | |
Status | DropDatabase (google::spanner::admin::database::v1::DropDatabaseRequest const &request) |
Drops (aka deletes) a Cloud Spanner database. More... | |
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > | GetDatabaseDdl (google::spanner::admin::database::v1::GetDatabaseDdlRequest const &request) |
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. More... | |
StatusOr< google::iam::v1::Policy > | SetIamPolicy (google::iam::v1::SetIamPolicyRequest const &request) |
Sets the access control policy on a database or backup resource. More... | |
StatusOr< google::iam::v1::Policy > | GetIamPolicy (google::iam::v1::GetIamPolicyRequest const &request) |
Gets the access control policy for a database or backup resource. More... | |
StatusOr< google::iam::v1::TestIamPermissionsResponse > | TestIamPermissions (google::iam::v1::TestIamPermissionsRequest const &request) |
Returns permissions that the caller has on the specified database or backup resource. More... | |
future< StatusOr< google::spanner::admin::database::v1::Backup > > | CreateBackup (google::spanner::admin::database::v1::CreateBackupRequest const &request) |
Starts creating a new Cloud Spanner Backup. More... | |
StatusOr< google::spanner::admin::database::v1::Backup > | GetBackup (google::spanner::admin::database::v1::GetBackupRequest const &request) |
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. More... | |
StatusOr< google::spanner::admin::database::v1::Backup > | UpdateBackup (google::spanner::admin::database::v1::UpdateBackupRequest const &request) |
Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. More... | |
Status | DeleteBackup (google::spanner::admin::database::v1::DeleteBackupRequest const &request) |
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. More... | |
StreamRange< google::spanner::admin::database::v1::Backup > | ListBackups (google::spanner::admin::database::v1::ListBackupsRequest request) |
Lists completed and pending backups. More... | |
future< StatusOr< google::spanner::admin::database::v1::Database > > | RestoreDatabase (google::spanner::admin::database::v1::RestoreDatabaseRequest const &request) |
Create a new database by restoring from a completed backup. More... | |
StreamRange< google::longrunning::Operation > | ListDatabaseOperations (google::spanner::admin::database::v1::ListDatabaseOperationsRequest request) |
Lists database [longrunning-operations][google.longrunning.Operation]. More... | |
StreamRange< google::longrunning::Operation > | ListBackupOperations (google::spanner::admin::database::v1::ListBackupOperationsRequest request) |
Lists the backup [long-running operations][google.longrunning.Operation] in the given instance. More... | |
Friends | |
bool | operator== (DatabaseAdminClient const &a, DatabaseAdminClient const &b) |
bool | operator!= (DatabaseAdminClient const &a, DatabaseAdminClient const &b) |
Cloud Spanner Database Admin API.
The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also enables updating the schema of pre-existing databases. It can be also used to create, delete and list backups for a database and to restore from an existing backup.
Definition at line 45 of file database_admin_client.h.
|
explicit |
Definition at line 30 of file database_admin_client.cc.
|
default |
|
default |
|
default |
future< StatusOr< google::spanner::admin::database::v1::Backup > > google::cloud::spanner_admin::v1::DatabaseAdminClient::CreateBackup | ( | google::spanner::admin::database::v1::CreateBackupRequest const & | request | ) |
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The [response][google.longrunning.Operation.response] field type is [Backup][google.spanner.admin.database.v1.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.
request | google::spanner::admin::database::v1::CreateBackupRequest |
Definition at line 253 of file database_admin_client.cc.
future< StatusOr< google::spanner::admin::database::v1::Backup > > google::cloud::spanner_admin::v1::DatabaseAdminClient::CreateBackup | ( | std::string const & | parent, |
google::spanner::admin::database::v1::Backup const & | backup, | ||
std::string const & | backup_id | ||
) |
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The [response][google.longrunning.Operation.response] field type is [Backup][google.spanner.admin.database.v1.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.
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> . |
backup | Required. The backup to create. |
backup_id | Required. 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> . |
Definition at line 131 of file database_admin_client.cc.
future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::v1::DatabaseAdminClient::CreateDatabase | ( | google::spanner::admin::database::v1::CreateDatabaseRequest const & | request | ) |
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The [response][google.longrunning.Operation.response] field type is [Database][google.spanner.admin.database.v1.Database], if successful.
request | google::spanner::admin::database::v1::CreateDatabaseRequest |
Definition at line 204 of file database_admin_client.cc.
future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::v1::DatabaseAdminClient::CreateDatabase | ( | std::string const & | parent, |
std::string const & | create_statement | ||
) |
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The [response][google.longrunning.Operation.response] field type is [Database][google.spanner.admin.database.v1.Database], if successful.
parent | Required. The name of the instance that will serve the new database. Values are of the form projects/<project>/instances/<instance> . |
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 (` ). |
Definition at line 43 of file database_admin_client.cc.
Status google::cloud::spanner_admin::v1::DatabaseAdminClient::DeleteBackup | ( | google::spanner::admin::database::v1::DeleteBackupRequest const & | request | ) |
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
request | google::spanner::admin::database::v1::DeleteBackupRequest |
Definition at line 270 of file database_admin_client.cc.
Status google::cloud::spanner_admin::v1::DatabaseAdminClient::DeleteBackup | ( | std::string const & | name | ) |
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
name | Required. Name of the backup to delete. Values are of the form projects/<project>/instances/<instance>/backups/<backup> . |
Definition at line 159 of file database_admin_client.cc.
Status google::cloud::spanner_admin::v1::DatabaseAdminClient::DropDatabase | ( | google::spanner::admin::database::v1::DropDatabaseRequest const & | request | ) |
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their expire_time
.
request | google::spanner::admin::database::v1::DropDatabaseRequest |
Definition at line 224 of file database_admin_client.cc.
Status google::cloud::spanner_admin::v1::DatabaseAdminClient::DropDatabase | ( | std::string const & | database | ) |
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their expire_time
.
database | Required. The database to be dropped. |
Definition at line 68 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetBackup | ( | google::spanner::admin::database::v1::GetBackupRequest const & | request | ) |
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
request | google::spanner::admin::database::v1::GetBackupRequest |
Definition at line 259 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetBackup | ( | std::string const & | name | ) |
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
name | Required. Name of the backup. Values are of the form projects/<project>/instances/<instance>/backups/<backup> . |
Definition at line 143 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetDatabase | ( | google::spanner::admin::database::v1::GetDatabaseRequest const & | request | ) |
Gets the state of a Cloud Spanner database.
request | google::spanner::admin::database::v1::GetDatabaseRequest |
Definition at line 211 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetDatabase | ( | std::string const & | name | ) |
Gets the state of a Cloud Spanner database.
name | Required. The name of the requested database. Values are of the form projects/<project>/instances/<instance>/databases/<database> . |
Definition at line 52 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetDatabaseDdl | ( | google::spanner::admin::database::v1::GetDatabaseDdlRequest const & | request | ) |
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][google.longrunning.Operations] API.
request | google::spanner::admin::database::v1::GetDatabaseDdlRequest |
Definition at line 230 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetDatabaseDdl | ( | std::string const & | database | ) |
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][google.longrunning.Operations] API.
database | Required. The database whose schema we wish to get. Values are of the form projects/<project>/instances/<instance>/databases/<database> |
Definition at line 75 of file database_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetIamPolicy | ( | google::iam::v1::GetIamPolicyRequest const & | request | ) |
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][google.iam.v1.GetIamPolicyRequest.resource]. For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
request | google::iam::v1::GetIamPolicyRequest |
Definition at line 241 of file database_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::DatabaseAdminClient::GetIamPolicy | ( | std::string const & | resource | ) |
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][google.iam.v1.GetIamPolicyRequest.resource]. For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
resource | REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
Definition at line 114 of file database_admin_client.cc.
StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListBackupOperations | ( | google::spanner::admin::database::v1::ListBackupOperationsRequest | request | ) |
Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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.
request | google::spanner::admin::database::v1::ListBackupOperationsRequest |
Definition at line 296 of file database_admin_client.cc.
StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListBackupOperations | ( | std::string const & | parent | ) |
Lists the backup [long-running operations][google.longrunning.Operation] 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][google.longrunning.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.
parent | Required. The instance of the backup operations. Values are of the form projects/<project>/instances/<instance> . |
Definition at line 191 of file database_admin_client.cc.
StreamRange< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListBackups | ( | google::spanner::admin::database::v1::ListBackupsRequest | request | ) |
Lists completed and pending backups.
Backups returned are ordered by create_time
in descending order, starting from the most recent create_time
.
request | google::spanner::admin::database::v1::ListBackupsRequest |
Definition at line 276 of file database_admin_client.cc.
StreamRange< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListBackups | ( | std::string const & | parent | ) |
Lists completed and pending backups.
Backups returned are ordered by create_time
in descending order, starting from the most recent create_time
.
parent | Required. The instance to list backups from. Values are of the form projects/<project>/instances/<instance> . |
Definition at line 166 of file database_admin_client.cc.
StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListDatabaseOperations | ( | google::spanner::admin::database::v1::ListDatabaseOperationsRequest | request | ) |
Lists database [longrunning-operations][google.longrunning.Operation].
A database operation has a name of the form projects/<project>/instances/<instance>/databases/<database>/operations/<operation>
. The long-running operation [metadata][google.longrunning.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.
request | google::spanner::admin::database::v1::ListDatabaseOperationsRequest |
Definition at line 289 of file database_admin_client.cc.
StreamRange< google::longrunning::Operation > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListDatabaseOperations | ( | std::string const & | parent | ) |
Lists database [longrunning-operations][google.longrunning.Operation].
A database operation has a name of the form projects/<project>/instances/<instance>/databases/<database>/operations/<operation>
. The long-running operation [metadata][google.longrunning.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.
parent | Required. The instance of the database operations. Values are of the form projects/<project>/instances/<instance> . |
Definition at line 184 of file database_admin_client.cc.
StreamRange< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListDatabases | ( | google::spanner::admin::database::v1::ListDatabasesRequest | request | ) |
Lists Cloud Spanner databases.
request | google::spanner::admin::database::v1::ListDatabasesRequest |
Definition at line 198 of file database_admin_client.cc.
StreamRange< google::spanner::admin::database::v1::Database > google::cloud::spanner_admin::v1::DatabaseAdminClient::ListDatabases | ( | std::string const & | parent | ) |
Lists Cloud Spanner databases.
parent | Required. The instance whose databases should be listed. Values are of the form projects/<project>/instances/<instance> . |
Definition at line 36 of file database_admin_client.cc.
|
default |
|
default |
future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::v1::DatabaseAdminClient::RestoreDatabase | ( | google::spanner::admin::database::v1::RestoreDatabaseRequest const & | request | ) |
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][google.longrunning.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][google.longrunning.Operation.metadata] field type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The [response][google.longrunning.Operation.response] type is [Database][google.spanner.admin.database.v1.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.
request | google::spanner::admin::database::v1::RestoreDatabaseRequest |
Definition at line 282 of file database_admin_client.cc.
future< StatusOr< google::spanner::admin::database::v1::Database > > google::cloud::spanner_admin::v1::DatabaseAdminClient::RestoreDatabase | ( | std::string const & | parent, |
std::string const & | database_id, | ||
std::string const & | backup | ||
) |
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][google.longrunning.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][google.longrunning.Operation.metadata] field type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. The [response][google.longrunning.Operation.response] type is [Database][google.spanner.admin.database.v1.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.
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> . |
database_id | Required. 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> . |
backup | Name of the backup from which to restore. Values are of the form projects/<project>/instances/<instance>/backups/<backup> . |
Definition at line 173 of file database_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::DatabaseAdminClient::SetIamPolicy | ( | google::iam::v1::SetIamPolicyRequest const & | request | ) |
Sets the access control policy on a database or backup resource.
Replaces any existing policy.
Authorization requires spanner.databases.setIamPolicy
permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. For backups, authorization requires spanner.backups.setIamPolicy
permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
request | google::iam::v1::SetIamPolicyRequest |
Definition at line 236 of file database_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::DatabaseAdminClient::SetIamPolicy | ( | std::string const & | resource, |
google::iam::v1::Policy const & | policy | ||
) |
Sets the access control policy on a database or backup resource.
Replaces any existing policy.
Authorization requires spanner.databases.setIamPolicy
permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. For backups, authorization requires spanner.backups.setIamPolicy
permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
resource | REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | REQUIRED: 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. |
Definition at line 81 of file database_admin_client.cc.
StatusOr< google::iam::v1::Policy > google::cloud::spanner_admin::v1::DatabaseAdminClient::SetIamPolicy | ( | std::string const & | resource, |
IamUpdater const & | updater, | ||
Options | options = {} |
||
) |
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.
resource | Required. The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
updater | Required. Functor to map the current policy to a new one. |
options | Optional. Options to control the loop. Expected options are: |
Definition at line 89 of file database_admin_client.cc.
StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::spanner_admin::v1::DatabaseAdminClient::TestIamPermissions | ( | google::iam::v1::TestIamPermissionsRequest const & | request | ) |
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.
request | google::iam::v1::TestIamPermissionsRequest |
Definition at line 247 of file database_admin_client.cc.
StatusOr< google::iam::v1::TestIamPermissionsResponse > google::cloud::spanner_admin::v1::DatabaseAdminClient::TestIamPermissions | ( | std::string const & | resource, |
std::vector< std::string > const & | permissions | ||
) |
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.
resource | REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | 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. |
Definition at line 122 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::v1::DatabaseAdminClient::UpdateBackup | ( | google::spanner::admin::database::v1::Backup const & | backup, |
google::protobuf::FieldMask const & | update_mask | ||
) |
Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
backup | Required. 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:
|
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. |
Definition at line 150 of file database_admin_client.cc.
StatusOr< google::spanner::admin::database::v1::Backup > google::cloud::spanner_admin::v1::DatabaseAdminClient::UpdateBackup | ( | google::spanner::admin::database::v1::UpdateBackupRequest const & | request | ) |
Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
request | google::spanner::admin::database::v1::UpdateBackupRequest |
Definition at line 265 of file database_admin_client.cc.
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > google::cloud::spanner_admin::v1::DatabaseAdminClient::UpdateDatabaseDdl | ( | google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const & | request | ) |
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc.
The returned [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
request | google::spanner::admin::database::v1::UpdateDatabaseDdlRequest |
Definition at line 218 of file database_admin_client.cc.
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > google::cloud::spanner_admin::v1::DatabaseAdminClient::UpdateDatabaseDdl | ( | std::string const & | database, |
std::vector< std::string > const & | statements | ||
) |
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc.
The returned [long-running operation][google.longrunning.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][google.longrunning.Operation.metadata] field type is [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
database | Required. The database to update. |
statements | Required. DDL statements to be applied to the database. |
Definition at line 60 of file database_admin_client.cc.
|
friend |
Definition at line 65 of file database_admin_client.h.
|
friend |
Definition at line 61 of file database_admin_client.h.