Struct SqlInstancesService

Source
pub struct SqlInstancesService { /* private fields */ }
Expand description

Implements a client for the Cloud SQL Admin API.

§Example

let client = SqlInstancesService::builder().build().await?;
// use `client` to make requests to the Cloud SQL Admin API.

§Service Description

Service to manage Cloud SQL instances.

§Configuration

To configure SqlInstancesService use the with_* methods in the type returned by builder(). The default configuration should work for most applications. Common configuration changes include

  • with_endpoint(): by default this client uses the global default endpoint (https://sqladmin.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default.
  • with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.

§Pooling and Cloning

SqlInstancesService holds a connection pool internally, it is advised to create one and the reuse it. You do not need to wrap SqlInstancesService in an Rc or Arc to reuse it, because it already uses an Arc internally.

Implementations§

Source§

impl SqlInstancesService

Source

pub fn builder() -> ClientBuilder

Returns a builder for SqlInstancesService.

let client = SqlInstancesService::builder().build().await?;
Source

pub fn from_stub<T>(stub: T) -> Self
where T: SqlInstancesService + 'static,

Creates a new client from the provided stub.

The most common case for calling this function is in tests mocking the client’s behavior.

Source

pub fn add_server_ca(&self) -> AddServerCa

Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. For instances that have enabled Certificate Authority Service (CAS) based server CA, please use AddServerCertificate to add a new server certificate.

Source

pub fn clone(&self) -> Clone

Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.

Source

pub fn delete(&self) -> Delete

Deletes a Cloud SQL instance.

Source

pub fn demote_master(&self) -> DemoteMaster

Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.

Source

pub fn demote(&self) -> Demote

Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.

Source

pub fn export(&self) -> Export

Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.

Source

pub fn failover(&self) -> Failover

Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.

Source

pub fn reencrypt(&self) -> Reencrypt

Reencrypt CMEK instance with latest key version.

Source

pub fn get(&self) -> Get

Retrieves a resource containing information about a Cloud SQL instance.

Source

pub fn import(&self) -> Import

Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.

Source

pub fn insert(&self) -> Insert

Creates a new Cloud SQL instance.

Source

pub fn list(&self) -> List

Lists instances under a given project.

Source

pub fn list_server_cas(&self) -> ListServerCas

Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.

Source

pub fn patch(&self) -> Patch

Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.

Source

pub fn promote_replica(&self) -> PromoteReplica

Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.

Source

pub fn switchover(&self) -> Switchover

Switches over from the primary instance to the designated DR replica instance.

Source

pub fn reset_ssl_config(&self) -> ResetSslConfig

Deletes all client certificates and generates a new server SSL certificate for the instance.

Source

pub fn restart(&self) -> Restart

Restarts a Cloud SQL instance.

Source

pub fn restore_backup(&self) -> RestoreBackup

Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.

Source

pub fn rotate_server_ca(&self) -> RotateServerCa

Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. For instances that have enabled Certificate Authority Service (CAS) based server CA, please use RotateServerCertificate to rotate the server certificate.

Source

pub fn start_replica(&self) -> StartReplica

Starts the replication in the read replica instance.

Source

pub fn stop_replica(&self) -> StopReplica

Stops the replication in the read replica instance.

Source

pub fn truncate_log(&self) -> TruncateLog

Truncate MySQL general and slow query log tables MySQL only.

Source

pub fn update(&self) -> Update

Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.

Source

pub fn create_ephemeral(&self) -> CreateEphemeral

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

Source

pub fn reschedule_maintenance(&self) -> RescheduleMaintenance

Reschedules the maintenance on the given instance.

Source

pub fn verify_external_sync_settings(&self) -> VerifyExternalSyncSettings

Verify External primary instance external sync settings.

Source

pub fn start_external_sync(&self) -> StartExternalSync

Start External primary instance migration.

Source

pub fn perform_disk_shrink(&self) -> PerformDiskShrink

Perform Disk Shrink on primary instance.

Source

pub fn get_disk_shrink_config(&self) -> GetDiskShrinkConfig

Get Disk Shrink Config for a given instance.

Source

pub fn reset_replica_size(&self) -> ResetReplicaSize

Reset Replica Size to primary instance disk size.

Source

pub fn get_latest_recovery_time(&self) -> GetLatestRecoveryTime

Get Latest Recovery Time for a given instance.

Source

pub fn acquire_ssrs_lease(&self) -> AcquireSsrsLease

Acquire a lease for the setup of SQL Server Reporting Services (SSRS).

Source

pub fn release_ssrs_lease(&self) -> ReleaseSsrsLease

Release a lease for the setup of SQL Server Reporting Services (SSRS).

Trait Implementations§

Source§

impl Clone for SqlInstancesService

Source§

fn clone(&self) -> SqlInstancesService

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
Source§

impl Debug for SqlInstancesService

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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,