You can modify nested attributes for a configuration object using scripting and the wsadmin tool.
Using Jacl:
set t1 [$AdminConfig getid /DataSource:TechSamp/]Using Jython:
t1=AdminConfig.getid('/DataSource:TechSamp/')where:
set | is a Jacl command |
t1 | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object representing the WebSphere Application Server configuration |
getid | is an AdminConfig command |
DataSource | is the object type |
TechSamp | is the name of the object that will be modified |
Using Jacl:
$AdminConfig modify $t1 {{connectionPool {{reapTime 2003}}}}Using Jython list:
AdminConfig.modify(t1, [["connectionPool", [["reapTime", 2003]]]])Using Jython string:
AdminConfig.modify(t1, '[[connectionPool [[reapTime 2003]]]]')where:
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object representing the WebSphere Application Server configuration |
modify | is an AdminConfig command |
t1 | evaluates to the configuration ID of the datasource in step number 2 |
connectionPool | is an attribute |
reapTime | is a nested attribute within the connectionPool attribute |
2003 | is the value of the reapTime attribute |
Using Jacl:
$AdminConfig saveUsing Jython:
AdminConfig.save()Use the reset command of the AdminConfig object to undo changes that you made to your workspace since your last save.
Using Jacl:
set techsamp [$AdminConfig getid /DataSource:TechSamp/] set pool [$AdminConfig showAttribute $techsamp connectionPool] $AdminConfig modify $pool {{reapTime 2003}}Using Jython list:
techsamp=AdminConfig.getid('/DataSource:TechSamp/') pool=AdminConfig.showAttribute(techsamp,'connectionPool') AdminConfig.modify(pool,[['reapTime',2003]])Using Jython string:
techsamp=AdminConfig.getid('/DataSource:TechSamp/') pool=AdminConfig.showAttribute(techsamp,'connectionPool') AdminConfig.modify(pool,'[[reapTime 2003]]')In this example, the first command gets the configuration id of the DataSource, and the second command gets the connectionPool attribute. The third command sets the reapTime attribute on the ConnectionPool object directly.