Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS
workclassoperations.py script
You can use the workclassoperations.py script to create, update, and manage work classes.
Purpose
You can perform the following actions with the workclassoperations.py script:
- Create and update work classes for enterprise applications and generic server clusters
- List the rules in work classes
- List the members of work classes
- Delete work classes for the various policies and communication protocols
- Fetch default actions
- Set default actions
- Add rules
- Delete rules
- Delete members
Location
The workclassoperations.py script is located in the install_root/bin directory.
Usage
The script usage for general help follows:./wsadmin.sh|bat -lang jython -f workclassoperations.pyThe script usage for operation-specific help follows:./wsadmin.sh|bat -lang jython -f workclassoperations.py operation --helpDepending on where you are issuing the command, you might have to specify the path to workclassoperation.py. For example, you create a profile named Dmgr01 located in the c:\WAS_INSTALL_ROOT\profiles\Dmgr01\bin directory. From within that directory, type the following:./wsadmin.sh -lang jython -f ..\..\..\bin\workclassoperations.pyNote that if the deployment manager is not started, include the additional parameter -conntype NONE:./wsadmin.sh -lang jython -conntype NONE workclassoperations.py
Operations
You can perform the following operations with the workclassoperations.py script:
- listWorkClasses
- Lists work classes by type. The format of listing is: workclassname type appname/odrname deploymentname
- --type
- Specifies the type of work class to list:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- createWorkClass
- Creates a work class. The new service policy does not contain any application modules or classification rules. You must create and associate application modules and classification rules separately.
- --type
- Specifies the type of work class to create:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --nodename
- Name of the node. Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --protocol
- Specifies the communications protocol that transmits the request. Currently supported protocols are HTTP, IIOP, SOAP, and JMS.
- --wcaction
- Default action to take when a request is matched to a member for the specified work class.
- --module
- Specifies the application module to associate members. Required if you specify the --appname and --members parameters.
- --members
- Specifies the protocol-specific pattern:
- HTTP: /test1?/test2/*
- IIOP: ejbName:ejbMethod?ejbName:ejbMethod
- SOAP: webService:operationName?webService:operationName
- JMS: bus:destination?bus:destination
- --rule
- Specifies a classification rule in the format of "priority?rule?action"
- --virtualhost
- Specifies the virtual host. Required if you specify the --type parameter as GSP or GRP.
- removeWorkClass
- Removes a work class.
- --type
- Specifies the type of work class to remove:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- addMembers
- Adds members to a work class. The ODR uses the new member to match incoming requests.
- --type
- Specifies the type of work class to modify:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --nodename
- Name of the node. Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --protocol
- Specifies the communications protocol that transmits the request. Currently supported protocols are HTTP, IIOP, SOAP, and JMS.
- --module
- Specifies the application module to associate members. Required if you specify the --appname and --members parameters.
- --members
- Specifies the protocol-specific pattern:
- HTTP: /test1?/test2/*
- IIOP: ejbName:ejbMethod?ejbName:ejbMethod
- SOAP: webService:operationName?webService:operationName
- JMS: bus:destination?bus:destination
- --ejbname
- Name of the EJB. Required only when you specify the --protocol parameter as JMS and the --module parameter as IIOP.
- removeMembers
- Removes members from a work class. The member is no longer used by the ODR.
- --type
- Specifies the type of work class to modify:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --protocol
- Specifies the communications protocol that transmits the request. Currently supported protocols are HTTP, IIOP, SOAP, and JMS.
- --module
- Specifies the application module from which to disassociate members. Required if you specify the --appname and --members parameters.
- --members
- Specifies the protocol-specific pattern:
- HTTP: /test1?/test2/*
- IIOP: ejbName:ejbMethod?ejbName:ejbMethod
- SOAP: webService:operationName?webService:operationName
- JMS: bus:destination?bus:destination
- listMembers
- Lists members of a work class.
- --type
- Specifies the type of work class to list:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --nodename
- Name of the node. Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --protocol
- Specifies the communications protocol that transmits the request. Currently supported protocols are HTTP, IIOP, SOAP, and JMS.
- addRules
- Adds a classification rule that is used by the ODR to a work class. If you issue the command with the like wildcard '%' on UNIX operating systems, replace the escape sequence (\%%) with (\%).
- --type
- Specifies the type of work class to modify:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --nodename
- Name of the node. Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --rule
- Specifies a classification rule in the format of "priority?rule?action"
- removeRule
- Removes a classification rule from a work class. The rule is no longer used by the ODR.
- --type
- Specifies the type of work class to modify:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --expression
- Specifies the rule expression.
- --priority
- Specifies the priority of the rule to match. The rule with the lowest priority is matched first.
- listRules
- Lists classification rules.
- --type
- Specifies the type of work class to modify:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- modifyDefaultAction
- Edits the default action for a work class.
- --type
- Specifies the type of work class to modify:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --wcaction
- Default action to take when a request is matched to a member for the specified work class.
- getDefaultAction
- Default action for a work class.
- --type
- Specifies the type of work class to list:
- ASP: application service policy
- ARP: application routing policy
- GSP: generic server service policy
- GRP: generic server routing policy
- --appname
- Name of the application. Required if you specify the --type parameter as ASP or ARP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- modifyVirtualHost
- Edits the virtual host for a work class.
- --type
- Specifies the type of work class to modify. The valid types are GSP and GRP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
- --virtualhost
- Specifies the virtual host. Required if you specify the --type parameter as GSP or GRP.
- getVirtualHost
- Lists the virtual host for a work class.
- --type
- Specifies the type of work class to list. The valid types are GSP and GRP.
- --odrname
- Name of the on demand router (ODR). Required if you specify the --type parameter as GSP or GRP.
- --wcname
- Specifies the unique name for the work class within the specified type.
Example
List all work classes:./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClassesList all work classes for application Trade:./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --appname TradeList all routing policy work classes for application Trade:./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --type ARP --appname TradeList all generic server work classes for ODR myODR:./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --odrname myODRList all generic server routing policy work classes for ODR myODR:./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --type GRP --odrname myODR
Related reference
Routing and service policies ScriptsRelated information
Overview of work classes