R80 Management API tips and tricks - Using environment variables

Document created by Robert Decker Employee on Mar 5, 2018Last modified by Robert Decker Employee on Mar 5, 2018
Version 2Show Document
  • View in full screen mode

When running the mgmt_cli tool, it reads many of its activation parameters from environment variables.

This is useful when using automation scripts. It is supported both on Windows and Linux machines.


Here is a list:


Parameter NameCommand Line SwitchEnvironment Variable
User name-uMGMT_CLI_USER
User password-pMGMT_CLI_PASSWORD
Name or IP address of management domain-dMGMT_CLI_DOMAIN
Management server IP address-mMGMT_CLI_MANAGEMENT
Port of API server on management server--portMGMT_CLI_PORT
Proxy settings-xMGMT_CLI_PROXY
File containing session information using Login-sMGMT_CLI_SESSION_FILE
Established session identifier (sid) using Login--session-idMGMT_CLI_SESSION_ID
API response format-fMGMT_CLI_FORMAT


For example, on Linux machine use - 


export MGMT_CLI_USER=me
export MGMT_CLI_PASSWORD=secret


Then call the Login command - 

mgmt_cli login


If you are writing a script to automate your tasks, you can save the password obscured, and then un-obscure in script just before calling the login command.



4 people found this helpful