Configure a variable map using wsadmin
Using Jacl...
set server [$AdminConfig getid /Cell:cell/Node:node/Server:server2/] set varMap [$AdminConfig create VariableMap $server {}] ### If your server already has an existing ### variable map, then you can use the following to get its configuration object... set varMap [$AdminConfig getid /Cell:cell/Node:node/Server:server2/VariableMap:/] ### Create variable map entries DB2_INSTALL_ROOT and DB2_LIB_DIR. ### DB2_LIB_DIR refers back to DB2_INSTALL_ROOT... set nameattr1 [list symbolicName DB2_INSTALL_ROOT] set valattr1 [list value "/db2/sqllib"] set nameattr2 [list symbolicName DB2_LIB_DIR] set valattr2 [list value "\${DB2_INSTALL_ROOT}/lib"] set attr1 [list $nameattr1 $valattr1] set attr2 [list $nameattr2 $valattr2] set attrs [list $attr1 $attr2] $AdminConfig modify $varMap [subst {{entries {$attrs}}}] ### View the variable map... $AdminConfig showall $varMap $AdminConfig save
Using Jython
server = AdminConfig.getid('/Cell:cell/Node:node/Server:server2/') print server varMap = AdminConfig.create('VariableMap', server, []) print varMap varMap = AdminConfig.getid('/Cell:cell/Node:node/Server:server2/VariableMap:/') nameattr1 = ['symbolicName', 'DB2_INSTALL_ROOT'] valattr1 = ['value', "/db2/sqllib"] nameattr2 = ['symbolicName', 'DB2_LIB_DIR'] valattr2 = ['value', "\${DB2_INSTALL_ROOT}/lib"] attr1 = [nameattr1, valattr1] attr2 = [nameattr2, valattr2] attrs = [attr1, attr2] print attrs AdminConfig.modify(varMap, [['entries', [attrs]]]) print AdminConfig.showall(varMap) AdminConfig.save()