The AdminApp object for scripted administration

The AdminApp object interacts with the WebSphere Application Server management and configuration services to administer applications. For example, you can use the AdminApp object to install and uninstall applications, list the modules for an application, and export an application.

You can invoke most of the AdminApp functions in local mode, which means that the client does not communicate with the server to accomplish the function. To run in local mode, use the -conntype NONE option when you start the scripting client. If a server is running, it is not recommended that you run the AdminApp tool in local mode.

For additional information about the AdminApp object, see these topics:

The following public methods are available for the AdminApp object:

deleteUserAndGroupEntries
Deletes users or groups for all roles, and deletes userids and passwords for all of the RunAs roles defined in the application.

Parameters: appname

Example usage:

$AdminApp deleteUserAndGroupEntries myapp

edit
Edits an application or module in interactive mode.

Parameters: appname, options

Example usage:

$AdminApp edit "JavaMail Sample" {-MapWebModToVH {{"JavaMail 
Sample WebApp" mtcomps.war,WEB-INF/web.xml newVH}}}

Note: The edit command changes the application deployment. Specify these changes in the options parameter. No options are required for the edit command.

editInteractive
Edits an application or module in interactive mode.

Parameters: appname, options

Example usage:

$AdminApp editInteractive ivtApp

Note: The editInteractive command changes the application deployment. Specify these changes in the options parameter. No options are required for the editInteractive command.

export
Exports the application appname parameter to a file you specify by file name.

Parameters: appname, filename

Example usage:

$AdminApp export "My App" /usr/me/myapp.ear

exportDDL
Extracts the description definition language (DDL) from the application appname parameter to the directoryname parameter that a directory specifies.

Note: This command is not supported when running from a system with only standalone scripting client install.

Parameters: appname, directoryname, options

Example usage:

$AdminApp exportDDL "My App" /usr/me/DDL

help
Displays help for the AdminApp object and AdminApp commands.

Output:

wsadmin>$AdminApp help 
WASX7095I: The AdminApp object allows application objects to 
be manipulated including installing, uninstalling, editing,
and listing.  Most of the commands supported by AdminApp operate in two
modes: the default mode is one in which AdminApp communicates with the
WebSphere server to accomplish its tasks.  A local mode is also
possible, in which no server communication takes place.  The local
mode of operation is invoked by including the "-conntype NONE" flag in the
option string supplied to the command.

The following commands are supported by AdminApp; more detailed
information about each of these commands is available by using the
"help" command of AdminApp and supplying the name of the command
as an argument.

edit            Edit the properties of an application
editInteractive Edit the properties of an application interactively
export          Export application to a file
exportDDL       Extract DDL from application to a directory
help            Show help information
install         Installs an application, given a file name and an option string.
installInteractive
                Installs an application in interactive mode, given a file name
                and an option string.
list            List all installed applications
listModules     List the modules in a specified application
options         Shows the options available, either for a given file, or in
                general.
taskInfo        Shows detailed information pertaining to a given install task
                for a given file
uninstall       Uninstalls an application, given an application name and
                an option string

install
Installs an application in non-interactive mode, given a fully qualified file name and a string of installation options.

Note: This command is not supported when running from a system with only standalone scripting client install.

Parameters: earfile, options

Example usage:

$AdminApp install /home/mydir/apps/myapp.ear

There are many options available for this command. You can obtain a list of valid options for an EAR file with the following command:

$AdminApp options <earfilename>

You can also obtain help for each object with the following command:

$AdminApp help <optionname>

installInteractive
Installs an application in interactive mode, given a fully qualified file name and a string of installation options.

Note: This command is not supported when running from a system with only standalone scripting client install.

Parameters: earfile, options

Example usage:

$AdminApp installInteractive /QIBM/UserData/WebAS5/Base/myInstance/installableApps/jmsample.ear

list
Lists the applications installed in the configuration.

Parameters: none

Example usage:

$AdminApp list

Example output:

wsadmin>$AdminApp list 
adminconsole 
DefaultApplication 
ivtApp

listModules
Lists the modules in an application.

Parameters: appname, options

Example usage:

$AdminApp listModules ivtApp

Example output:

wsadmin>$AdminApp listModules ivtApp 
ivtApp#ivtEJB.jar+META-INF/ejb-jar.xml 
ivtApp#ivt_app.war+WEB-INF/web.xml

This example is formed by the concatenation of appname, #, module URI, +, and DD URI. You can pass this string to the edit and editInteractive AdminApp commands.

options
Displays a list of options for installing an EAR file.

Parameters: earfile

Example usage:

$AdminApp options /QIBM/UserData/WebAS5/Base/myInstance/installableApps/jmsample.ear

publishWSDL
Publishes WSDL files for the application specified in the appname parameter to the file specified in the filename parameter using the soap address prefixes specified in the soapAddressPrefixes parameter.

Parameters: appname, filename, soapAddressPrefixes

Example usage:

$AdminApp publishWSDL JAXRPCHandlersServer /temp/a.zip
{{JAXRPCHandlersServerApp.war  {{http http://localhost:9080}}}}

taskInfo
Provides information about a particular task option for an application file.

Parameters: earfile, task name

Example usage:

$AdminApp taskInfo /QIBM/UserData/WebAS5/Base/myInstance/installableApps/jmsample.ear 
  MapWebModToVH

Example output:

MapWebModToVH: Selecting virtual hosts for Web modules
Specify the virtual host where you want to install the Web modules contained in
your application. Web modules can be installed on the same virtual host 
or dispersed among several hosts.
Each element of the MapWebModToVH task consists of the following 3 fields: 
"webModule," "uri," "virtualHost."
Of these fields, the following may be assigned new values: "virtualHost"
and the following are required: "virtualHost"

The current contents of the task after running default bindings are:
webModule: JavaMail Sample WebApp
uri: mtcomps.war,WEB-INF/web.xml
virtualHost: null

updateAccessIDs
Updates the access id information for users and groups assigned to various roles defined in the application. The access ids are read from the user registry and saved in the application bindings. It is recommended that you call this method after you install an application or after you edit security role information for an installed application. The scripting client must be connected to the application server when you invoke this command.

The bAll boolean parameter retrieves and saves all access IDs for users and groups in the application bindings. Specify false if you want to retrieve access ids for users or groups that do not have an access id in the application bindings.

Parameters: appname, bAll

Example usage:

$AdminApp updateAccessIDs myapp true