pub struct Mirroring { /* private fields */ }Expand description
Implements a client for the Network Security API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
project_id: &str,
location_id: &str,
) -> anyhow::Result<()> {
let client = Mirroring::builder().build().await?;
let mut list = client.list_mirroring_endpoint_groups()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
PM2 is the “out-of-band” flavor of the Network Security Integrations product.
§Configuration
To configure Mirroring 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://networksecurity.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
Mirroring holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap Mirroring in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Mirroring
impl Mirroring
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Mirroring.
let client = Mirroring::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: Mirroring + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: Mirroring + '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 list_mirroring_endpoint_groups(&self) -> ListMirroringEndpointGroups
pub fn list_mirroring_endpoint_groups(&self) -> ListMirroringEndpointGroups
Lists endpoint groups in a given project and location. See https://google.aip.dev/132.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let mut list = client.list_mirroring_endpoint_groups()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_mirroring_endpoint_group(&self) -> GetMirroringEndpointGroup
pub fn get_mirroring_endpoint_group(&self) -> GetMirroringEndpointGroup
Gets a specific endpoint group. See https://google.aip.dev/131.
§Example
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_endpoint_group_id: &str
) -> Result<()> {
let response = client.get_mirroring_endpoint_group()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_mirroring_endpoint_group(&self) -> CreateMirroringEndpointGroup
pub fn create_mirroring_endpoint_group(&self) -> CreateMirroringEndpointGroup
Creates an endpoint group in a given project and location. See https://google.aip.dev/133.
§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_networksecurity_v1::model::MirroringEndpointGroup;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let response = client.create_mirroring_endpoint_group()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.set_mirroring_endpoint_group(
MirroringEndpointGroup::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_mirroring_endpoint_group(&self) -> UpdateMirroringEndpointGroup
pub fn update_mirroring_endpoint_group(&self) -> UpdateMirroringEndpointGroup
Updates an endpoint group. See https://google.aip.dev/134.
§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_networksecurity_v1::model::MirroringEndpointGroup;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_endpoint_group_id: &str
) -> Result<()> {
let response = client.update_mirroring_endpoint_group()
.set_mirroring_endpoint_group(
MirroringEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"))/* 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_mirroring_endpoint_group(&self) -> DeleteMirroringEndpointGroup
pub fn delete_mirroring_endpoint_group(&self) -> DeleteMirroringEndpointGroup
Deletes an endpoint group. See https://google.aip.dev/135.
§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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_endpoint_group_id: &str
) -> Result<()> {
client.delete_mirroring_endpoint_group()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"))
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_mirroring_endpoint_group_associations(
&self,
) -> ListMirroringEndpointGroupAssociations
pub fn list_mirroring_endpoint_group_associations( &self, ) -> ListMirroringEndpointGroupAssociations
Lists associations in a given project and location. See https://google.aip.dev/132.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let mut list = client.list_mirroring_endpoint_group_associations()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_mirroring_endpoint_group_association(
&self,
) -> GetMirroringEndpointGroupAssociation
pub fn get_mirroring_endpoint_group_association( &self, ) -> GetMirroringEndpointGroupAssociation
Gets a specific association. See https://google.aip.dev/131.
§Example
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_endpoint_group_association_id: &str
) -> Result<()> {
let response = client.get_mirroring_endpoint_group_association()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_mirroring_endpoint_group_association(
&self,
) -> CreateMirroringEndpointGroupAssociation
pub fn create_mirroring_endpoint_group_association( &self, ) -> CreateMirroringEndpointGroupAssociation
Creates an association in a given project and location. See https://google.aip.dev/133.
§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_networksecurity_v1::model::MirroringEndpointGroupAssociation;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let response = client.create_mirroring_endpoint_group_association()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.set_mirroring_endpoint_group_association(
MirroringEndpointGroupAssociation::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_mirroring_endpoint_group_association(
&self,
) -> UpdateMirroringEndpointGroupAssociation
pub fn update_mirroring_endpoint_group_association( &self, ) -> UpdateMirroringEndpointGroupAssociation
Updates an association. See https://google.aip.dev/134.
§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_networksecurity_v1::model::MirroringEndpointGroupAssociation;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_endpoint_group_association_id: &str
) -> Result<()> {
let response = client.update_mirroring_endpoint_group_association()
.set_mirroring_endpoint_group_association(
MirroringEndpointGroupAssociation::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"))/* 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_mirroring_endpoint_group_association(
&self,
) -> DeleteMirroringEndpointGroupAssociation
pub fn delete_mirroring_endpoint_group_association( &self, ) -> DeleteMirroringEndpointGroupAssociation
Deletes an association. See https://google.aip.dev/135.
§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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_endpoint_group_association_id: &str
) -> Result<()> {
client.delete_mirroring_endpoint_group_association()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"))
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_mirroring_deployment_groups(&self) -> ListMirroringDeploymentGroups
pub fn list_mirroring_deployment_groups(&self) -> ListMirroringDeploymentGroups
Lists deployment groups in a given project and location. See https://google.aip.dev/132.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let mut list = client.list_mirroring_deployment_groups()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_mirroring_deployment_group(&self) -> GetMirroringDeploymentGroup
pub fn get_mirroring_deployment_group(&self) -> GetMirroringDeploymentGroup
Gets a specific deployment group. See https://google.aip.dev/131.
§Example
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_deployment_group_id: &str
) -> Result<()> {
let response = client.get_mirroring_deployment_group()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_mirroring_deployment_group(
&self,
) -> CreateMirroringDeploymentGroup
pub fn create_mirroring_deployment_group( &self, ) -> CreateMirroringDeploymentGroup
Creates a deployment group in a given project and location. See https://google.aip.dev/133.
§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_networksecurity_v1::model::MirroringDeploymentGroup;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let response = client.create_mirroring_deployment_group()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.set_mirroring_deployment_group(
MirroringDeploymentGroup::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_mirroring_deployment_group(
&self,
) -> UpdateMirroringDeploymentGroup
pub fn update_mirroring_deployment_group( &self, ) -> UpdateMirroringDeploymentGroup
Updates a deployment group. See https://google.aip.dev/134.
§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_networksecurity_v1::model::MirroringDeploymentGroup;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_deployment_group_id: &str
) -> Result<()> {
let response = client.update_mirroring_deployment_group()
.set_mirroring_deployment_group(
MirroringDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"))/* 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_mirroring_deployment_group(
&self,
) -> DeleteMirroringDeploymentGroup
pub fn delete_mirroring_deployment_group( &self, ) -> DeleteMirroringDeploymentGroup
Deletes a deployment group. See https://google.aip.dev/135.
§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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_deployment_group_id: &str
) -> Result<()> {
client.delete_mirroring_deployment_group()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"))
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_mirroring_deployments(&self) -> ListMirroringDeployments
pub fn list_mirroring_deployments(&self) -> ListMirroringDeployments
Lists deployments in a given project and location. See https://google.aip.dev/132.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let mut list = client.list_mirroring_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 get_mirroring_deployment(&self) -> GetMirroringDeployment
pub fn get_mirroring_deployment(&self) -> GetMirroringDeployment
Gets a specific deployment. See https://google.aip.dev/131.
§Example
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_deployment_id: &str
) -> Result<()> {
let response = client.get_mirroring_deployment()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_mirroring_deployment(&self) -> CreateMirroringDeployment
pub fn create_mirroring_deployment(&self) -> CreateMirroringDeployment
Creates a deployment in a given project and location. See https://google.aip.dev/133.
§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_networksecurity_v1::model::MirroringDeployment;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str
) -> Result<()> {
let response = client.create_mirroring_deployment()
.set_parent(format!("projects/{project_id}/locations/{location_id}"))
.set_mirroring_deployment(
MirroringDeployment::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_mirroring_deployment(&self) -> UpdateMirroringDeployment
pub fn update_mirroring_deployment(&self) -> UpdateMirroringDeployment
Updates a deployment. See https://google.aip.dev/134.
§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_networksecurity_v1::model::MirroringDeployment;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_deployment_id: &str
) -> Result<()> {
let response = client.update_mirroring_deployment()
.set_mirroring_deployment(
MirroringDeployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"))/* 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_mirroring_deployment(&self) -> DeleteMirroringDeployment
pub fn delete_mirroring_deployment(&self) -> DeleteMirroringDeployment
Deletes a deployment. See https://google.aip.dev/135.
§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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring, project_id: &str, location_id: &str, mirroring_deployment_id: &str
) -> Result<()> {
client.delete_mirroring_deployment()
.set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"))
.poller().until_done().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 lists locations based on the resource scope provided in the [ListLocationsRequest.name] field:
- Global locations: If
nameis empty, the method lists the public locations available to all projects. * Project-specific locations: Ifnamefollows the formatprojects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is
passed as the name field. For direct service calls, the resource
name is
incorporated into the request path based on the specific service
implementation and version.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> 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_networksecurity_v1::Result;
async fn sample(
client: &Mirroring
) -> Result<()> {
client.cancel_operation()
/* set fields */
.send().await?;
Ok(())
}