pub struct SqlBackupsService { /* private fields */ }Expand description
Implements a client for the Cloud SQL Admin API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = SqlBackupsService::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_backups()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
§Configuration
To configure SqlBackupsService 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
SqlBackupsService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap SqlBackupsService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl SqlBackupsService
impl SqlBackupsService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for SqlBackupsService.
let client = SqlBackupsService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: SqlBackupsService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: SqlBackupsService + '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 create_backup(&self) -> CreateBackup
pub fn create_backup(&self) -> CreateBackup
Creates a backup for a Cloud SQL instance. This API can be used only to create on-demand backups.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &SqlBackupsService
) -> Result<()> {
let response = client.create_backup()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_backup(&self) -> GetBackup
pub fn get_backup(&self) -> GetBackup
Retrieves a resource containing information about a backup.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &SqlBackupsService, name: &str
) -> Result<()> {
let response = client.get_backup()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_backups(&self) -> ListBackups
pub fn list_backups(&self) -> ListBackups
Lists all backups associated with the project.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_sql_v1::Result;
async fn sample(
client: &SqlBackupsService, parent: &str
) -> Result<()> {
let mut list = client.list_backups()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn update_backup(&self) -> UpdateBackup
pub fn update_backup(&self) -> UpdateBackup
Updates the retention period and description of the backup. You can use this API to update final backups only.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &SqlBackupsService
) -> Result<()> {
let response = client.update_backup()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_backup(&self) -> DeleteBackup
pub fn delete_backup(&self) -> DeleteBackup
Deletes the backup.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &SqlBackupsService, name: &str
) -> Result<()> {
let response = client.delete_backup()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Trait Implementations§
Source§impl Clone for SqlBackupsService
impl Clone for SqlBackupsService
Source§fn clone(&self) -> SqlBackupsService
fn clone(&self) -> SqlBackupsService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more