Pattern matching with the wsadmin tool

 

+

Search Tips   |   Advanced Search

 

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.

Before starting this task, the wsadmin tool must be running.

 

Overview

Use pattern matching when you install, edit, or update an application.

The following example uses pattern matching to install an application with the MapModulesToServers option:

To install all WAR and JAR files to WAS using Jacl...

$AdminApp install MyApp.ear {-appname TEST -MapModulesToServers {{.* .* WebSphere:cell=myCell,node=myNode,server=myServer}}}

Using Jython...

AdminApp.install('MyApp.ear', ['-appname', 'TEST', '-MapModulesToServers', [['.*', '.*', 'WebSphere:cell=myCell,node=myNode,server=myServer']]])

To install all WAR file to...

cell=myCell,node=myNode,server=myServer

...and all JAR files to...

cell=myCell,node=yourNode,server=yourServer

...using Jacl...

$AdminApp install MyApp.ear {-appname TEST -MapModulesToServers {{.* .*.war,.* WebSphere:cell=myCell,node=myNode,server=myServer} {.* .*.jar,.* WebSphere:cell=myCell,node=yourNode,server=yourServer}}}

Using Jython...

AdminApp.install('MyApp.ear', ['-appname', 'TEST', '-MapModulesToServers', [['.*', '.*.war,.*', 'WebSphere:cell=myCell, node=myNode,server=myServer'], ['.*', '.*.jar,.*', 'WebSphere:cell=myCell,node=yourNode,server=yourServer']]])

 

What to do next

Save the configuration changes.



Commands for the AdminApp object
Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands