pub struct EdgeContainer { /* private fields */ }Expand description
Implements a client for the Distributed Cloud Edge Container API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = EdgeContainer::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_clusters()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
EdgeContainer API provides management of Kubernetes Clusters on Google Edge Cloud deployments.
§Configuration
To configure EdgeContainer 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://edgecontainer.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
EdgeContainer holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap EdgeContainer in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl EdgeContainer
impl EdgeContainer
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for EdgeContainer.
let client = EdgeContainer::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: EdgeContainer + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: EdgeContainer + '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_clusters(&self) -> ListClusters
pub fn list_clusters(&self) -> ListClusters
Lists Clusters in a given project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, parent: &str
) -> Result<()> {
let mut list = client.list_clusters()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_cluster(&self) -> GetCluster
pub fn get_cluster(&self) -> GetCluster
Gets details of a single Cluster.
§Example
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
let response = client.get_cluster()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_cluster(&self) -> CreateCluster
pub fn create_cluster(&self) -> CreateCluster
Creates a new Cluster in 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_edgecontainer_v1::model::Cluster;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, parent: &str
) -> Result<()> {
let response = client.create_cluster()
.set_parent(parent)
.set_cluster_id("cluster_id_value")
.set_cluster(
Cluster::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_cluster(&self) -> UpdateCluster
pub fn update_cluster(&self) -> UpdateCluster
Updates the parameters of a single Cluster.
§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_edgecontainer_v1::model::Cluster;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
let response = client.update_cluster()
.set_cluster(
Cluster::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 upgrade_cluster(&self) -> UpgradeCluster
pub fn upgrade_cluster(&self) -> UpgradeCluster
Upgrades a single cluster.
§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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> Result<()> {
let response = client.upgrade_cluster()
/* set fields */
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_cluster(&self) -> DeleteCluster
pub fn delete_cluster(&self) -> DeleteCluster
Deletes a single Cluster.
§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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
client.delete_cluster()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn generate_access_token(&self) -> GenerateAccessToken
pub fn generate_access_token(&self) -> GenerateAccessToken
Generates an access token for a Cluster.
§Example
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> Result<()> {
let response = client.generate_access_token()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn generate_offline_credential(&self) -> GenerateOfflineCredential
pub fn generate_offline_credential(&self) -> GenerateOfflineCredential
Generates an offline credential for a Cluster.
§Example
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> Result<()> {
let response = client.generate_offline_credential()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_node_pools(&self) -> ListNodePools
pub fn list_node_pools(&self) -> ListNodePools
Lists NodePools in a given project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, parent: &str
) -> Result<()> {
let mut list = client.list_node_pools()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_node_pool(&self) -> GetNodePool
pub fn get_node_pool(&self) -> GetNodePool
Gets details of a single NodePool.
§Example
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
let response = client.get_node_pool()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_node_pool(&self) -> CreateNodePool
pub fn create_node_pool(&self) -> CreateNodePool
Creates a new NodePool in 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_edgecontainer_v1::model::NodePool;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, parent: &str
) -> Result<()> {
let response = client.create_node_pool()
.set_parent(parent)
.set_node_pool(
NodePool::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_node_pool(&self) -> UpdateNodePool
pub fn update_node_pool(&self) -> UpdateNodePool
Updates the parameters of a single NodePool.
§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_edgecontainer_v1::model::NodePool;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
let response = client.update_node_pool()
.set_node_pool(
NodePool::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_node_pool(&self) -> DeleteNodePool
pub fn delete_node_pool(&self) -> DeleteNodePool
Deletes a single NodePool.
§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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
client.delete_node_pool()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn list_machines(&self) -> ListMachines
pub fn list_machines(&self) -> ListMachines
Lists Machines in a given project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, parent: &str
) -> Result<()> {
let mut list = client.list_machines()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_machine(&self) -> GetMachine
pub fn get_machine(&self) -> GetMachine
Gets details of a single Machine.
§Example
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
let response = client.get_machine()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_vpn_connections(&self) -> ListVpnConnections
pub fn list_vpn_connections(&self) -> ListVpnConnections
Lists VPN connections in a given project and location.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, parent: &str
) -> Result<()> {
let mut list = client.list_vpn_connections()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_vpn_connection(&self) -> GetVpnConnection
pub fn get_vpn_connection(&self) -> GetVpnConnection
Gets details of a single VPN connection.
§Example
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
let response = client.get_vpn_connection()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_vpn_connection(&self) -> CreateVpnConnection
pub fn create_vpn_connection(&self) -> CreateVpnConnection
Creates a new VPN connection in 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_edgecontainer_v1::model::VpnConnection;
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, parent: &str
) -> Result<()> {
let response = client.create_vpn_connection()
.set_parent(parent)
.set_vpn_connection(
VpnConnection::new()/* set fields */
)
.poller().until_done().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_vpn_connection(&self) -> DeleteVpnConnection
pub fn delete_vpn_connection(&self) -> DeleteVpnConnection
Deletes a single VPN connection.
§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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer, name: &str
) -> Result<()> {
client.delete_vpn_connection()
.set_name(name)
.poller().until_done().await?;
Ok(())
}Sourcepub fn get_server_config(&self) -> GetServerConfig
pub fn get_server_config(&self) -> GetServerConfig
Gets the server config.
§Example
use google_cloud_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> Result<()> {
let response = client.get_server_config()
/* set fields */
.send().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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> 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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> Result<()> {
let response = client.get_location()
/* 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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> 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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> 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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> 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_edgecontainer_v1::Result;
async fn sample(
client: &EdgeContainer
) -> Result<()> {
client.cancel_operation()
/* set fields */
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for EdgeContainer
impl Clone for EdgeContainer
Source§fn clone(&self) -> EdgeContainer
fn clone(&self) -> EdgeContainer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more