Crates.io | hcloud |
lib.rs | hcloud |
version | 0.21.0 |
source | src |
created_at | 2020-06-04 19:21:32.184646 |
updated_at | 2024-11-10 08:05:18.209637 |
description | Unofficial Rust crate for accessing the Hetzner Cloud API |
homepage | |
repository | https://github.com/HenningHolmDE/hcloud-rust |
max_upload_size | |
id | 250132 |
size | 965,707 |
Unofficial Rust crate for accessing the Hetzner Cloud API
The hcloud
crate can be used for managing the endpoints provided by the Hetzner Cloud API in your Rust project.
The API client code of this crate has been auto-generated from the Unofficial OpenAPI Description for the Hetzner Cloud API using OpenAPI Generator.
A very basic example for listing all existing servers:
use hcloud::apis::configuration::Configuration;
use hcloud::apis::servers_api;
// set up basic configuration using API token
let mut configuration = Configuration::new();
configuration.bearer_access_token =
Some("YOUR_HCLOUD_API_TOKEN".to_string());
// get list of all existing servers from servers API
let servers = servers_api::list_servers(&configuration, Default::default())
.await?
.servers;
// handle server data
for server in servers {
println!("{:?}", server);
}
For more examples check out the examples folder in the Git repository.
The underlying TLS implementation for reqwest
can be selected using Cargo features:
native-tls
.vendored
feature of native-tls
.rustls
.(Refer to Optional Features in the reqwest
documentation.)
Example for using the TLS functionality provided by rustls
:
[dependencies]
hcloud = { version = "*", default-features = false, features = ["rustls-tls"] }
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.