Enum nimbus_cli::cli::CliCommand

source ·
pub(crate) enum CliCommand {
Show 18 variants ApplyFile { file: PathBuf, preserve_nimbus_db: bool, open: OpenArgs, }, CaptureLogs { file: PathBuf, }, Defaults { feature_id: Option<String>, output: Option<PathBuf>, manifest: ManifestArgs, }, Enroll { experiment: ExperimentArgs, branch: String, rollouts: Vec<String>, preserve_targeting: bool, preserve_bucketing: bool, open: OpenArgs, preserve_nimbus_db: bool, no_validate: bool, manifest: ManifestArgs, }, Features { manifest: ManifestArgs, experiment: ExperimentArgs, branch: String, validate: bool, feature_id: Option<String>, multi: bool, output: Option<PathBuf>, }, Fetch { output: Option<PathBuf>, experiment: ExperimentArgs, recipes: Vec<String>, }, FetchList { output: Option<PathBuf>, list: ExperimentListArgs, }, Fml { args: Vec<OsString>, }, Info { experiment: ExperimentArgs, output: Option<PathBuf>, }, List { list: ExperimentListArgs, }, LogState { open: OpenArgs, }, Open { open: OpenArgs, no_clobber: bool, }, StartServer, ResetApp, TailLogs, TestFeature { feature_id: String, files: Vec<PathBuf>, patch: Option<PathBuf>, open: OpenArgs, no_validate: bool, manifest: ManifestArgs, }, Unenroll { open: OpenArgs, }, Validate { experiment: ExperimentArgs, manifest: ManifestArgs, },
}

Variants§

§

ApplyFile

Send a complete JSON file to the Nimbus SDK and apply it immediately.

Fields

§file: PathBuf

The filename to be loaded into the SDK.

§preserve_nimbus_db: bool

Keeps existing enrollments and experiments before enrolling.

This is unlikely what you want to do.

§

CaptureLogs

Capture the logs into a file.

Fields

§file: PathBuf

The file to put the logs.

§

Defaults

Print the defaults for the manifest.

Fields

§feature_id: Option<String>

An optional feature-id

§output: Option<PathBuf>

An optional file to print the manifest defaults.

§manifest: ManifestArgs
§

Enroll

Enroll into an experiment or a rollout.

The experiment slug is a combination of the actual slug, and the server it came from.

  • release/stage determines the server.

  • preview selects the preview collection.

These can be further combined: e.g. $slug, preview/$slug, stage/$slug, stage/preview/$slug

Fields

§experiment: ExperimentArgs
§branch: String

The branch slug.

§rollouts: Vec<String>

Optional rollout slugs, including the server and collection.

§preserve_targeting: bool

Preserves the original experiment targeting

§preserve_bucketing: bool

Preserves the original experiment bucketing

§preserve_nimbus_db: bool

Keeps existing enrollments and experiments before enrolling.

This is unlikely what you want to do.

§no_validate: bool

Don’t validate the feature config files before enrolling

§manifest: ManifestArgs
§

Features

Print the feature configuration involved in the branch of an experiment.

This can be optionally merged with the defaults from the feature manifest.

Fields

§manifest: ManifestArgs
§experiment: ExperimentArgs
§branch: String

The branch of the experiment

§validate: bool

If set, then merge the experimental configuration with the defaults from the manifest

§feature_id: Option<String>

An optional feature-id: if it exists in this branch, print this feature on its own.

§multi: bool

Print out the features involved in this branch as in a format: { $feature_id: $value }.

Automated tools should use this, since the output is predictable.

§output: Option<PathBuf>

An optional file to print the output.

§

Fetch

Fetch one or more named experiments and rollouts and put them in a file.

Fields

§output: Option<PathBuf>

The file to download the recipes to.

§experiment: ExperimentArgs
§recipes: Vec<String>

The recipe slugs, including server.

Use once per recipe to download. e.g. fetch –output file.json preview/my-experiment my-rollout

Cannot be used with the server option: use fetch-list instead.

§

FetchList

Fetch a list of experiments and put it in a file.

Fields

§output: Option<PathBuf>

The file to download the recipes to.

§

Fml

Execute a nimbus-fml command. See

nimbus-cli fml – –help

for more.

Fields

§

Info

Displays information about an experiment

Fields

§experiment: ExperimentArgs
§output: Option<PathBuf>

An optional file to print the output.

§

List

List the experiments from a server

§

LogState

Print the state of the Nimbus database to logs.

This causes a restart of the app.

Fields

§

Open

Open the app without changing the state of experiment enrollments.

Fields

§no_clobber: bool

By default, the app is terminated before sending the a deeplink.

If this flag is set, then do not terminate the app if it is already running.

§

StartServer

Start a server

§

ResetApp

Reset the app back to its just installed state

§

TailLogs

Follow the logs for the given app.

§

TestFeature

Configure an application feature with one or more feature config files.

One file per branch. The branch slugs will correspond to the file names.

By default, the files are validated against the manifest; this can be overridden with --no-validate.

Fields

§feature_id: String

The identifier of the feature to configure

§files: Vec<PathBuf>

One or more files containing a feature config for the feature.

§patch: Option<PathBuf>

An optional patch file, used to patch feature configurations

This is of the format that comes from the features --multi or defaults commands.

§no_validate: bool

Don’t validate the feature config files before enrolling

§manifest: ManifestArgs
§

Unenroll

Unenroll from all experiments and rollouts

Fields

§

Validate

Validate an experiment against a feature manifest

Fields

§experiment: ExperimentArgs
§manifest: ManifestArgs

Implementations§

source§

impl CliCommand

source

pub(crate) fn check_valid(&self) -> Result<()>

source

pub(crate) fn open_args(&self) -> Option<&OpenArgs>

source

pub(crate) fn should_kill(&self) -> bool

source

pub(crate) fn should_reset(&self) -> bool

Trait Implementations§

source§

impl Clone for CliCommand

source§

fn clone(&self) -> CliCommand

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl FromArgMatches for CliCommand

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 Subcommand for CliCommand

source§

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

Append to [Command] so it can instantiate Self. Read more
source§

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

Append to [Command] so it can update self. 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.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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<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