mex-docs

Specifying Array Values to mcctl

A number of inputs to the mcctl utility are passed as arrays of multiple values. These inputs will be shown in the format of somearray:#.somevalue in the help output.

There are two ways to specify array inputs, via a file and by providing an index number on the command line.

Using a File

Create a yaml file with all the fields and values required by the command. You can view the required information by using mcctl with the command and (if needed) subcommand without any additional arguments. For example, to list the required and options arguments for the CreateApp command run mcctl region CreateApp.

The sample below shows a YAML file that defines two configurations to the MobiledgeX platform as part of creating an application.

Sample YAML File

region: EU
app:
  key:
    name: deleteme
    organization: testmonitor
    version: '1.0'
  image_path: docker-qa.mobiledgex.net/testmonitor/images/myfirst-app:v1
  image_type: 1
  configs:
  - config: "<yaml-content0>"
    kind: helmCustomizationYaml
  - config: "<yaml-content1>"
    kind: helmCustomizationYaml

Once the YAML file is created it can be passed to the mcctl utility using the --datafile command line option:

mcctl region CreateApp --datafile <above-filename.yml>

Using the CLI

It is also possible to pass this information on the command line. This requires that you replace the # shown in the help text with a value that corresponds to the number of an element in the array. Note that the array is zero-based.

Sample CLI

This command passes the same information as the yaml file above.

mcctl region CreateApp region=EU appname=testapp appvers=1.0 \
app-org=testmonitor imagetype=ImageTypeDocker \
configs:0.kind=helmCustomizationYaml configs:0.config="<yamlcontent0>" \
configs:1.kind=helmCustomizationYaml configs:1.config="<yamlcontent1>"