pub struct DataplexService { /* private fields */ }Expand description
Implements a client for the Cloud Dataplex API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = DataplexService::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_lakes()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
Dataplex service provides data lakes as a service. The primary resources offered by this service are Lakes, Zones and Assets which collectively allow a data administrator to organize, manage, secure and catalog data across their organization located across cloud projects in a variety of storage systems including Cloud Storage and BigQuery.
§Configuration
To configure DataplexService 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://dataplex.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
DataplexService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap DataplexService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl DataplexService
impl DataplexService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for DataplexService.
let client = DataplexService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: DataplexService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: DataplexService + '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_lake(&self) -> CreateLake
pub fn create_lake(&self) -> CreateLake
Creates a lake resource.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::model::Lake;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let response = client.create_lake()
.set_parent(parent)
.set_lake_id("lake_id_value")
.set_lake(
Lake::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_lake(&self) -> UpdateLake
pub fn update_lake(&self) -> UpdateLake
Updates a lake resource.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_dataplex_v1::model::Lake;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.update_lake()
.set_lake(
Lake::new().set_name(name)/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_lake(&self) -> DeleteLake
pub fn delete_lake(&self) -> DeleteLake
Deletes a lake resource. All zones within the lake must be deleted before the lake can be deleted.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
client.delete_lake()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_lakes(&self) -> ListLakes
pub fn list_lakes(&self) -> ListLakes
Lists lake resources in a project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let mut list = client.list_lakes()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_lake(&self) -> GetLake
pub fn get_lake(&self) -> GetLake
Retrieves a lake resource.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.get_lake()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_lake_actions(&self) -> ListLakeActions
pub fn list_lake_actions(&self) -> ListLakeActions
Lists action resources in a lake.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let mut list = client.list_lake_actions()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn create_zone(&self) -> CreateZone
pub fn create_zone(&self) -> CreateZone
Creates a zone resource within a lake.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::model::Zone;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let response = client.create_zone()
.set_parent(parent)
.set_zone_id("zone_id_value")
.set_zone(
Zone::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_zone(&self) -> UpdateZone
pub fn update_zone(&self) -> UpdateZone
Updates a zone resource.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_dataplex_v1::model::Zone;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.update_zone()
.set_zone(
Zone::new().set_name(name)/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_zone(&self) -> DeleteZone
pub fn delete_zone(&self) -> DeleteZone
Deletes a zone resource. All assets within a zone must be deleted before the zone can be deleted.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
client.delete_zone()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_zones(&self) -> ListZones
pub fn list_zones(&self) -> ListZones
Lists zone resources in a lake.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let mut list = client.list_zones()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_zone(&self) -> GetZone
pub fn get_zone(&self) -> GetZone
Retrieves a zone resource.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.get_zone()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_zone_actions(&self) -> ListZoneActions
pub fn list_zone_actions(&self) -> ListZoneActions
Lists action resources in a zone.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let mut list = client.list_zone_actions()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn create_asset(&self) -> CreateAsset
pub fn create_asset(&self) -> CreateAsset
Creates an asset resource.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::model::Asset;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let response = client.create_asset()
.set_parent(parent)
.set_asset_id("asset_id_value")
.set_asset(
Asset::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_asset(&self) -> UpdateAsset
pub fn update_asset(&self) -> UpdateAsset
Updates an asset resource.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_dataplex_v1::model::Asset;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.update_asset()
.set_asset(
Asset::new().set_name(name)/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_asset(&self) -> DeleteAsset
pub fn delete_asset(&self) -> DeleteAsset
Deletes an asset resource. The referenced storage resource is detached (default) or deleted based on the associated Lifecycle policy.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
client.delete_asset()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_assets(&self) -> ListAssets
pub fn list_assets(&self) -> ListAssets
Lists asset resources in a zone.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let mut list = client.list_assets()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_asset(&self) -> GetAsset
pub fn get_asset(&self) -> GetAsset
Retrieves an asset resource.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.get_asset()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_asset_actions(&self) -> ListAssetActions
pub fn list_asset_actions(&self) -> ListAssetActions
Lists action resources in an asset.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let mut list = client.list_asset_actions()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn create_task(&self) -> CreateTask
pub fn create_task(&self) -> CreateTask
Creates a task resource within a lake.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::model::Task;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let response = client.create_task()
.set_parent(parent)
.set_task_id("task_id_value")
.set_task(
Task::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_task(&self) -> UpdateTask
pub fn update_task(&self) -> UpdateTask
Update the task resource.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_wkt::FieldMask;
use google_cloud_dataplex_v1::model::Task;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.update_task()
.set_task(
Task::new().set_name(name)/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_task(&self) -> DeleteTask
pub fn delete_task(&self) -> DeleteTask
Delete the task resource.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
§Example
use google_cloud_lro::Poller;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
client.delete_task()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_tasks(&self) -> ListTasks
pub fn list_tasks(&self) -> ListTasks
Lists tasks under the given lake.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let mut list = client.list_tasks()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_task(&self) -> GetTask
pub fn get_task(&self) -> GetTask
Get task resource.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.get_task()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_jobs(&self) -> ListJobs
pub fn list_jobs(&self) -> ListJobs
Lists Jobs under the given task.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, parent: &str
) -> Result<()> {
let mut list = client.list_jobs()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn run_task(&self) -> RunTask
pub fn run_task(&self) -> RunTask
Run an on demand execution of a Task.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let response = client.run_task()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_job(&self) -> GetJob
pub fn get_job(&self) -> GetJob
Get job resource.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService, name: &str
) -> Result<()> {
let response = client.get_job()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn cancel_job(&self) -> CancelJob
pub fn cancel_job(&self) -> CancelJob
Cancel jobs running for the task resource.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
client.cancel_job()
/* set fields */
.send().await?;
Ok(())
}Sourcepub fn list_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service. This method can be called in two ways:
- List all public locations: Use the path
GET /v1/locations. - List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public locations as well as private or other locations specifically visible to the project.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let mut list = client.list_locations()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_location(&self) -> GetLocation
pub fn get_location(&self) -> GetLocation
Gets information about a location.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let response = client.get_location()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn set_iam_policy(&self) -> SetIamPolicy
pub fn set_iam_policy(&self) -> SetIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
errors.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let response = client.set_iam_policy()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_iam_policy(&self) -> GetIamPolicy
pub fn get_iam_policy(&self) -> GetIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let response = client.get_iam_policy()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn test_iam_permissions(&self) -> TestIamPermissions
pub fn test_iam_permissions(&self) -> TestIamPermissions
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let response = client.test_iam_permissions()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let mut list = client.list_operations()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
let response = client.get_operation()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_operation(&self) -> DeleteOperation
pub fn delete_operation(&self) -> DeleteOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
client.delete_operation()
/* set fields */
.send().await?;
Ok(())
}Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_dataplex_v1::Result;
async fn sample(
client: &DataplexService
) -> Result<()> {
client.cancel_operation()
/* set fields */
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for DataplexService
impl Clone for DataplexService
Source§fn clone(&self) -> DataplexService
fn clone(&self) -> DataplexService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more