+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Calling the mfpadm program

We can use the mfpadm program to administer MobileFirst applications.


Syntax

Call the mfpadm program as follows:

The mfpadm program has the following options:

Table 1. mfpadm program 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  
--timeout Number Timeout for the entire REST service access, in seconds No  
--connect-timeout Number Timeout for establishing a network connection, in seconds No  
--socket-timeout Number Timeout for detecting the loss of a network connection, in seconds No  
--connection-request-timeout Number Timeout for obtaining an entry from a connection request pool, in seconds No  
--lock-timeout Number Timeout for acquiring a lock, in seconds No 2
--verbose   Detailed output No  

The mfpadm calls contains a command. The following commands are supported.

Table 2. mfpadm invocation supported commands
Command Description
show info Shows user and configuration information.
show global-config Shows global configuration information.
show diagnostics Shows diagnostics information.
show versions Shows version information.
unlock Releases the general-purpose lock.
list runtimes [--in-database] Lists the runtimes.
show runtime [runtime-name] Shows information about a runtime.
delete runtime [runtime-name] condition Deletes a runtime.
show user-config [runtime-name] Shows the user configuration of a runtime.
set user-config [runtime-name] file Specifies the user configuration of a runtime.
set user-config [runtime-name] property = value Specifies a property in the user configuration of a runtime.
show confidential-clients [runtime-name] Shows the configuration of the confidential clients of a runtime.
set confidential-clients [runtime-name] file Specifies the configuration of the confidential clients of a runtime.
set confidential-clients-rule [runtime-name] id display-name secret allowed-scope Specifies a rule for the configuration of the confidential clients of a runtime.
list adapters [runtime-name] Lists the adapters.
deploy adapter [runtime-name] property = value 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.
show app version [runtime-name] app-name environment version Shows information about an app version.
delete app version [runtime-name] app-name environment version Deletes a version of an app.
app [runtime-name] app-name show license-config Shows the token license configuration of an app.
app [runtime-name] app-name set license-config app-type license-type Specifies the token license configuration for an app.
app [runtime-name] app-name delete license-config Removes the token license configuration for an app.
app version [runtime-name] app-name environment version get descriptor [> tofile] Gets the descriptor of an app version.
app version [runtime-name] app-name environment version get web-resources [> tofile] Gets the web resources of an app version.
app version [runtime-name] app-name environment version set web-resources file Specifies the web resources of an app version.
app version [runtime-name] app-name environment version get authenticity-data [> tofile] Gets the authenticity data of an app version.
app version [runtime-name] app-name environment version set authenticity-data [file] Specifies the authenticity data of an app version.
app version [runtime-name] app-name environment version delete authenticity-data Deletes the authenticity data of an app version.
app version [runtime-name] app-name environment version show user-config Shows the user configuration of an app version.
app version [runtime-name] app-name environment version set user-config file Specifies the user configuration of an app version.
app version [runtime-name] app-name environment version set user-config property = value Specifies a property in the user configuration of an app version.
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.
list farm-members [runtime-name] Lists the servers that are members of the server farm.
remove farm-member [runtime-name] server-id Removes a server from the list of farm members.


Interactive mode

Alternatively, we can also call mfpadm without any command in the command line. We can then enter commands interactively, one per line.

The exit command, or end-of-file on standard input (Ctrl-D on UNIX terminals) terminates mfpadm.

Help commands are also available in this mode. For example:


Command history in interactive mode

On some operating systems, the interactive mfpadm 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.

In environments where rlwrap does not work or is not required, 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:

Use these commands to store these values in the configuration file.

Table 3. Commands to store values in the configuration file
Command Comment
mfpadm [--configfile=file] config url URL  
mfpadm [--configfile=file] config secure boolean  
mfpadm [--configfile=file] config user name  
mfpadm [--configfile=file] config password Prompts for the password.
mfpadm [--configfile=file] config timeout seconds  
mfpadm [--configfile=file] config connect-timeout seconds  
mfpadm [--configfile=file] config socket-timeout seconds  
mfpadm [--configfile=file] config connection-request-timeout seconds  
mfpadm [--configfile=file] config lock-timeout seconds  
mfpadm [--configfile=file] config runtime runtime-name  

Use this command to list the values that are stored in the configuration file: mfpadm [--configfile=file] config

The configuration file is a text file, in the encoding of the current locale, in Java™ .properties syntax. Default configuration file:

Note: 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 if we want 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:

Table 4. 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 mfpadm 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:

To work around this limitation:

Parent topic: Administering MobileFirst applications through the command line