Sunday, April 4, 2010

Options for WebSphere Application Server Scripting

 WebSphere Application Server (WAS) provides a scripting interface called wsadmin. wsadmin supports two scripting languages jacl* and jython. Five objects are available when you use scripts:
  • AdminControl: Use to run operational commands.
  • AdminConfig: Use to run configurational commands to create/modify WAS configuration.
  • AdminApp: Use to administer applications.
  • AdminTask: Use to run administrative commands.
  • Help: Use to obtain general help.

WAS provides a number of aids to developers and system administrators for the development of wsadmin scripts. Different options that can be leveraged in developing wsadmin scripts are explained below.

WAS V7 Script Libraries (new in v7 .. supported)
WebSphere Application Server V7.0 includes script libraries that can simplify the use of these objects.
Script libraries can be used to perform a higher level of wsadmin functions than can be done using a single wsadmin command. Only a single line from a library function is needed to perform complex functions. Each script is written in Jython, and is often referred to as “the Jython script”. The script libraries are categorized into six types (Application, Resources, Security, Servers, System) and the types are further subdivided into application and utilities. See the WAS V7 Administration and Configuration Guide chapter 8 for additional details. The script libraries are located in  WAS_INSTALL_ROOT/scriptLibraries directory. These libraries are loaded when wsadmin starts and are readily available from the wsadmin command prompt or to be used from the customized scripts.

Command assistance ( supported)
The command assistance feature in the administrative console was introduced in WAS V6.1 with limited scope in function. The command assistance feature has been broadened in V7.0. When you perform an action in the administrative console, you can select the View administrative scripting command for last action option in the Help area of the panel to display the command equivalent. This command can be copied and pasted into a script or command window.You also have the option to send these as notifications to the Rational Application Developer V7.5, where you can use the Jython editor to build scripts.

wsadminlib.py ( 'as-is' see note below)
Another resource for WebSphere System Administrators for scripting is the wsadminlib.py script library.
wsadminlib.py  wsadminlib.py is a large python file containing hundreds of methods to help simplify configuring the WAS using scripting. A wide variety of methods have been developed. These methods perform tasks such as creating servers, starting servers, creating clusters, installing applications, proxies, core groups, core group bridge, dynacache, shared libraries, classloaders, replication domains, security, BLA, JDBC, etc. Please note that wsadminlib is provided on an 'as is' basis under the IBM DeveloperWorks license agreement. It is not a supported product. The underlying wsadmin calls made by the scripts are however supported by IBM.



Happy Scripting!


* jacl has been stabilized

1 comments:

Gerhard Poul said...

Please notice that as of WAS V7.0 the jacl administrative scripting support is stabilized, not deprecated.