Calling the wladm program
Use the wladm program to administer MobileFirst applications.
Syntax
Call the wladm program as follows:
wladm --url= --user= ... [--passwordfile=...] [--secure=false] some command
The wladm program has the following options:
Option Type Description Required Default --url URL Base URL of the MobileFirst web application for administration services Yes --secure Boolean Whether to avoid operations with security risks No true --user name User name for accessing the MobileFirst admin services Yes --passwordfile file File containing the password for the user No --verbose Detailed output No
- url
URL preferably uses the HTTPS protocol. For example, if we use default ports and context roots, use this URL:
- For WAS: https://server:9443/wladmin
- For Tomcat: https://server:8443/wladmin
- secure
The --secure option is set to true by default. Setting it to --secure=false might have the following effects:
- User and password might be transmitted in an unsecured way (possibly even through unencrypted HTTP).
- The server's SSL certificates are accepted even if self-signed or if they were created for a different host name from the server's host name.
- password
Specify the password in a separate file passed in the --passwordfile option. In interactive mode (see Interactive mode), we can alternatively specify the password interactively. Remove the read permissions of the file for users other than yourself.
- On UNIX: chmod 600 adminpassword.txt
- On Windows: cacls adminpassword.txt /P Administrators:F %USERDOMAIN%\%USERNAME%:F
The wladm calls contains a command. The following commands are supported.
Command Description show info Shows user and configuration information show versions Shows version information list runtimes [--in-database] Lists the runtimes show runtime [runtime-name] Shows information about a runtime delete runtime [runtime-name] condition Deletes a runtime list adapters [runtime-name] Lists the adapters deploy adapter [runtime-name] file Deploys an adapter show adapter [runtime-name] adapter-name Shows information about an adapter delete adapter [runtime-name] adapter-name Deletes an adapter adapter [runtime-name] adapter-name get binary [> tofile] Get the binary data of an adapter list apps [runtime-name] Lists the apps deploy app [runtime-name] file Deploys an app show app [runtime-name] app-name Shows information about an app delete app [runtime-name] app-name Deletes an app delete app version [runtime-name] app-name environment version Deletes a version of an app app version [runtime-name] app-name environment version get binary [> tofile] Gets the binary data of an app version app version [runtime-name] app-name environment version get accessrule Gets the access rule of an app version app version [runtime-name] app-name environment version set accessrule file Changes the access rule of an app version app version [runtime-name] app-name environment version get authenticitycheckrule Gets the authenticity check rule of an app version app version [runtime-name] app-name environment version set authenticitycheckrule action Changes the authenticity check rule of an app version app version [runtime-name] app-name environment version get lock Gets the lock state of an app version app version [runtime-name] app-name environment version set lock lock Changes the lock state of an app version list beacons [uuid [major minor]] Lists the beacons set beacon file Specifies information about a beacon show beacon uuid major minor Shows information about a beacon remove beacon uuid major minor Removes information about a beacon list beacon-triggers [runtime-name] Lists the beacon triggers set beacon-trigger [runtime-name] file Specifies a beacon trigger show beacon-trigger [runtime-name] trigger-name Shows a beacon trigger delete beacon-trigger [runtime-name] trigger-name Deletes a beacon trigger list beacon-trigger-associations [runtime-name] app-name [uuid major minor] [trigger-name] Lists the associations between beacons and beacon triggers set beacon-trigger-association [runtime-name] app-name uuid major minor trigger-name Specifies an association between a beacon and a beacon trigger show beacon-trigger-association [runtime-name] app-name uuid major minor trigger-name Shows the association between a beacon and a beacon trigger delete beacon-trigger-association [runtime-name] app-name uuid major minor trigger-name Deletes the association between a beacon and a beacon trigger list devices [runtime-name] [--query query] Lists the devices remove device [runtime-name] id Removes a device device [runtime-name] id set status new-status Changes the status of a device device [runtime-name] id set appstatus app-name new-status Changes the status of a device for an app
Interactive mode
Alternatively, we can also call wladm without any command in the command line. Then enter commands interactively, one per line.
The exit command, or end-of-file on standard input (Ctrl-D on UNIX terminals) terminates wladm.
Help commands are also available in this mode. For example:
- help
- help show versions
- help device
- help device set status
Command history in interactive mode
On some operating systems, the interactive wladm command remembers the command history. With the command history, we can select a previous command, using the arrow-up and arrow-down keys, edit it, and execute it.
- On Linux, the command history is enabled in terminal emulator windows if the rlwrap package is installed and found in PATH. To install the rlwrap package:
- On Red Hat Linux: sudo yum install rlwrap
- On SUSE Linux: sudo zypper install rlwrap
- On Ubuntu: sudo apt-get install rlwrap
- On OS X, the command history is enabled in the Terminal program if the rlwrap package is installed and found in PATH. To install the rlwrap package:
- Install MacPorts using the installer from www.macports.org.
- Run the command:
sudo /opt/local/bin/port install rlwrap
Then, to make the rlwrap program available in PATH, use this command in a Bourne-compatible shell:
PATH=/opt/local/bin:$PATH
- On Windows, the command history is enabled in cmd.exe console windows.
In environments where rlwrap does not work or is not desired, we can disable its use through the option --no-readline.
The configuration file
We can also store the options in a configuration file, instead of passing them on the command line at every call. When a configuration file is present and the option –configfile=file is specified, we can omit the following options:
- --url=URL
- --secure=boolean
- --user=name
- --passwordfile=file
- runtime-name
Use these commands to store these values in the configuration file.
Command Comment wladm [--configfile=file] config url URL wladm [--configfile=file] config secure boolean wladm [--configfile=file] config user name wladm [--configfile=file] config password Prompts for the password. wladm [--configfile=file] config runtime runtime-name Use this command to list the values stored in the configuration file: wladm [--configfile=file] config
The configuration file is a text file, in the encoding of the current locale, in Java .properties syntax. The default configuration file is on
- UNIX: $HOME/.wladm.config
- Windows: My Documents\IBM MobileFirst Platform Server Data\wladm.config, or My Documents\IBM Worklight Server Data\wladm.config
When we do not specify a --configfile option, the default configuration file is used only in interactive mode and in config commands. For noninteractive use of the other commands, we must explicitly designate the configuration file to use one.
Important: The password is stored in an obfuscated format that hides the password from an occasional glimpse. However, this obfuscation provides no security.
Generic options
There are also the usual generic options:
Option Description --help Shows some usage help --version Shows the version
XML format
The commands that receive an XML response from the server verify that this response complies with the specific schema. We can disable this check by specifying --xmlvalidation=none.
Output character set
Normal output that is produced by the wladm program is encoded in the encoding format of the current locale. On Windows, this encoding format is "ANSI code page". The effects are as follows:
- Characters outside of this character set are converted to question marks when they are output.
- When the output goes to a Windows command prompt window (cmd.exe), non-ASCII characters are incorrectly displayed because such windows assume characters to be encoded in "OEM code page".
To work around this limitation:
- On operating systems other than Windows, use a locale whose encoding is UTF-8. This format is the default locale on Red Hat Linux and OS X. Many other operating systems have a en_US.UTF-8 locale.
- Or use the wladm Ant task, with attribute output="some file name" to redirect the output of a command to a file.
Parent topic: Administer MobileFirst applications through the command line