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.
mzcli replaces many commands in the previous CLI (
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
mzshcan only be executed in the platform. The new CLI does not have this limitation.
mzcliworks fine on any computer with java that has HTTP connectivity to the platform.
If you are running Usage Engine in a Kubernetes environment mzcli can also be executed using "kubectl". Example:
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 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
The priority is as follows, ranking lowest to highest:
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.