Enum MicrosandboxSubcommand

Source
pub enum MicrosandboxSubcommand {
Show 23 variants Init { file: Option<PathBuf>, }, Add {
Show 20 fields sandbox: bool, build: bool, group: bool, names: Vec<String>, image: String, memory: Option<u32>, cpus: Option<u32>, volumes: Vec<String>, ports: Vec<String>, envs: Vec<String>, env_file: Option<Utf8UnixPathBuf>, depends_on: Vec<String>, workdir: Option<Utf8UnixPathBuf>, shell: Option<String>, scripts: Vec<(String, String)>, start: Option<String>, imports: Vec<(String, String)>, exports: Vec<(String, String)>, scope: Option<String>, file: Option<PathBuf>,
}, Remove { sandbox: bool, build: bool, group: bool, names: Vec<String>, file: Option<PathBuf>, }, List { sandbox: bool, build: bool, group: bool, file: Option<PathBuf>, }, Log { sandbox: bool, build: bool, group: bool, name: String, file: Option<PathBuf>, follow: bool, tail: Option<usize>, }, Tree { sandbox: bool, build: bool, group: bool, names: Vec<String>, level: Option<usize>, }, Run { sandbox: bool, build: bool, name: String, file: Option<PathBuf>, detach: bool, exec: Option<String>, args: Vec<String>, }, Shell { sandbox: bool, build: bool, name: String, file: Option<PathBuf>, detach: bool, args: Vec<String>, }, Exe { image: bool, name: String, cpus: Option<u8>, memory: Option<u32>, volumes: Vec<String>, ports: Vec<String>, envs: Vec<String>, workdir: Option<Utf8UnixPathBuf>, scope: Option<String>, exec: Option<String>, args: Vec<String>, }, Install { image: bool, name: String, alias: Option<String>, cpus: Option<u8>, memory: Option<u32>, volumes: Vec<String>, ports: Vec<String>, envs: Vec<String>, workdir: Option<Utf8UnixPathBuf>, scope: Option<String>, exec: Option<String>, args: Vec<String>, }, Uninstall { script: Option<String>, }, Apply { file: Option<PathBuf>, detach: bool, }, Up { sandbox: bool, build: bool, group: bool, names: Vec<String>, file: Option<PathBuf>, detach: bool, }, Down { sandbox: bool, build: bool, group: bool, names: Vec<String>, file: Option<PathBuf>, }, Status { sandbox: bool, build: bool, group: bool, names: Vec<String>, file: Option<PathBuf>, }, Clean { sandbox: bool, name: Option<String>, user: bool, all: bool, file: Option<PathBuf>, force: bool, }, Build { build: bool, sandbox: bool, group: bool, names: Vec<String>, snapshot: bool, }, Pull { image: bool, image_group: bool, name: Reference, layer_path: Option<PathBuf>, }, Login, Push { image: bool, image_group: bool, name: String, }, Self_ { action: SelfAction, }, Server { subcommand: ServerSubcommand, }, Version,
}
Expand description

Available subcommands for managing services

Variants§

§

Init

Initialize a new microsandbox project

Fields

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§

Add

Add a new sandbox to the project

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§names: Vec<String>

Names of components to add

§image: String

Image to use

§memory: Option<u32>

Memory in MiB

§cpus: Option<u32>

Number of CPUs

§volumes: Vec<String>

Volume mappings, format: <host_path>:<container_path>

§ports: Vec<String>

Port mappings, format: <host_port>:<container_port>

§envs: Vec<String>

Environment variables, format: =

§env_file: Option<Utf8UnixPathBuf>

Environment file

§depends_on: Vec<String>

Dependencies

§workdir: Option<Utf8UnixPathBuf>

Working directory

§shell: Option<String>

Shell to use

§scripts: Vec<(String, String)>

Scripts to add

§start: Option<String>

Start script

§imports: Vec<(String, String)>

Files to import, format: =

§exports: Vec<(String, String)>

Files to export, format: =

§scope: Option<String>

Network scope, options: local, public, any, none

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§

Remove

Remove a sandbox from the project

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§names: Vec<String>

Names of components to remove

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§

List

List sandboxes defined in the project

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§

Log

Show logs of a build, sandbox, or group

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§name: String

Name of the component

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§follow: bool

Follow the logs

§tail: Option<usize>

Number of lines to show from the end

§

Tree

