Recently, I had a question about using offline WLST to create a Capacity Constraint in a WebLogic Server configuration. The tricky part is that Constraint MBeans (and resulting configuration) are children of the SelfTuning MBean at the domain level, but the SelfTuning MBean is not listed in the configuration file by default. This behavior is the result of an optimization in WebLogic Server where the configuration file only explicitly lists objects and attributes that are defined. It does not list objects or attributes that completely governed by defaults. Take a look at the documentation at http://docs.oracle.com/cd/E23943_01/web.1111/e13715/using_wlst.htm#i1091409, which says:
"As a performance optimization, WebLogic Server does not store most of its default values in the WebLogic domain's configuration files. In some cases, this optimization prevents management objects from being displayed by WLST offline (because WebLogic Server has never written the corresponding XML elements to the domain's configuration files). For example, if you never modify the default logging severity level for a WebLogic domain while the domain is active, WLST offline will not display the domain's Log management object.
If you want to change the default value of attributes whose management object is not displayed by WLST offline, you must first use the create command to create the management object. Then you can cd to the management object and change the attribute value."
To create a Constraint object, you must first create the SelfTuning object. Here's an example that creates a new domain and then adds a Capacity Constraint to it:
Proxy for st: Name=st, Type=SelfTuning
Proxy for myCapacityConstraint: Name=myCapacityConstraint, Type=SelfTuning!
-rw- DeploymentOrder 1000
-rw- Name myCapacityConstraint
-rw- Notes null
-rw- Target null