vm-pool-client 0.1.0-alpha.1

Client library for communicating with the vm-pool service
Documentation

Client library for communicating with the vm-pool service.

Provides a high-level async API over the Unix socket protocol.

Example

# async fn example() -> Result<(), vm_pool_client::ClientError> {
use vm_pool_client::Client;
use vm_pool_protocol::VmConfig;

let mut client = Client::connect("/tmp/vm-pool.sock").await?;

let status = client.status().await?;
println!("available: {}", status.available);

let vm_id = client.allocate("agent:v1.0.0", VmConfig::default()).await?;
println!("allocated: {}", vm_id);

client.deallocate(&vm_id).await?;
# Ok(())
# }