Struct InstanceAdminClient

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

Implementations§

Source§

impl InstanceAdminClient

Source

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

Source

pub async fn list_instance_configs( &self, req: ListInstanceConfigsRequest, retry: Option<RetrySetting>, ) -> Result<Vec<InstanceConfig>, Status>

list_instance_configs lists the supported instance configurations for a given project.

Source

pub async fn get_instance_config( &self, req: GetInstanceConfigRequest, retry: Option<RetrySetting>, ) -> Result<InstanceConfig, Status>

get_instance_config gets information about a particular instance configuration.

Source

pub async fn list_instances( &self, req: ListInstancesRequest, retry: Option<RetrySetting>, ) -> Result<Vec<Instance>, Status>

list_instances lists all instances in the given project.

Source

pub async fn get_instance( &self, req: GetInstanceRequest, retry: Option<RetrySetting>, ) -> Result<Response<Instance>, Status>

gets information about a particular instance.

Source

pub async fn create_instance( &self, req: CreateInstanceRequest, retry: Option<RetrySetting>, ) -> Result<Operation<Instance>, Status>

create_instance creates an instance and begins preparing it to begin serving. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, CreateInstance returns ALREADY_EXISTS.

Immediately upon completion of this request:

The instance is readable via the API, with all requested attributes but no allocated resources. Its state is CREATING.

Until completion of the returned operation:

Cancelling the operation renders the instance immediately unreadable via the API.

The instance can be deleted.

All other attempts to modify the instance are rejected.

Upon completion of the returned operation:

Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).

Databases can be created in the instance.

The instance’s allocated resource levels are readable via the API.

The instance’s state becomes READY.

The returned [long-running operation][google.longrunning.Operation] will have a name of the format <instance_name>/operations/<operation_id> and can be used to track creation of the instance. The metadata field type is CreateInstanceMetadata. The response field type is Instance, if successful.

Source

pub async fn update_instance( &self, req: UpdateInstanceRequest, retry: Option<RetrySetting>, ) -> Result<Operation<Instance>, Status>

update_instance updates an instance, and begins allocating or releasing resources as requested. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of updating the instance. If the named instance does not exist, returns NOT_FOUND.

Immediately upon completion of this request:

For resource types for which a decrease in the instance’s allocation has been requested, billing is based on the newly-requested level.

Until completion of the returned operation:

Cancelling the operation sets its metadata’s cancel_time, and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a CANCELLED status.

All other attempts to modify the instance are rejected.

Reading the instance via the API continues to give the pre-request resource levels.

Upon completion of the returned operation:

Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).

All newly-reserved resources are available for serving the instance’s tables.

The instance’s new resource levels are readable via the API.

The returned [long-running operation][google.longrunning.Operation] will have a name of the format <instance_name>/operations/<operation_id> and can be used to track the instance modification. The metadata field type is UpdateInstanceMetadata. The response field type is Instance, if successful.

Authorization requires spanner.instances.update permission on resource [name][google.spanner.admin.instance.v1.Instance.name (at http://google.spanner.admin.instance.v1.Instance.name)].

Source

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

DeleteInstance deletes an instance.

Immediately upon completion of the request:

Billing ceases for all of the instance’s reserved resources.

Soon afterward:

The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.

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 an instance resource. Replaces any existing policy.

Authorization requires spanner.instances.setIamPolicy on resource.

Source

pub async fn get_iam_policy( &self, req: GetIamPolicyRequest, retry: Option<RetrySetting>, ) -> Result<Response<Policy>, Status>

get_iam_policy sets the access control policy on an instance resource. Replaces any existing policy.

Authorization requires spanner.instances.setIamPolicy 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 instance resource.

Attempting this RPC on a non-existent Cloud Spanner instance resource will result in a NOT_FOUND error if the user has spanner.instances.list permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions.

Trait Implementations§

Source§

impl Clone for InstanceAdminClient

Source§

fn clone(&self) -> InstanceAdminClient

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,