Struct DatabaseAdminClient

Source
pub struct DatabaseAdminClient { /* private fields */ }

Implementations§

Source§

impl DatabaseAdminClient

Source

pub fn new(channel: Channel, lro_client: OperationsClient) -> Self

Source

pub async fn list_databases( &self, req: ListDatabasesRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Database>, Status>

list_databases lists Cloud Spanner databases.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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//instances//backups//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.

Source

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.

Source

pub async fn update_backup( &self, req: UpdateBackupRequest, retry: Option<RetrySetting>, ) -> Result<Response<Backup>, Status>

update_backup updates a pending or completed Backup.

Source

pub async fn delete_backup( &self, req: DeleteBackupRequest, retry: Option<RetrySetting>, ) -> Result<Response<()>, Status>

delete_backup deletes a pending or completed Backup.

Source

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.

Source

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//instances//databases//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.

Source

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//instances//backups//operations/. 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.

Source

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//instances//databases//operations/. 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.

Trait Implementations§

Source§

impl Clone for DatabaseAdminClient

Source§

fn clone(&self) -> DatabaseAdminClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,