podman-rest-client
Provides an interface for querying the podman rest api. Most of the interface is generated from the the official podman swagger file. This crate adds a layer to make it possible to connect to the podman rest api over ssh to a unix socket and directl to a unix socket. Connections over ssh are commonly necessary on macOs where the container runtime runs in a virtual machine accessible over ssh.
Usage
use PodmanRestClient;
use guess_configuration;
// Setup the default configuration
let config = guess_configuration.await.unwrap;
// Initialize a client
let client = new.await.unwrap;
// Fetch a list of container images
let images = client.images_api.image_list_libpod.await.unwrap;
guess_configuration
tries to find the default path to the podman socket depending on the
platform you are on. You can also manually create clients configurations:
use PodmanRestClient;
use Config;
let ssh_client = new.await.unwrap;
let unix_client = new.await.unwrap;
TODO
- Make ssh support a crate feature that can be excluded.
- Attempt to re-establish the ssh connection if lost. (Alternatively would it be so horrible to just establish a new ssh connection on each request?)