Skip to content

lpotthast/cloud-hypervisor-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloud-hypervisor-client

Crates.io Docs.rs CI MSRV License

Unofficial Rust crate for interacting with the cloud-hypervisor REST API

Overview

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.

Installation

Add the crate to your project with Cargo:

cargo add cloud-hypervisor-client

Or add it to your Cargo.toml manually:

[dependencies]
cloud-hypervisor-client = "0.4"

The crate targets a local cloud-hypervisor VMM over a Unix domain socket via hyper and hyperlocal, so it only works on Unix-like systems.

Example

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.

Minimum Supported Rust Version (MSRV)

This crate's MSRV is 1.86.0.

Attributions

This crate was based on the great work done in: https://github.com/HenningHolmDE/hcloud-rust.

About

Unofficial Rust crate for accessing the cloud-hypervisor REST API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages