Crates.io | scaleway-rs |
lib.rs | scaleway-rs |
version | 0.1.9 |
source | src |
created_at | 2023-10-31 22:04:17.247949 |
updated_at | 2023-11-15 19:32:05.963282 |
description | A pure Rust scaleway API binding. |
homepage | https://gitlab.com/deploy-robot/scaleway |
repository | https://gitlab.com/deploy-robot/scaleway |
max_upload_size | |
id | 1020424 |
size | 102,632 |
A pure Rust Scaleway API binding.
It needs to have the feature "blocking" enabled.
scaleway-rs = { version = "*", features = ["blocking"] }
use scaleway_rs::ScalewayApi;
use scaleway_rs::ScalewayError;
fn main() -> Result<(), ScalewayError> {
let region = "fr-par-2";
let api = ScalewayApi::new("<KEY>");
let types = api.get_server_types_async(region).await?;
println!("SERVERTYPES: {:#?}", types);
let images = api.list_images(region).run_async().await?;
println!("IMAGES: {:#?}", images);
let instances = api
.list_instances(region)
.order("creation_date_asc")
.run_async()
.await?;
println!("INSTANCES: {:#?}", instances);
Ok(())
}
scaleway-rs = { version = "*" }
use scaleway_rs::ScalewayApi;
use scaleway_rs::ScalewayError;
#[async_std::main]
async fn main() -> Result<(), ScalewayError> {
let region = "fr-par-2";
let api = ScalewayApi::new("<KEY>");
let types = api.get_server_types(region)?;
println!("SERVERTYPES: {:#?}", types);
let images = api.list_images(region).run()?;
println!("IMAGES: {:#?}", images);
let instances = api.list_instances(region).order("creation_date_asc").run()?;
println!("INSTANCES: {:#?}", instances);
Ok(())
}