pub struct Config { /* private fields */ }Expand description
Implements a client for the Infrastructure Manager API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = Config::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_deployments()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
Infrastructure Manager is a managed service that automates the deployment and management of Google Cloud infrastructure resources.
§Configuration
To configure Config 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://config.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
Config holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap Config in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Config
impl Config
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Config.
let client = Config::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Config + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Config + '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_deployments(&self) -> ListDeployments
pub fn list_deployments(&self) -> ListDeployments
Lists Deployments in a given project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let mut list = client.list_deployments()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_deployment(&self) -> GetDeployment
pub fn get_deployment(&self) -> GetDeployment
Gets details about a Deployment.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.get_deployment()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_deployment(&self) -> CreateDeployment
pub fn create_deployment(&self) -> CreateDeployment
Creates a Deployment.
§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_config_v1::model::Deployment;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let response = client.create_deployment()
.set_parent(parent)
.set_deployment_id("deployment_id_value")
.set_deployment(
Deployment::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_deployment(&self) -> UpdateDeployment
pub fn update_deployment(&self) -> UpdateDeployment
Updates a Deployment.
§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_config_v1::model::Deployment;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.update_deployment()
.set_deployment(
Deployment::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_deployment(&self) -> DeleteDeployment
pub fn delete_deployment(&self) -> DeleteDeployment
Deletes a Deployment.
§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_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.delete_deployment()
.set_name(name)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_revisions(&self) -> ListRevisions
pub fn list_revisions(&self) -> ListRevisions
Lists Revisions of a deployment.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let mut list = client.list_revisions()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_revision(&self) -> GetRevision
pub fn get_revision(&self) -> GetRevision
Sourcepub fn get_resource(&self) -> GetResource
pub fn get_resource(&self) -> GetResource
Sourcepub fn list_resources(&self) -> ListResources
pub fn list_resources(&self) -> ListResources
Lists Resources in a given revision.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let mut list = client.list_resources()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn export_deployment_statefile(&self) -> ExportDeploymentStatefile
pub fn export_deployment_statefile(&self) -> ExportDeploymentStatefile
Exports Terraform state file from a given deployment.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config
) -> Result<()> {
let response = client.export_deployment_statefile()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn export_revision_statefile(&self) -> ExportRevisionStatefile
pub fn export_revision_statefile(&self) -> ExportRevisionStatefile
Exports Terraform state file from a given revision.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config
) -> Result<()> {
let response = client.export_revision_statefile()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn import_statefile(&self) -> ImportStatefile
pub fn import_statefile(&self) -> ImportStatefile
Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config
) -> Result<()> {
let response = client.import_statefile()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_statefile(&self) -> DeleteStatefile
pub fn delete_statefile(&self) -> DeleteStatefile
Deletes Terraform state file in a given deployment.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
client.delete_statefile()
.set_name(name)
.send().await?;
Ok(())
}Sourcepub fn lock_deployment(&self) -> LockDeployment
pub fn lock_deployment(&self) -> LockDeployment
Locks a deployment.
§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_config_v1::Result;
async fn sample(
client: &Config
) -> Result<()> {
let response = client.lock_deployment()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn unlock_deployment(&self) -> UnlockDeployment
pub fn unlock_deployment(&self) -> UnlockDeployment
Unlocks a locked deployment.
§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_config_v1::Result;
async fn sample(
client: &Config
) -> Result<()> {
let response = client.unlock_deployment()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn export_lock_info(&self) -> ExportLockInfo
pub fn export_lock_info(&self) -> ExportLockInfo
Exports the lock info on a locked deployment.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config
) -> Result<()> {
let response = client.export_lock_info()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_preview(&self) -> CreatePreview
pub fn create_preview(&self) -> CreatePreview
Creates a Preview.
§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_config_v1::model::Preview;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let response = client.create_preview()
.set_parent(parent)
.set_preview_id("preview_id_value")
.set_preview(
Preview::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_preview(&self) -> GetPreview
pub fn get_preview(&self) -> GetPreview
Sourcepub fn list_previews(&self) -> ListPreviews
pub fn list_previews(&self) -> ListPreviews
Lists Previews in a given project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let mut list = client.list_previews()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn delete_preview(&self) -> DeletePreview
pub fn delete_preview(&self) -> DeletePreview
Deletes a Preview.
§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_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.delete_preview()
.set_name(name)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn export_preview_result(&self) -> ExportPreviewResult
pub fn export_preview_result(&self) -> ExportPreviewResult
Sourcepub fn list_terraform_versions(&self) -> ListTerraformVersions
pub fn list_terraform_versions(&self) -> ListTerraformVersions
Lists TerraformVersions in a given project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let mut list = client.list_terraform_versions()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_terraform_version(&self) -> GetTerraformVersion
pub fn get_terraform_version(&self) -> GetTerraformVersion
Gets details about a TerraformVersion.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.get_terraform_version()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_resource_changes(&self) -> ListResourceChanges
pub fn list_resource_changes(&self) -> ListResourceChanges
Lists ResourceChanges for a given preview.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let mut list = client.list_resource_changes()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_resource_change(&self) -> GetResourceChange
pub fn get_resource_change(&self) -> GetResourceChange
Get a ResourceChange for a given preview.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.get_resource_change()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_resource_drifts(&self) -> ListResourceDrifts
pub fn list_resource_drifts(&self) -> ListResourceDrifts
List ResourceDrifts for a given preview.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, parent: &str
) -> Result<()> {
let mut list = client.list_resource_drifts()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_resource_drift(&self) -> GetResourceDrift
pub fn get_resource_drift(&self) -> GetResourceDrift
Get a ResourceDrift for a given preview.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.get_resource_drift()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_auto_migration_config(&self) -> GetAutoMigrationConfig
pub fn get_auto_migration_config(&self) -> GetAutoMigrationConfig
Get the AutoMigrationConfig for a given project and location.
§Example
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.get_auto_migration_config()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_auto_migration_config(&self) -> UpdateAutoMigrationConfig
pub fn update_auto_migration_config(&self) -> UpdateAutoMigrationConfig
Updates the AutoMigrationConfig for a given project and location.
§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_config_v1::model::AutoMigrationConfig;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config, name: &str
) -> Result<()> {
let response = client.update_auto_migration_config()
.set_auto_migration_config(
AutoMigrationConfig::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 list_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> 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_config_v1::Result;
async fn sample(
client: &Config
) -> Result<()> {
client.cancel_operation()
/* set fields */
.send().await?;
Ok(())
}