#[cfg(feature = "compute")]
#[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 keypairs: Vec<openstack::compute::KeyPair> =
os.list_keypairs().await.expect("Cannot list key pairs");
println!("Key pairs:");
for keypair in &keypairs {
println!(
"Name = {}, Fingerprint = {}",
keypair.name(),
keypair.fingerprint()
);
}
}
#[cfg(not(feature = "compute"))]
fn main() {
panic!("This example cannot run with 'compute' feature disabled");
}