pub struct DatabaseAdminClient { /* private fields */ }
Implementations§
Source§impl DatabaseAdminClient
impl DatabaseAdminClient
pub fn new(channel: Channel, lro_client: OperationsClient) -> Self
Sourcepub async fn list_databases(
&self,
req: ListDatabasesRequest,
retry: Option<RetrySetting>,
) -> Result<Vec<Database>, Status>
pub async fn list_databases( &self, req: ListDatabasesRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Database>, Status>
list_databases lists Cloud Spanner databases.
Sourcepub async fn create_database(
&self,
req: CreateDatabaseRequest,
retry: Option<RetrySetting>,
) -> Result<Operation<Database>, Status>
pub async fn create_database( &self, req: CreateDatabaseRequest, retry: Option<RetrySetting>, ) -> Result<Operation<Database>, Status>
create_database 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 field type is CreateDatabaseMetadata. The response field type is Database, if successful.
Sourcepub async fn get_database(
&self,
req: GetDatabaseRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Database>, Status>
pub async fn get_database( &self, req: GetDatabaseRequest, retry: Option<RetrySetting>, ) -> Result<Response<Database>, Status>
get_database gets the state of a Cloud Spanner database.
Sourcepub async fn update_database_ddl(
&self,
req: UpdateDatabaseDdlRequest,
retry: Option<RetrySetting>,
) -> Result<Operation<()>, Status>
pub async fn update_database_ddl( &self, req: UpdateDatabaseDdlRequest, retry: Option<RetrySetting>, ) -> Result<Operation<()>, Status>
update_database_ddl 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 field type is UpdateDatabaseDdlMetadata. The operation has no response.
Sourcepub async fn drop_database(
&self,
req: DropDatabaseRequest,
retry: Option<RetrySetting>,
) -> Result<Response<()>, Status>
pub async fn drop_database( &self, req: DropDatabaseRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>
drop_database drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their expire_time.
Sourcepub async fn get_database_ddl(
&self,
req: GetDatabaseDdlRequest,
retry: Option<RetrySetting>,
) -> Result<Response<GetDatabaseDdlResponse>, Status>
pub async fn get_database_ddl( &self, req: GetDatabaseDdlRequest, retry: Option<RetrySetting>, ) -> Result<Response<GetDatabaseDdlResponse>, Status>
get_database_ddl 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.
Sourcepub async fn set_iam_policy(
&self,
req: SetIamPolicyRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Policy>, Status>
pub async fn set_iam_policy( &self, req: SetIamPolicyRequest, retry: Option<RetrySetting>, ) -> Result<Response<Policy>, Status>
set_iam_policy 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.
Sourcepub async fn get_iam_policy(
&self,
req: GetIamPolicyRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Policy>, Status>
pub async fn get_iam_policy( &self, req: GetIamPolicyRequest, retry: Option<RetrySetting>, ) -> Result<Response<Policy>, Status>
get_iam_policy 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.
Sourcepub async fn test_iam_permissions(
&self,
req: TestIamPermissionsRequest,
retry: Option<RetrySetting>,
) -> Result<Response<TestIamPermissionsResponse>, Status>
pub async fn test_iam_permissions( &self, req: TestIamPermissionsRequest, retry: Option<RetrySetting>, ) -> Result<Response<TestIamPermissionsResponse>, Status>
test_iam_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
Sourcepub async fn create_backup(
&self,
req: CreateBackupRequest,
retry: Option<RetrySetting>,
) -> Result<Operation<Backup>, Status>
pub async fn create_backup( &self, req: CreateBackupRequest, retry: Option<RetrySetting>, ) -> Result<Operation<Backup>, Status>
create_backup starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/
Sourcepub async fn get_backup(
&self,
req: GetBackupRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Backup>, Status>
pub async fn get_backup( &self, req: GetBackupRequest, retry: Option<RetrySetting>, ) -> Result<Response<Backup>, Status>
get_backup gets metadata on a pending or completed Backup.
Sourcepub async fn update_backup(
&self,
req: UpdateBackupRequest,
retry: Option<RetrySetting>,
) -> Result<Response<Backup>, Status>
pub async fn update_backup( &self, req: UpdateBackupRequest, retry: Option<RetrySetting>, ) -> Result<Response<Backup>, Status>
update_backup updates a pending or completed Backup.
Sourcepub async fn delete_backup(
&self,
req: DeleteBackupRequest,
retry: Option<RetrySetting>,
) -> Result<Response<()>, Status>
pub async fn delete_backup( &self, req: DeleteBackupRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>
delete_backup deletes a pending or completed Backup.
Sourcepub async fn list_backups(
&self,
req: ListBackupsRequest,
retry: Option<RetrySetting>,
) -> Result<Vec<Backup>, Status>
pub async fn list_backups( &self, req: ListBackupsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Backup>, Status>
list_backups lists completed and pending backups. Backups returned are ordered by create_time in descending order, starting from the most recent create_time.
Sourcepub async fn restore_database(
&self,
req: RestoreDatabaseRequest,
retry: Option<RetrySetting>,
) -> Result<Operation<Database>, Status>
pub async fn restore_database( &self, req: RestoreDatabaseRequest, retry: Option<RetrySetting>, ) -> Result<Operation<Database>, Status>
restore_database 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/
Sourcepub async fn list_backup_operations(
&self,
req: ListBackupOperationsRequest,
retry: Option<RetrySetting>,
) -> Result<Vec<InternalOperation>, Status>
pub async fn list_backup_operations( &self, req: ListBackupOperationsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<InternalOperation>, Status>
list_backup_operations lists the backup [long-running operations][google.longrunning.Operation] in
the given instance. A backup operation has a name of the form
projects/
Sourcepub async fn list_database_operations(
&self,
req: ListDatabaseOperationsRequest,
retry: Option<RetrySetting>,
) -> Result<Vec<InternalOperation>, Status>
pub async fn list_database_operations( &self, req: ListDatabaseOperationsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<InternalOperation>, Status>
list_database_operations lists database [longrunning-operations][google.longrunning.Operation].
A database operation has a name of the form
projects/
Trait Implementations§
Source§impl Clone for DatabaseAdminClient
impl Clone for DatabaseAdminClient
Source§fn clone(&self) -> DatabaseAdminClient
fn clone(&self) -> DatabaseAdminClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !Freeze for DatabaseAdminClient
impl !RefUnwindSafe for DatabaseAdminClient
impl Send for DatabaseAdminClient
impl Sync for DatabaseAdminClient
impl Unpin for DatabaseAdminClient
impl !UnwindSafe for DatabaseAdminClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request