Show tree of layers that make up a sandbox

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§names: Vec<String>

Names of components to show

§level: Option<usize>

Maximum depth level

§

Run

Run a sandbox defined in the project

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§name: String

Name of the component

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§detach: bool

Run sandbox in the background

§exec: Option<String>

Execute a command within the sandbox

§args: Vec<String>

Additional arguments after --. Passed to the script or exec.

§

Shell

Open a shell in a sandbox

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§name: String

Name of the component

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§detach: bool

Run sandbox in the background

§args: Vec<String>

Additional arguments after --. Passed to the shell.

§

Exe

Run a temporary sandbox

Fields

§image: bool

Whether command should apply to a sandbox

§name: String

Name of the image

§cpus: Option<u8>

Number of CPUs

§memory: Option<u32>

Memory in MB

§volumes: Vec<String>

Volume mappings, format: <host_path>:<container_path>

§ports: Vec<String>

Port mappings, format: <host_port>:<container_port>

§envs: Vec<String>

Environment variables, format: =

§workdir: Option<Utf8UnixPathBuf>

Working directory

§scope: Option<String>

Network scope, options: local, public, any, none

§exec: Option<String>

Execute a command within the sandbox

§args: Vec<String>

Additional arguments after --. Passed to the script or exec.

§

Install

Install a script from an image

Fields

§image: bool

Whether command should apply to a sandbox

§name: String

Name of the image

§alias: Option<String>

Alias for the script

§cpus: Option<u8>

Number of CPUs

§memory: Option<u32>

Memory in MB

§volumes: Vec<String>

Volume mappings, format: <host_path>:<container_path>

§ports: Vec<String>

Port mappings, format: <host_port>:<container_port>

§envs: Vec<String>

Environment variables, format: =

§workdir: Option<Utf8UnixPathBuf>

Working directory

§scope: Option<String>

Network scope, options: local, public, any, none

§exec: Option<String>

Execute a command within the sandbox

§args: Vec<String>

Additional arguments after --. Passed to the script or exec.

§

Uninstall

Uninstall a script

Fields

§script: Option<String>

Script to uninstall

§

Apply

Start or stop project sandboxes based on configuration

Fields

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§detach: bool

Run sandboxes in the background

§

Up

Run a project’s sandboxes

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§names: Vec<String>

Names of components to start. If omitted, starts all sandboxes defined in the configuration.

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§detach: bool

Run sandboxes in the background

§

Down

Stop a project’s sandboxes

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§names: Vec<String>

Names of components to stop. If omitted, stops all sandboxes defined in the configuration.

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§

Status

Show statuses of a project’s running sandboxes

Fields

§sandbox: bool

Whether command should apply to a sandbox

§build: bool

Whether command should apply to a build sandbox

§group: bool

Whether command should apply to a group

§names: Vec<String>

Names of components to show status for

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§

Clean

Clean cached sandbox layers, metadata, etc.

Fields

§sandbox: bool

Whether command should apply to a sandbox

§name: Option<String>

Name of the component

§user: bool

Clean user-level caches. This cleans $MICROSANDBOX_HOME

§all: bool

Clean all

§file: Option<PathBuf>

Path to the sandbox file or the project directory

§force: bool

Force clean

§

Build

Build images

Fields

§build: bool

Build from build definition

§sandbox: bool

Build from sandbox

§group: bool

Build from group

§names: Vec<String>

Names of components to build

§snapshot: bool

Create a snapshot

§

Pull

Pull image from a registry

Fields

§image: bool

Whether command should apply to an image

§image_group: bool

Whether command should apply to an image group

§name: Reference

Name of the image or image group

§layer_path: Option<PathBuf>

Path to store the layer files

§

Login

Login to a registry

§

Push

Push image to a registry

Fields

§image: bool

Whether command should apply to an image

§image_group: bool

Whether command should apply to an image group

§name: String

Name of the image or image group

§

Self_

Manage microsandbox itself

Fields

§action: SelfAction

Action to perform

§

Server

Start a sandbox server for orchestrating and working with sandboxes

Fields

§subcommand: ServerSubcommand

The subcommand to run

§

Version

Print version of microsandbox

Trait Implementations§

Source§

impl CommandFactory for MicrosandboxSubcommand

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for MicrosandboxSubcommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for MicrosandboxSubcommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for MicrosandboxSubcommand

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
Source§

impl Subcommand for MicrosandboxSubcommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,