You can modify configuration objects using scripting and the wsadmin tool. Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.
When using the modify command for the AdminConfig object, use the configuration object ID to modify the attribute you want to change. If you use the parent object ID to modify the attribute, the command resets all other attributes that are not specified to the default values. For example, you use the modify command to change the monitoring policy settings through its parent object, the process definition object. All attributes for the process definition object that were not modified with the command, such as the pingInterval and pingTimeout attributes, are reset to their default values.
Perform the following steps to modify a configuration object:
Using Jacl:
set jdbcProvider1 [$AdminConfig getid /JDBCProvider:myJdbcProvider/]
jdbcProvider1 = AdminConfig.getid('/JDBCProvider:myJdbcProvider/')
where:
set | is a Jacl command |
jdbcProvider1 | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object that represents the WebSphere Application Server configuration |
getid | is an AdminConfig command |
/JDBCProvider:myJdbcProvider/ | is the hierarchical containment path of the configuration object |
JDBCProvider | is the object type |
myJdbcProvider | is the optional name of the object |
Using Jacl:
$AdminConfig show $jdbcProvider1
AdminConfig.show(jdbcProvider1)
where:
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object that represents the WebSphere Application Server configuration |
show | is an AdminConfig command |
jdbcProvider1 | evaluates to the ID of the host node that is specified in step number 1 |
Using Jacl:
$AdminConfig modify $jdbcProvider1 {{description "This is my new description"}}
AdminConfig.modify(jdbcProvider1, [['description', "This is my new description"]])
AdminConfig.modify(jdbcProvider1, '[[description "This is my new description"]]')
where:
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object that represents the WebSphere Application Server configuration |
modify | is an AdminConfig command |
jdbcProvider1 | evaluates to the ID of the host node that is specified in step number 1 |
description | is an attribute of server objects |
This is my new description | is the value of the description attribute |
You can also modify several attributes at the same time. For example:
Using Jacl:
{{name1 val1} {name2 val2} {name3 val3}}
[['name1', 'val1'], ['name2', 'val2'], ['name3', 'val3']]
'[[name1 val1] [name2 val2] [name3 val3]]'
Using Jacl:
$AdminConfig attributes JDBCProvider
print AdminConfig.attributes('JDBCProvider')
Example output:
$AdminConfig attributes JDBCProvider "classpath String*" "description String" "implementationClassName String" "name String" "nativepath String*" "propertySet J2EEResourcePropertySet" "providerType String" "xa boolean"
Using Jacl:
$AdminConfig modify $jdbcProvider1 {{classpath {}}} $AdminConfig modify $jdbcProvider1 [list [list classpath /temp/db2j.jar]]
Using Jython list:
AdminConfig.modify(jdbcProvider1, [['description', []]]) AdminConfig.modify(jdbcProvider1, [['description', '/temp/db2j.jar']]
Using Jython string:
AdminConfig.modify(jdbcProvider1, '[]') AdminConfig.modify(jdbcProvider1, '[[description /temp/db2j.jar]]')