pub struct ManagedIdentitiesService { /* private fields */ }Expand description
Implements a client for the Managed Service for Microsoft Active Directory API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = ManagedIdentitiesService::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_domains()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
API Overview
The managedidentites.googleapis.com service implements the Google Cloud
Managed Identites API for identity services
(e.g. Microsoft Active Directory).
The Managed Identities service provides methods to manage (create/read/update/delete) domains, reset managed identities admin password, add/remove domain controllers in GCP regions and add/remove VPC peering.
Data Model
The Managed Identities service exposes the following resources:
-
Locations as global, named as follows:
projects/{project_id}/locations/global. -
Domains, named as follows:
/projects/{project_id}/locations/global/domain/{domain_name}.
The {domain_name} refers to fully qualified domain name in the customer
project e.g. mydomain.myorganization.com, with the following restrictions:
- Must contain only lowercase letters, numbers, periods and hyphens.
- Must start with a letter.
- Must contain between 2-64 characters.
- Must end with a number or a letter.
- Must not start with period.
- First segement length (mydomain form example above) shouldn’t exceed 15 chars.
- The last segment cannot be fully numeric.
- Must be unique within the customer project.
§Configuration
To configure ManagedIdentitiesService 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://managedidentities.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
ManagedIdentitiesService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap ManagedIdentitiesService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl ManagedIdentitiesService
impl ManagedIdentitiesService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for ManagedIdentitiesService.
let client = ManagedIdentitiesService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: ManagedIdentitiesService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: ManagedIdentitiesService + '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_microsoft_ad_domain(&self) -> CreateMicrosoftAdDomain
pub fn create_microsoft_ad_domain(&self) -> CreateMicrosoftAdDomain
Creates a Microsoft AD domain.
§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_managedidentities_v1::model::Domain;
use google_cloud_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService, parent: &str
) -> Result<()> {
let response = client.create_microsoft_ad_domain()
.set_parent(parent)
.set_domain(
Domain::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn reset_admin_password(&self) -> ResetAdminPassword
pub fn reset_admin_password(&self) -> ResetAdminPassword
Resets a domain’s administrator password.
§Example
use google_cloud_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> Result<()> {
let response = client.reset_admin_password()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_domains(&self) -> ListDomains
pub fn list_domains(&self) -> ListDomains
Lists domains in a project.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService, parent: &str
) -> Result<()> {
let mut list = client.list_domains()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_domain(&self) -> GetDomain
pub fn get_domain(&self) -> GetDomain
Gets information about a domain.
§Example
use google_cloud_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService, name: &str
) -> Result<()> {
let response = client.get_domain()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_domain(&self) -> UpdateDomain
pub fn update_domain(&self) -> UpdateDomain
Updates the metadata and configuration of a domain.
§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_managedidentities_v1::model::Domain;
use google_cloud_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService, name: &str
) -> Result<()> {
let response = client.update_domain()
.set_domain(
Domain::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_domain(&self) -> DeleteDomain
pub fn delete_domain(&self) -> DeleteDomain
Deletes a domain.
§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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService, name: &str
) -> Result<()> {
client.delete_domain()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn attach_trust(&self) -> AttachTrust
pub fn attach_trust(&self) -> AttachTrust
Adds an AD trust to a domain.
§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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> Result<()> {
let response = client.attach_trust()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn reconfigure_trust(&self) -> ReconfigureTrust
pub fn reconfigure_trust(&self) -> ReconfigureTrust
Updates the DNS conditional forwarder.
§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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> Result<()> {
let response = client.reconfigure_trust()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn detach_trust(&self) -> DetachTrust
pub fn detach_trust(&self) -> DetachTrust
Removes an AD trust.
§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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> Result<()> {
let response = client.detach_trust()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn validate_trust(&self) -> ValidateTrust
pub fn validate_trust(&self) -> ValidateTrust
Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests.
§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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> Result<()> {
let response = client.validate_trust()
/* set fields */
.poller().until_done().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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> 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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> 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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> 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_managedidentities_v1::Result;
async fn sample(
client: &ManagedIdentitiesService
) -> Result<()> {
client.cancel_operation()
/* set fields */
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for ManagedIdentitiesService
impl Clone for ManagedIdentitiesService
Source§fn clone(&self) -> ManagedIdentitiesService
fn clone(&self) -> ManagedIdentitiesService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more