You can use the Jython or Jacl scripting languages to configure
servers with the wsadmin tool. The commands and parameters in the
VariableConfiguration group can be used to remove variable definitions
from the system, to set values for variables, or to query for variable
values with a specific scope.
The VariableConfiguration command group for the AdminTask object
includes the following commands:
removeVariable
Use
the removeVariable command to remove a variable definition from the system.
A variable is a configuration property that you can use to provide
a parameter for some values in the system.
Target object
None
Parameters and return values
- -variableName
- The name of the variable. (String, required)
- -scope
- The scope of the variable definition. The default is Cell. (String,
optional)
- The syntax of the scope parameter is Type=value
- Supported types are Cell, Node, Servers, Application and Cluster,
for example:
- Node=node1
- Node=node1, Server=server1
- Application=app1
- Cluster=cluster1
- Cell=cell1
- -node
- The name of the node. This parameter is only needed for server
scopes that do not have unique name across nodes. (String, optional)
Examples
Interactive
mode example usage:
Using Jacl:
$AdminTask removeVariable {-interactive}
Using Jython string:
AdminTask.removeVariable ('[-interactive]')
Using Jython list:
AdminTask.removeVariable (['-interactive'])
setVariable
Use the setVariable command
to set the value for a variable. A variable is a configuration property
that you can use to provide a parameter for some values in the system.
Target object
None
Parameters and return values
- -variableName
- The name of the variable. (String, required)
- -scope
- The scope of the variable definition. The default is Cell. (String,
optional)
- The syntax of the scope parameter is Type=value, for
example:
- Node=node1
- Node=node1,Server=server1
- Application=app1
- Cluster=cluster1
- Cell=cell1
.
- -node
- The name of the node. This parameter is only needed for server
scopes that do not have unique name across nodes. (String, optional)
- -variableValue
- The value of the variable. (String, optional)
- -variableDescription
- The description of the variable. (String, optional)
Examples
Batch
mode example usage:
Using Jacl:
$AdminTask setVariable {-variableName varname1 -scope Cell=localhostNode01Cell,Node=
localhostNode01}
Using Jython string:
AdminTask.setVariable('[-variableName varname1 -scope Cell=localhostNode01Cell,Node=
localhostNode01]')
Using Jython list:
AdminTask.setVariable(['-variableName', 'varname1', '-scope', 'Cell=localhostNode01Cell,Node=
localhostNode01'])
Interactive mode example
usage:
Using Jacl:
$AdminTask setVariable {-interactive}
Using Jython string:
AdminTask.setVariable ('[-interactive]')
Using Jython list:
AdminTask.setVariable (['-interactive'])
showVariables
Use
the showVariables command
to list variable values under a scope.
Target object
None
Parameters and return values
- - scope
- The scope of the variable definition. The default is Cell. (String,
optional)
- The syntax of the scope parameter is Type=value
- Supported types are Cell, Node, Servers, Application and Cluster,
for example:
- Node=node1
- Node=node1, Server=server1
- Application=app1
- Cluster=cluster1
- Cell=cell1
- -node
- The name of the node. This parameter is only needed for server
scopes that do not have unique name across nodes. (String, optional)
- -variableName
- The name of the variable. If you specify this parameter, the value
of this variable is returned. If you do not specify this parameter,
all variables defined under the scope will return in list format where
each element is a variable name and value pair. (String, optional)
Examples
Interactive
mode example usage:
Using Jacl:
$AdminTask showVariables {-interactive}
Using Jython string:
AdminTask.showVariables ('[-interactive]')
Using Jython list:
AdminTask.showVariables (['-interactive'])