Page tree
Skip to end of metadata
Go to start of metadata

mzcli is a command line interface (CLI) that lets you execute system commands independently of which host environment mzcli is running on. Each operation is described in detail in sub chapters.

Note!

mzcli replaces many commands in the previous CLI (mzsh) in Usage Engine. Some commands are not supported by mzcli, for example shutdown, restart, start, and status. Commands not supported by mzcli are listed here. For these commands you still have to use mzsh. The long-term plan is to remove mzsh.

mzcli is a java application that allows you to execute commands by calling platform Web APIs. mzcli has the following advantages over mzsh:

  • mzsh can only be executed in the platform. The new CLI does not have this limitation.
  • mzcli works fine on any computer with java that has HTTP connectivity to the platform.

mzcli usage

java -jar mzcli.jar [mzcli] [<username/password>] <command> [<arguments>] 
       [--schema <http|https> : default http] 
       [--user <username> : default mzadmin]
       [--password <pass>]
       [--host <host> : default localhost] 
       [--port <port> : default 9000] 

java -jar mzcli.jar [mzcli] --help

Note!

If you are executing mzcli in the platform or execution context you can use the "mzcli" short command instead of "java -jar mzcli.jar".

Note!

If you are running Usage Engine in a Kubernetes environment mzcli can also be executed using "kubectl". Example:

kubectl exec platform-0 -- bash -c "mzcli ..."

Options

The options specified with double-dashes (--) can also be specified via environment variables: MZCLI_PORT, MZCLI_HOST, MZCLI_USER, MZCLI_PASSWORD, and MZCLI_SCHEMA. The environment variables need to be set for the machine that is running the mzcli client.

The options can also be specified via a property file called mzcli.properties with these property names and default values: 

  • mzcli.user=mzadmin
  • mzcli.schema=http
  • mzcli.port=9000
  • mzcli.host=localhost

mzcli searches for this file in MZ_HOME/etc (if MZ_HOME exists) or in the local folder (if MZ_HOME does not exist). If the mzcli.properties file is not present, it is created with default values.

If an option is not specified, its default value is used.

A simplified user/password syntax can also be used. Just enter username and password in a single parameter together with the preferred command. When the command is executed, the command prompt is returned to the Unix shell.

Example - How to use simplified user/password syntax

$ java -jar mzcli.jar <user>/<password> wfstart MyWF

Priority

Note!

Lower priority means that it can be overridden by anything with higher priority.

The priority is as follows, ranking lowest to highest:

  • Values from the mzcli.properties file
  • Environment variables
  • Options specified when out of interactive mode
  • Username and password specified using the [<username/password>] syntax
  • Options specified when in interactive mode

Overwrite option

If a command produces output files mzcli saves them to disk. Use the -overwrite option to save a file to disk even if a file with the same name already exists. If the -overwrite option is not specified, and a file with the same file name exists, mzcli displays an error message and terminates without saving the file.



  • No labels