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
impl SqlInstancesService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for SqlInstancesService.
let client = SqlInstancesService::builder().build().await?;
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: SqlInstancesService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
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.
Sourcepub fn add_server_ca(&self) -> AddServerCa
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.
Sourcepub fn clone(&self) -> Clone
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.
Sourcepub fn demote_master(&self) -> DemoteMaster
pub fn demote_master(&self) -> DemoteMaster
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
Sourcepub fn demote(&self) -> Demote
pub fn demote(&self) -> Demote
Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
Sourcepub fn export(&self) -> Export
pub fn export(&self) -> Export
Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
Sourcepub fn failover(&self) -> Failover
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.
Sourcepub fn get(&self) -> Get
pub fn get(&self) -> Get
Retrieves a resource containing information about a Cloud SQL instance.
Sourcepub fn import(&self) -> Import
pub fn import(&self) -> Import
Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
Sourcepub fn list_server_cas(&self) -> ListServerCas
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.
Sourcepub fn patch(&self) -> Patch
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.
Sourcepub fn promote_replica(&self) -> PromoteReplica
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.
Sourcepub fn switchover(&self) -> Switchover
pub fn switchover(&self) -> Switchover
Switches over from the primary instance to the designated DR replica instance.
Sourcepub fn reset_ssl_config(&self) -> ResetSslConfig
pub fn reset_ssl_config(&self) -> ResetSslConfig
Deletes all client certificates and generates a new server SSL certificate for the instance.
Sourcepub fn restore_backup(&self) -> RestoreBackup
pub fn restore_backup(&self) -> RestoreBackup
Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
Sourcepub fn rotate_server_ca(&self) -> RotateServerCa
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.
Sourcepub fn start_replica(&self) -> StartReplica
pub fn start_replica(&self) -> StartReplica
Starts the replication in the read replica instance.
Sourcepub fn stop_replica(&self) -> StopReplica
pub fn stop_replica(&self) -> StopReplica
Stops the replication in the read replica instance.
Sourcepub fn truncate_log(&self) -> TruncateLog
pub fn truncate_log(&self) -> TruncateLog
Truncate MySQL general and slow query log tables MySQL only.
Sourcepub fn update(&self) -> Update
pub fn update(&self) -> Update
Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
Sourcepub fn create_ephemeral(&self) -> CreateEphemeral
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.
Sourcepub fn reschedule_maintenance(&self) -> RescheduleMaintenance
pub fn reschedule_maintenance(&self) -> RescheduleMaintenance
Reschedules the maintenance on the given instance.
Sourcepub fn verify_external_sync_settings(&self) -> VerifyExternalSyncSettings
pub fn verify_external_sync_settings(&self) -> VerifyExternalSyncSettings
Verify External primary instance external sync settings.
Sourcepub fn start_external_sync(&self) -> StartExternalSync
pub fn start_external_sync(&self) -> StartExternalSync
Start External primary instance migration.
Sourcepub fn perform_disk_shrink(&self) -> PerformDiskShrink
pub fn perform_disk_shrink(&self) -> PerformDiskShrink
Perform Disk Shrink on primary instance.
Sourcepub fn get_disk_shrink_config(&self) -> GetDiskShrinkConfig
pub fn get_disk_shrink_config(&self) -> GetDiskShrinkConfig
Get Disk Shrink Config for a given instance.
Sourcepub fn reset_replica_size(&self) -> ResetReplicaSize
pub fn reset_replica_size(&self) -> ResetReplicaSize
Reset Replica Size to primary instance disk size.
Sourcepub fn get_latest_recovery_time(&self) -> GetLatestRecoveryTime
pub fn get_latest_recovery_time(&self) -> GetLatestRecoveryTime
Get Latest Recovery Time for a given instance.
Sourcepub fn acquire_ssrs_lease(&self) -> AcquireSsrsLease
pub fn acquire_ssrs_lease(&self) -> AcquireSsrsLease
Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
Sourcepub fn release_ssrs_lease(&self) -> ReleaseSsrsLease
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
impl Clone for SqlInstancesService
Source§fn clone(&self) -> SqlInstancesService
fn clone(&self) -> SqlInstancesService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more