Modify Server configuration using wsadmin
Using Jacl
### ### Create a server... ### set xnode [$AdminConfig getid /Node:nodename/] set xserver [$AdminConfig create Server $xnode {{name servername}}] ### ### Make a configuration change to the server ### $AdminConfig modify $xserver {{stateManagement {{initialState STOP}}}} $AdminConfig save ### ### Synchronize Nodes. xstatus is either true or false ### set xSync [$AdminControl completeObjectName type=NodeSync,node=nodename,*] xstatus = $AdminControl invoke $xSync sync
Using Jython
### Set a variable for creating a server... xnode = AdminConfig.getid('/Node:node/') ### Create a server using list serv1 = AdminConfig.create('Server', xnode, [['name', 'servername']]) ### Create a server using string serv1 = AdminConfig.create('Server', xnode, '[[name servername]]') ### Make a configuration change to the server with the following command... AdminConfig.modify(serv1, [['stateManagement', [['initialState', 'STOP']]]]) AdminConfig.save() ### Set the variable for node synchronize. xSync = AdminControl.completeObjectName('type=NodeSync,node=nodeName') ### Synchronize AdminControl.invoke(xSync, 'sync')