Pattern matching with wsadmin
Use the Jython or Jacl scripting language to implement pattern matching when installing, updating, or editing an application. Pattern matching simplifies the task of supplying required values for certain complex options by allowing you to pass in asterisk (*) to all of the required values that cannot be edited.
There are two ways to complete this task. This page uses the AdminApp object to install enterprise apps. Alternatively, we can use the scripts in the AdminApplication script library to install, uninstall, and administer the application configurations with many options, including pattern matching.
The scripting library provides a set of procedures to automate the most common administration functions. We can run each script procedure individually, or combine several procedures to quickly develop new scripts.
- Install each WAR and Java™ archive file to the application server.
- Launch the wsadmin scripting tool using Jython.
- Install each WAR and Java archive file to the appserver, as the following examples demonstrate:
- Jython...
AdminApp.install('DefaultApplication.ear', ['-appname', 'TEST', '-MapModulesToServers', [['.*', '.*', 'WebSphere:cell=myCell,node=myNode,server=myServer']]])- Jacl...
$AdminApp install DefaultApplication.ear {-appname TEST -MapModulesToServers {{.* .* WebSphere:cell=myCell,node=myNode,server=myServer}}}
- Save the configuration changes...
AdminConfig.save()- Install each WAR file to the myServer server on the myNodenode and each JAR file to the theServer server on the theNode node.
- Launch the wsadmin scripting tool using Jython.
- Install the WAR and JAR files to different appserver management scopes, as the following examples demonstrate:
- Jython...
AdminApp.install('DefaultApplication.ear', ['-appname', 'TEST', '-MapModulesToServers', [['.*', '.*.war,.*', 'WebSphere:cell=myCell,node=myNode,server=myServer'], ['.*', '.*.jar,.*', 'WebSphere:cell=myCell,node=yourNode,server=yourServer']]])- Jacl...
$AdminApp install DefaultApplication.ear {-appname TEST -MapModulesToServers {{.* .*.war,.* WebSphere:cell=myCell,node=myNode,server=myServer} {.* .*.jar,.* WebSphere:cell=myCell,node=yourNode,server=yourServer}}}
- Save the configuration changes...
AdminConfig.save()
Related tasks
Automating application configurations using the scripting library
Related
Application installation and uninstallation scripts
Commands for AdminApp
Options for AdminApp install, installInteractive, edit, editInteractive, update, and updateInteractive commands