cloud-hypervisor-client 0.3.1

Unofficial Rust crate for accessing the cloud-hypervisor REST API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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(())
}