pub struct BlueGreenDeploymentsService { /* private fields */ }Expand description
Implements a client for the Cloud SQL Admin API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
project_id: &str,
location_id: &str,
) -> anyhow::Result<()> {
let client = BlueGreenDeploymentsService::builder().build().await?;
let mut list = client.list_blue_green_deployments()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
Service for managing blue-green deployments.
§Configuration
To configure BlueGreenDeploymentsService 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 with Private Google Access with VPC Service Controls) may want to 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
BlueGreenDeploymentsService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap BlueGreenDeploymentsService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl BlueGreenDeploymentsService
impl BlueGreenDeploymentsService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for BlueGreenDeploymentsService.
let client = BlueGreenDeploymentsService::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: BlueGreenDeploymentsService + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: BlueGreenDeploymentsService + '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_blue_green_deployment(&self) -> CreateBlueGreenDeployment
pub fn create_blue_green_deployment(&self) -> CreateBlueGreenDeployment
Creates a blue-green deployment under a given project and location.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &BlueGreenDeploymentsService
) -> Result<()> {
let response = client.create_blue_green_deployment()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_blue_green_deployment(&self) -> GetBlueGreenDeployment
pub fn get_blue_green_deployment(&self) -> GetBlueGreenDeployment
Retrieves a blue-green deployment resource under a given project and location.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &BlueGreenDeploymentsService, project_id: &str, location_id: &str, blue_green_deployment_id: &str
) -> Result<()> {
let response = client.get_blue_green_deployment()
.set_name(format!("projects/{project_id}/locations/{location_id}/blueGreenDeployments/{blue_green_deployment_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn switchover_blue_green_deployment(&self) -> SwitchoverBlueGreenDeployment
pub fn switchover_blue_green_deployment(&self) -> SwitchoverBlueGreenDeployment
Switches over to green instance for a blue-green deployment.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &BlueGreenDeploymentsService
) -> Result<()> {
let response = client.switchover_blue_green_deployment()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_blue_green_deployments(&self) -> ListBlueGreenDeployments
pub fn list_blue_green_deployments(&self) -> ListBlueGreenDeployments
Lists blue-green deployments under a given project.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_sql_v1::Result;
async fn sample(
client: &BlueGreenDeploymentsService, project_id: &str, location_id: &str
) -> Result<()> {
let mut list = client.list_blue_green_deployments()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn delete_blue_green_deployment(&self) -> DeleteBlueGreenDeployment
pub fn delete_blue_green_deployment(&self) -> DeleteBlueGreenDeployment
Deletes a blue-green deployment.
§Example
use google_cloud_sql_v1::Result;
async fn sample(
client: &BlueGreenDeploymentsService, project_id: &str, location_id: &str, blue_green_deployment_id: &str
) -> Result<()> {
let response = client.delete_blue_green_deployment()
.set_name(format!("projects/{project_id}/locations/{location_id}/blueGreenDeployments/{blue_green_deployment_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}