| Crates.io | cloud-hypervisor-client |
| lib.rs | cloud-hypervisor-client |
| version | 0.3.3 |
| created_at | 2025-04-11 13:15:19.304502+00 |
| updated_at | 2025-06-20 06:57:26.348031+00 |
| description | Unofficial Rust crate for accessing the cloud-hypervisor REST API |
| homepage | |
| repository | https://github.com/lpotthast/cloud-hypervisor-client |
| max_upload_size | |
| id | 1629820 |
| size | 122,160 |
Unofficial Rust crate for interacting with the cloud-hypervisor REST API
The cloud-hypervisor-client crate can be used for managing the endpoints provided by a cloud-hypervisor socket in your
Rust project.
The API client code of this crate has been auto-generated from the OpenAPI description for the cloud-hypervisor REST API using OpenAPI Generator.
A very basic example for listing all existing servers:
use cloud_hypervisor_client::apis::DefaultApi;
use cloud_hypervisor_client::socket_based_api_client;
#[tokio::main]
async fn main() -> Result<(), String> {
let client = socket_based_api_client("cloud_hypervisor_vm_socket.sock");
let vm_info = client
.vm_info_get()
.await
.map_err(|err| format!("API call to vm_info_get failed: {:?}", err))?;
println!("Received vm info: {vm_info:?}");
Ok(())
}
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]
cloud_hypervisor_client = { version = "0.3.0", default-features = false, features = ["rustls-tls"] }
This crate was based on the great work done in: https://github.com/HenningHolmDE/hcloud-rust.