Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.
To manage an existing configuration object, identify the configuration object and obtain configuration ID of the object to be used for subsequent manipulation.
set var [$AdminConfig getid /type:name/]
var = AdminConfig.getid('/type:name/')
where:
set | is a Jacl command |
var | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object representing the WebSphere Application Server configuration |
getid | is an AdminConfig command |
/type:name/ | is the hierarchical containment path of the configuration object |
type | is the object type Note: The name of the object type that you input here is the one based on the XML configuration files and does not have to be the same name that the administrative console displays. |
name | is the optional name of the object |
You can specify multiple /type:name/ in the string, for example, /type:name/type:name/type:name/. If you just specify the type in the containment path without the name, include the colon, for example, /type:/. The containment path must be a path containing the correct hierarchical order. For example, if you specify /Server:server1/Node:node/ as the containment path, you will not receive a valid configuration ID because Node is parent of Server and should come before Server in the hierarchy.
This command returns all the configuration IDs that match the representation of the containment and assigns them to a variable.
To look for all the server configuration IDs resided in mynode, use the following example:
set nodeServers [$AdminConfig getid /Node:mynode/Server:/]
nodeServers = AdminConfig.getid('/Node:mynode/Server:/')
To look for server1 configuration ID resided in mynode, use the following example:
set server1 [$AdminConfig getid /Node:mynode/Server:server1/]
server1 = AdminConfig.getid('/Node:mynode/Server:server1/')
To look for all the server configuration IDs, use the following example:
set servers [$AdminConfig getid /Server:/]
servers = AdminConfig.getid('/Server:/')
set var [$AdminConfig list type]or
set var [$AdminConfig list type scopeId]
var = AdminConfig.list('type')or
var = AdminConfig.list('type', 'scopeId')
where:
set | is a Jacl command |
var | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object representing the WebSphere Application Server configuration |
list | is an AdminConfig command |
type | is the object type Note: The name of the object type that you input here is the one based on the XML configuration files and does not have to be the same name that the administrative console displays. |
scopeId | is the configuration ID of a cell, node, or server object |
To look for all the server configuration IDs, use the following example:
set servers [$AdminConfig list Server]
servers = AdminConfig.list('Server')
To look for all the server configuration IDs in mynode, use the following example:
set scopeid [$AdminConfig getid /Node:mynode/] set nodeServers [$AdminConfig list Server $scopeid]
scopeid = AdminConfig.getid('/Node:mynode/') nodeServers = AdminConfig.list('Server', scopeid)
set allServers [$AdminConfig getid /Server:/] set aServer [lindex $allServers 0]
allServers = AdminConfig.getid('/Server:/') # get line separator import java lineSeparator = java.lang.System.getProperty('line.separator') arrayAllServers = allServers.split(lineSeparator) aServer = arrayAllServers[0]
For other ways to manipulate the list and then perform pattern matching to look for a specified configuration object, refer to the Jacl syntax.
ResultYou can now use the configuration ID in any subsequent AdminConfig commands that require a configuration ID as a parameter.
Related concepts
AdminConfig object for scripted administration
Related reference
Commands for the AdminConfig object