workclassoperations.py スクリプトを使用すると、作業クラスを作成、更新、および管理することができます。
workclassoperations.py スクリプト は、install_root/bin ディレクトリーにあります。
./wsadmin.sh|bat -lang jython -f workclassoperations.py operation --help
./wsadmin.sh -lang jython -f ..¥..¥..¥bin¥workclassoperations.pyデプロイメント・マネージャーが開始していない場合は、追加のパラメーター -conntype NONE を組み込む必要がありますので注意してください。
./wsadmin.sh -lang jython -conntype NONE workclassoperations.py
./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses
./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --appname Trade
./wsadmin.sh|bat -lang jython -f workclassoperations.py createWorkClass --type ARP --wcname CustomWorkClass --protocol HTTP --wcaction "reject?404" --appname Trade --module myModule.war --members "/test1?/test2"
./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --type ARP --appname Trade
./wsadmin.sh|bat -lang jython -f workclassoperations.py getDefaultAction --type ARP --wcname CustomWorkClass --appname Trade
./wsadmin.sh|bat -lang jython -f workclassoperations.py modifyDefaultAction --type ASP --wcname Default_HTTP_WC --wcaction Default_TC --appname Trade-edition1.0
import java.lang.System as System wasinstallroot=System.getProperty("was.install.root") execfile(wasinstallroot+"/bin/XDPYModules.py") import java.lang.System as System wasinstallroot=System.getProperty("was.install.root") execfile(wasinstallroot+"/bin/XDPYModules.py") #application with name DayTrader installed with edition 1.2 appName="DayTrader-edition1.2" #Default_TC_GOLD is the default transaction class mapped to service policy GOLD modifyAppSLADefaultAction("Default_HTTP_WC", appName, tcName, 0) AdminConfig.save()
./wsadmin.sh|bat -lang jython -f workclassoperations.py addRules --wcname CustomWorkClass --appname Trade --type ARP --rule "1?clienthost=¥'localhost¥' and serverhost like ¥'¥%%.ibm.com¥'?permit?Trade"
./wsadmin.sh|bat -lang jython -f workclassoperations.py removeRule --wcname CustomWorkClass --appname Trade --type ARP --priority 1
./wsadmin.sh|bat -lang jython -f workclassoperations.py removeWorkClass --type ARP --wcname CustomWorkClass --appname Trade