Perform operations on running objects using wsadmin
Use scripting to invoke operations on running objects.
Start the wsadmin scripting client
Perform the following steps to perform operations on running objects:
Jython...
### Set the s1 variable to the running object...
s1 = AdminControl.completeObjectName('type=Server,name=server1,*')
### Invoke the operation
AdminControl.invoke(s1, 'stop')Jacl...
### Set the s1 variable to the running object...
set s1 [$AdminControl completeObjectName type=Server,name=server1,*]
### Invoke the operation
$AdminControl invoke $s1 stop
Example
The following example is for operations that require parameters:
- Jython...
traceServ = AdminControl.completeObjectName('type=TraceService,process=server1,*')
AdminControl.invoke(traceServ, 'appendTraceString', "com.ibm.ws.management.*=all=enabled")- Jacl...
set traceServ [$AdminControl completeObjectName type=TraceService,process=server1,*]
$AdminControl invoke $traceServ appendTraceString "com.ibm.ws.management.*=all=enabled"
Related tasks
Use AdminControl for scripted administration
Modify attributes on running objects with wsadmin
Related
Commands for AdminControl