pub struct MigrationService { /* private fields */ }Expand description
Implements a client for the BigQuery Migration API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = MigrationService::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_migration_workflows()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
Service to handle EDW migrations.
§Configuration
To configure MigrationService 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://bigquerymigration.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
MigrationService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap MigrationService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl MigrationService
impl MigrationService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for MigrationService.
let client = MigrationService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: MigrationService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: MigrationService + '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_migration_workflow(&self) -> CreateMigrationWorkflow
pub fn create_migration_workflow(&self) -> CreateMigrationWorkflow
Creates a migration workflow.
§Example
use google_cloud_bigquery_migration_v2::model::MigrationWorkflow;
use google_cloud_bigquery_migration_v2::Result;
async fn sample(
client: &MigrationService, parent: &str
) -> Result<()> {
let response = client.create_migration_workflow()
.set_parent(parent)
.set_migration_workflow(
MigrationWorkflow::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_migration_workflow(&self) -> GetMigrationWorkflow
pub fn get_migration_workflow(&self) -> GetMigrationWorkflow
Gets a previously created migration workflow.
§Example
use google_cloud_bigquery_migration_v2::Result;
async fn sample(
client: &MigrationService, name: &str
) -> Result<()> {
let response = client.get_migration_workflow()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_migration_workflows(&self) -> ListMigrationWorkflows
pub fn list_migration_workflows(&self) -> ListMigrationWorkflows
Lists previously created migration workflow.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_bigquery_migration_v2::Result;
async fn sample(
client: &MigrationService, parent: &str
) -> Result<()> {
let mut list = client.list_migration_workflows()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn delete_migration_workflow(&self) -> DeleteMigrationWorkflow
pub fn delete_migration_workflow(&self) -> DeleteMigrationWorkflow
Deletes a migration workflow by name.
§Example
use google_cloud_bigquery_migration_v2::Result;
async fn sample(
client: &MigrationService, name: &str
) -> Result<()> {
client.delete_migration_workflow()
.set_name(name)
.send().await?;
Ok(())
}Sourcepub fn start_migration_workflow(&self) -> StartMigrationWorkflow
pub fn start_migration_workflow(&self) -> StartMigrationWorkflow
Starts a previously created migration workflow. I.e., the state transitions from DRAFT to RUNNING. This is a no-op if the state is already RUNNING. An error will be signaled if the state is anything other than DRAFT or RUNNING.
§Example
use google_cloud_bigquery_migration_v2::Result;
async fn sample(
client: &MigrationService
) -> Result<()> {
client.start_migration_workflow()
/* set fields */
.send().await?;
Ok(())
}Sourcepub fn get_migration_subtask(&self) -> GetMigrationSubtask
pub fn get_migration_subtask(&self) -> GetMigrationSubtask
Gets a previously created migration subtask.
§Example
use google_cloud_bigquery_migration_v2::Result;
async fn sample(
client: &MigrationService, name: &str
) -> Result<()> {
let response = client.get_migration_subtask()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_migration_subtasks(&self) -> ListMigrationSubtasks
pub fn list_migration_subtasks(&self) -> ListMigrationSubtasks
Lists previously created migration subtasks.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_bigquery_migration_v2::Result;
async fn sample(
client: &MigrationService, parent: &str
) -> Result<()> {
let mut list = client.list_migration_subtasks()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Trait Implementations§
Source§impl Clone for MigrationService
impl Clone for MigrationService
Source§fn clone(&self) -> MigrationService
fn clone(&self) -> MigrationService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more