WebSphere Extended Deployment, Version 6.0.x
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


servicepolicy.py script

You can use the servicepolicy.py script to perform operations on service policies from the command line, such as creating service policies, removing service policies, and editing transaction classes.

Purpose

You can perform the following actions with the servicepolicy.py script:
  • Create a service policy
  • Remove a service policy
  • Create a transaction class
  • Remove a transaction class
  • Add URIs to a transaction class
  • Remove URIs from a transaction class

[Version 6.0.1 and later] To create, modify, and remove service policies and transaction classes, you must have configurator or administrator administrative privileges.

Location

The servicepolicy.py script is located in the install_root/bin directory.

Usage

The script usage for general help follows:
./wsadmin.sh|bat -lang jython -f servicepolicy.py
The script usage for operation-specific help follows:
./wsadmin.sh|bat -lang jython -f servicepolicy.py operation --help

Operations

You can perform the following operations with the servicepolicy.py script:
createServicePolicy
Creates a service policy with the specified options. You must create and associate transaction classes separately.
--spname
Specifies a name for the service policy that is unique in the cell.
--spgt
Specifies an integer that represents one of the following service policy goal types:
  • 0: discretionary
  • 1: average response time
  • 2: percentile response time
  • 4: completion time
--spgv
Specifies a service policy goal value for non-discretionary goals. This value is assumed to be in milliseconds if you do not specify the units.
--spgvu
Specifies an integer that represents a service policy goal value for non-discretionary goals. This value is assumed to be in milliseconds if you do not specify the units.
  • 0: milliseconds
  • 1: seconds
  • 2 : minutes
--sppgv
Specifies an integer that represents a percentile value for a service policy with percentile response time goal between 1 and 100.
--spi
Specifies an integer that represents one of the following service policy goal types:
  • 1: highest
  • 2: higher
  • 3: high
  • 4: medium
  • 5: low
  • 6: lower
  • 7: lowest
--spd
Specifies a service policy description.
removeServicePolicy
Deletes an existing service policy with the specified option.
--spname
Specifies the unique name for the service policy that you want to remove.
createTransactionClass
Creates a transaction class with the specified options.
--spname
Specifies a name for the service policy that is unique in the cell.
--tcname
Specifies a name for the transaction class that you want to create that is unique in the cell.
--tcd
Specifies a transaction class description.
removeTransactionClass
Removes a transaction class with the specified option. All Uniform Resource Identifiers (URIs) in the transaction class are no longer associated with the parent service policy. If a request comes in for these URIs and they are not associated with a new service policy and transaction class, they are classified to the default service policy with a discretionary goal.
--tcname
Specifies the cell-unique name for the transaction class that you want to remove.
addUrisToTransactionClass
Adds a set of URIs associated with a specific application and Java™ 2 Platform, Enterprise Edition (J2EE) module pair with an existing transaction class. Do not include the context root of the URI. The context root of the URI is automatically associated with the URI because the application and module is specified. When you specify the --validate option, the wsadmin tool performs a check to ensure that the specified URI is not mapped to an existing transaction class. Otherwise, the URI pattern is added to the transaction class without any validation.
--tcname
Specifies a name for the transaction class to which you want to add URIs.
--appname
Specifies name of the application with which the URIs are associated.
--modname
Specifies the name of the J2EE module within the application to which the URIs are associated.
--uris
Specifies the collection of URI patterns to associate with the transaction class from the application J2EE module pair.
--validate
Performs a check to ensure that the specified URIs are not mapped to an existing transaction class.
removeUrisFromTransactionClass
Removes a set of URIs associated with an application and a Web module, and optionally a specific transaction class. Do not include the context root of the URI. Use exact matches removal.
--appname
Specifies the name of the application with which the URIs are associated.
--modname
Specifies the name of the Web module within the application.
--tcname
Specifies a name for the transaction class to which you want to add URIs. If this is not specified, all transaction classes are searched.
--uris
Specifies the collection of URI patterns to associate with the transaction class from the application J2EE module pair. Not specifying the option removes all the URIs for the application, module, and optional transaction class.

Example

Create a service policy:
./wsadmin.sh|bat -lang jython -f servicepolicy.py createServicePolicy --spname Platinum --spgt 2 --spgv 3000 --spgvu 0 --sppgv 80 --spi 5
Remove an existing service policy:
./wsadmin.sh|bat -lang jython -f servicepolicy.py removeServicePolicy --spname Bronze 
Create a new transaction class:
./wsadmin.sh|bat -lang jython -f servicepolicy.py createTransactionClass --spname Platinum --tcname PlatinumWorkload --tcd 'my platinum workload'
Remove an existing transaction class:
./wsadmin.sh|bat -lang jython -f servicepolicy.py removeTransactionClass --tcname PlatinumWorkload  
Use the script to add URIs to a transaction class:
./wsadmin.sh|bat -lang jython -f servicepolicy.py addUrisToTransactionClass --tcname PlatinumWorkload --appname StockTrade --modname trade.war --uris "/trade*.do, /trade*.jsp"
Use the script to unmap from a specific transaction class a specific set of URIs associated with a specific application and Web module:
./wsadmin.sh|bat -lang jython -f servicepolicy.py removeUrisFromTransactionClass --appname StockTrade --modname trade.war --tcname PlatinumWorkload --uris \"/trade*.do, /trade*.jsp\"  
Unmap from any transaction class a specific set of URIs associated with a specific application and web module:
./wsadmin.sh|bat -lang jython -f servicepolicy.py removeUrisFromTransactionClass --appname StockTrade --modname trade.war --uris \"/trade*.do, /trade*.jsp\"  
Unmap from a specific transaction class all URIs associated with a specific application and Web module:
./wsadmin.sh|bat -lang jython -f servicepolicy.py removeUrisFromTransactionClass --appname StockTrade --modname trade.war --tcname PlatinumWorkload
Unmap from any transaction class all URIs associated with a specified application and Web module:
./wsadmin.sh|bat -lang jython -f servicepolicy.py removeUrisFromTransactionClass --appname StockTrade --modname trade.war  



Related tasks
Defining a service policy
Related reference
Reference topic    

Terms of Use | Feedback

Last updated: Oct 16, 2009 11:14:15 AM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/com.ibm.websphere.xd.doc/info/reference/rxml_servicepolicy.html