use std::env;
#[cfg(feature = "block-storage")]
#[tokio::main(flavor = "current_thread")]
async fn main() {
env_logger::init();
let os = openstack::Cloud::from_env()
.await
.expect("Failed to create an identity provider from the environment");
let id = env::args().nth(1).expect("Provide a volume ID");
let network = os.get_volume(id).await.expect("Cannot get an volume");
println!(
"ID = {}, Name = {:?}, Status = {:?}",
network.id(),
network.name(),
network.status(),
);
}
#[cfg(not(feature = "block-storage"))]
fn main() {
panic!("This example cannot run with 'block-storage' feature disabled");
}