Rust

What an orchestrator reports and is told: containers, networks, usage statistics, restart policies and how to run a container.

Contents

use utopia_orchestration::Container;
Rust
pub struct Container

A container as a listing reports it.

use utopia_orchestration::Io;
Rust
pub struct Io

Bytes in and out (read and written, received and sent).

use utopia_orchestration::Network;
Rust
pub struct Network

A network as a listing reports it.

use utopia_orchestration::RunOptions;
Rust
pub struct RunOptions

How to run a container: everything but the image and the name, each empty or off by default.

Rust
use utopia_orchestration::{Restart, RunOptions};

let options = RunOptions {
    command: vec!["sh".into(), "-c".into(), "tail -f /dev/null".into()],
    workdir: "/usr/local/src".into(),
    vars: vec![("APP_ENV".into(), "production".into())],
    labels: vec![("team".into(), "billing".into())],
    restart: Restart::UnlessStopped,
    ..RunOptions::default()
};
assert_eq!(options.restart.as_str(), "unless-stopped");
use utopia_orchestration::Stats;
Rust
pub struct Stats

A container's resource usage at one moment.

use utopia_orchestration::Restart;
Rust
pub enum Restart

When Docker restarts a container that stopped.

Also implements From, Display.