Network Deployment (Distributed operating systems), v8.0 > Reference


Jython script library


Overview

The script library provides Jython script procedures to assist in automating the environment. Use the sample scripts to manage applications, resources, servers, nodes, and clusters. We can also use the script procedures as examples to learn the Jython syntax.

The Jython script library provides a set of procedures to automate the most common application server administration functions. For example, you can use the script library to configure servers, applications, mail settings, resources, nodes, business-level applications, clusters, authorization groups, and more. We can run each script procedure individually, or combine several procedures to quickly develop new scripts.


Run scripts interactively


Execute a script

For example, ...


Write custom scripts

Each script example in the script library demonstrates best practices for writing wsadmin scripts. The script library code is located in the...

WAS_HOME/scriptLibraries

Within this directory, the scripts are organized into subdirectories according to functionality, and further organized by version. For example...

WAS_HOME/scriptLibraries/application/V70

...contains procedures that perform application management tasks that are applicable to v7.0 and later of the product.

Each script from the script library directory automatically loads when you launch wsadmin.sh.

To load Jython scripts (*.py) when wsadmin.sh starts, create a new subdirectory, and save existing automation scripts in...

Each script library name must be unique and cannot be duplicated. Do not edit the script procedures in the script library.

To customize script library procedures, save the modified scripts to a new subdirectory to avoid overwriting the library.

To automatically load Jython scripts (*.py) that are not located in...

...set the property...

...to the script location. For example, if your script libraries are saved in the temp directory on a Windows operating system, the following example sets the script path in the wsadmin command line tool:

To load multiple directories, specify each directory in the system property separated by a semicolon (;):

The script library provides automation scripts for the following application server administration functions:


MBeans

When you issue a Jython command in a wsadmin script that invokes a WebSphere Application Server MBean operation, and the MBean method returns a string that includes some NLS translated characters such as the French accent character, Jython automatically converts the string to a python unicode string, and returns the converted string to wsadmin. If you include the Jython print output command in the script that invokes the MBean method, the NLS translated characters are included in the string that the MBean method returns to wsadmin instead of the python unicode values.

To avoid the displaying of NLS translated characters, use a variable for the MBean return (for example, output = AdminControl.invoke(mbean)) and then use print output. Use the Jython print command to convert strings that contain NLS translated characters correctly.


Procedures

  1. Manage application servers
  2. Manage server and system architecture
  3. Manage applications
  4. Manage data access resources
  5. Manage messaging resources
  6. Manage mail resources
  7. Manage authorization groups
  8. Get script library help

+

Search Tips   |   Advanced Search