IBM


5.4.1 General approach for configuration tasks

The are many possible configuration tasks that can be performed in a WebSphere environment. Rather than document every possible modification, we describe a general approach to use when performing configuration tasks and then give a few specific examples.

This general approach has three steps:

1. Find the object you want to change using AdminConfig.getid().

2. Change or create a configuration using AdminConfig.modify() or create().

3. Save the changes using AdminConfig.save().

The create and modify commands use an attribute list. In general, the attribute is supplied as a list of Jython lists. A Jython list can be constructed using name and value pairs as follows:

[ ['name1', 'value1'],['name2', 'value2''],['name3', 'value3']... ]

The attributes for a WebSphere configuration object are often deeply nested. If modify a nested attribute, you can get the ID of the object and modify it directly. This is the preferred method, although it requires more lines of scripting.


Redbooks ibm.com/redbooks

Next