Options Hierarchy

Options Hierarchy

How to set and overide options on your custom app

An application run request provides several ways to set the options as well as their defaults on your run. Options can be set at the time of a run execution, by configuring an instance, or by setting the option configuration on a version by utilizing a manifest.

Application of options

When starting any run from the Nextmv API, the options will be applied in the following order, with each set overriding the last if a value is provided.

  • Version
  • Instance
  • Run Configuration

Example

The following option defaults are set on your version.

Option NameDefault Value
option_1option_1_version_default
option_2option_2_version_default
option_3option_3_version_default

On your instance that uses the above version, you set the following options.

Option NameDefault Value
option_2option_2_instance_value
option_3option_3_instance_value

When you configure your run, you pass the following option.

Option NameDefault Value
option_3option_3_run_configuration

This will result in the following set of options being used for your run.

Option NameDefault Value
option_1option_1_version_default
option_2option_2_instance_value
option_3option_3_run_configuration

Inspecting Options Applied to a Run

Each run result is returned with a set of metadata. A summary of which options were passed to your application as well as their source can be found under metadata.options.options_summary and can also be inspected in the Nextmv Console.

This same information can be found on the run metadata response.

Options in your application code

When your custom app is executed, options are passed as command line arguments. In order to have those options applied in your model, you must parse those arguments or adhere to the standard set forth in the solver you are using.

Any other method of option setting utilized in your code, will not be surfaced in your run result or run metadata responses. For example, if you are using a configuration file as part of your app to provide options values, then you will not see those options reflected in your options summary.

Page last updated

Go to on-page nav menu