Commands for the AdminConfig object using wsadmin scripting
Use the AdminConfig object to invoke configuration commands and to create or change elements of the WebSphere® Application Server configuration, for example, creating a data source.
You can start the scripting client without a running server, if you want to use only local operations. To run in local mode, use the -conntype NONE option to start the scripting client. You receive a message that you are running in the local mode. If a server is running, do not run the AdminConfig tool in local mode. Configuration changes that are made in local mode are not reflected in the running server configuration. If you save a conflicting configuration, you might corrupt the configuration.
params='[[name name1] [nameInNameSpace nameSpace_Name] [string_to_bind "value, withComma"]]'
AdminConfig.create(type, parent, params)
You
can also use the modify command:
AdminConfig.modify(type, params)
- attributes
- checkin
- convertToCluster
- create
- createClusterMember
- createDocument
- createUsingTemplate
- defaults
- deleteDocument
- existsDocument
- extract
- getCrossDocumentValidationEnabled
- getid
- getObjectName
- getObjectType
- getSaveMode
- getValidationLevel
- getValidationSeverityResult
- hasChanges
- help
- installResourceAdapter
- list
- listTemplates
- modify
- parents
- queryChanges
- remove
- required
- reset
- resetAttributes
- save
- setCrossDocumentValidationEnabled
- setSaveMode
- setValidationLevel
- show
- showall
- showAttribute
- types
- uninstallResourceAdapter
- unsetAttributes
- validate
attributes
Use the attributes command to return a list of the top-level attributes for a given type.
Target object
None.Required parameters
- object type
- Specifies the name of the object type that is based on the XML configuration files. The object type does not have to be the same name that the administrative console displays.
Optional parameters
None.Sample output
"properties Property*" "serverSecurity ServerSecurity"
"server Server@" "id Long" "stateManagement StateManageable"
"name String" "moduleVisibility EEnumLiteral(MODULE,
COMPATIBILITY, SERVER, APPLICATION)" "services Service*"
"statisticsProvider StatisticsProvider"
Examples
- Using Jacl:
$AdminConfig attributes ApplicationServer
- Using
Jython:
print AdminConfig.attributes('ApplicationServer')
checkin
Use the checkin command to check a file into the configuration repository that is described by the document Uniform Resource Identifier (URI). This method applies to deployment manager configurations only.
Target object
None.Required parameters
- URI
- The document URI is relative to the root of the configuration repository, for example:
- app_server_root\config
- /WebSphere/AppServer/config
- file name
- Specifies the name of the source file to check in.
- opaque object
- Specifies an object that the extract command of the AdminConfig object returns by a prior call.
Optional parameters
None.Sample output
"properties Property*" "serverSecurity ServerSecurity"
"server Server@" "id Long" "stateManagement StateManageable"
"name String" "moduleVisibility EEnumLiteral(MODULE,
COMPATIBILITY, SERVER, APPLICATION)" "services Service*"
"statisticsProvider StatisticsProvider"
Examples
- Using Jacl:
$AdminConfig checkin cells/MyCell/Node/MyNode/serverindex.xml /mydir/myfile $obj
$AdminConfig checkin cells/MyCell/Node/MyNode/serverindex.xml c:\\mydir\myfile $obj
- Using Jython:
print AdminConfig.checkin('cells/MyCell/Node/MyNode/serverindex.xml', '/mydir/myfile', obj)
print AdminConfig.checkin('cells/MyCell/Node/MyNode/serverindex.xml', 'c:\mydir\myfile', obj)
convertToCluster
Use the convertToCluster command to convert a server so that it is the first member of a new server cluster.
Target object
None.Required parameters
- server ID
- The configuration ID of the server of interest.
- cluster name
- Specifies the name of the cluster of interest.
Optional parameters
None.Sample output
myCluster(cells/mycell/clusters/myCluster|cluster.xml#ClusterMember_2)
Examples
- Using Jacl:
set serverid [$AdminConfig getid /Server:myServer/] $AdminConfig convertToCluster $serverid myCluster
- Using Jython:
serverid = AdminConfig.getid('/Server:myServer/') print AdminConfig.convertToCluster(serverid, 'myCluster')
create
Use the create command to create configuration objects.
Target object
None.Required parameters
- type
- Specifies the name of the object type that is based on the XML configuration files. This parameter value does not have to be the same name that the administrative console displays.
- parent ID
- Specifies the configuration ID of the parent object.
- attributes
- Specifies any attributes to add to the configuration ID.
Optional parameters
None.Sample output
ds1(cells/mycell/nodes/DefaultNode/servers/server1|resources.xml#DataSource_6)
Examples
- Using
Jacl:
set jdbc1 [$AdminConfig getid /JDBCProvider:jdbc1/] $AdminConfig create DataSource $jdbc1 {{name ds1}}
- Using Jython string
attributes:
jdbc1 = AdminConfig.getid('/JDBCProvider:jdbc1/') print AdminConfig.create('DataSource', jdbc1, '[[name ds1]]')
- Using Jython with object
attributes:
jdbc1 = AdminConfig.getid('/JDBCProvider:jdbc1/') print AdminConfig.create('DataSource', jdbc1, [['name', 'ds1']])
- Use the following example to create a
port:
#replace server1 with your server name serverName = 'server1' #replace smtitant24Node03 with your node name node = AdminConfig.getid('/Node:smtitan24Node03') #print node serverEntries = AdminConfig.list('ServerEntry', node).split(java.lang.System.getProperty('line.separator')) for serverEntry in serverEntries: sName = AdminConfig.showAttribute(serverEntry, "serverName") if sName == serverName: #print serverEntry #replace OVERLAY_TEST with the value you want for your endPointName id = AdminConfig.create('NamedEndPoint', serverEntry, '[[endPointName "OVERLAY_TEST"]]') #print id start = id.find('#') #print start end = id.find(')',start) #print end str = id[start:end] server = id[0:start] #print server #print str #replace 8888 with the value you want for your port AdminConfig.create('EndPoint', server+str+')', '[[port "8888"] [host "*"]]') AdminConfig.save() #AdminConfig.reset()
createClusterMember
Use the createClusterMember command to create a new server object on the node that the node id parameter specifies. This server is created as a new member of the existing cluster that is specified by the cluster id parameter, and contains attributes that are specified in the member attributes parameter. The server is created by using the server template that is specified by the template id attribute, and that contains the name specified by the memberName attribute. The memberName attribute is required. The template options are available only for the first cluster member that you create. All cluster members that you create after the first member are identical.
Target object
None.Required parameters
- cluster ID
- Specifies the configuration ID of the cluster of interest.
- node ID
- Specifies the configuration ID of the node of interest.
- template ID
- Specifies the template ID to use to create the server.
- member attributes
- Specifies any attributes to add to the cluster member. The memberName attribute is required, and defines the name of the cluster member to create.
Optional parameters
None.Sample output
myCluster(cells/mycell/clusters/myCluster|cluster.xml#ClusterMember_2)
Examples
- Using
Jacl:
set clid [$AdminConfig getid /ServerCluster:myCluster/] set nodeid [$AdminConfig getid /Node:mynode/] $AdminConfig createClusterMember $clid $nodeid {{memberName newMem1} {weight 5}}
- Using Jython string
attributes:
clid = AdminConfig.getid('/ServerCluster:myCluster/') nodeid = AdminConfig.getid('/Node:mynode/') print AdminConfig.createClusterMember(clid, nodeid, '[[memberName newMem1] [weight 5]]')
- Using Jython with object
attributes:
clid = AdminConfig.getid('/ServerCluster:myCluster/') nodeid = AdminConfig.getid('/Node:mynode/') print AdminConfig.createClusterMember(clid, nodeid, [['memberName', 'newMem1'], ['weight', 5]])
createDocument
Use the createDocument command to create a new document in the configuration repository.
Target object
None.Required parameters
- document URI
- Specifies the name of the document to create in the repository.
- file name
- Specifies a valid local file name of the document to create.
Optional parameters
None.Examples
- Using Jacl:
$AdminConfig createDocument cells/mycell/myfile.xml /mydir/myfile
$AdminConfig createDocument cells/mycell/myfile.xml c:/mydir/myfile
- Using Jython with string attributes:
AdminConfig.createDocument('cells/mycell/myfile.xml', 'c:/mydir/myfile')
AdminConfig.createDocument('cells/mycell/myfile.xml', '/mydir/myfile')
createUsingTemplate
Use the createUsingTemplate command to create a type of object with the given
parent, by using a template. You can use this command only for creation of a server with
APPLICATION_SERVER
type. If you want to create a server with a type other than
APPLICATION_SERVER
, use the createGenericServer or the
createWebServer command.
Target object
None.Required parameters
- type
- Specifies the type of object to create.
- parent
- Specifies the configuration ID of the parent.
- template
- Specifies a configuration ID of an existing object. This object can be a template object returned by using the listTemplates command, or any other existing object of the correct type.
Optional parameters
- attributes
- Specifies attribute values for the object. The attributes that are specified by using this parameter override the settings in the template.
Sample output
myCluster(cells/mycell/clusters/myCluster|cluster.xml#ClusterMember_2)
Examples
- Using
Jacl:
set node [$AdminConfig getid /Node:mynode/] set templ [$AdminConfig listTemplates JDBCProvider "DB2 JDBC Provider (XA)"] $AdminConfig createUsingTemplate JDBCProvider $node {{name newdriver}} $templ
- Using Jython with string
attributes:
node = AdminConfig.getid('/Node:mynode/') templ = AdminConfig.listTemplates('JDBCProvider', "DB2 JDBC Provider (XA)") print AdminConfig.createUsingTemplate('JDBCProvider', node, '[[name newdriver]]', templ)
- Using Jython with object attributes:
node = AdminConfig.getid('/Node:mynode/') templ = AdminConfig.listTemplates('JDBCProvider', "DB2 JDBC Provider (XA)") print AdminConfig.createUsingTemplate('JDBCProvider', node, [['name', 'newdriver']], templ)
defaults
Use the defaults command to display the default values for attributes of a given type. This method displays all of the possible attributes contained by an object of a specific type. If the attribute has a default value, this method also displays the type and default value for each attribute.
Target object
None.Required parameters
- type
- Specifies the type of object to return. The name of the object type that you specify is based on the XML configuration files. This name does not have to be the same name that the administrative console displays.
Optional parameters
None.Sample output
Attribute Type Default
usingMultiRowSchema Boolean false
maxInMemorySessionCount Integer 1000
allowOverflow Boolean true
scheduleInvalidation Boolean false
writeFrequency ENUM
writeInterval Integer 120
writeContents ENUM
invalidationTimeout Integer 30
invalidationSchedule InvalidationSchedule
Examples
- Using Jacl:
$AdminConfig defaults TuningParams
- Using Jython:
print AdminConfig.defaults('TuningParams')
deleteDocument
Use the deleteDocument command to delete a document from the configuration repository.
Target object
None.Required parameters
- documentURI
- Specifies the document to delete from the repository.
Optional parameters
None.Examples
- Using Jacl:
$AdminConfig deleteDocument cells/mycell/myfile.xml
- Using Jython:
AdminConfig.deleteDocument('cells/mycell/myfile.xml')
existsDocument
Use the existsDocument command to test for the existence of a document in the configuration repository.
Target object
None.Required parameters
- documentURI
- Specifies the document to test for in the repository.
Optional parameters
None.Sample output
1
Examples
- Using Jacl:
$AdminConfig existsDocument cells/mycell/myfile.xml
- Using Jython:
print AdminConfig.existsDocument('cells/mycell/myfile.xml')
extract
Use the extract command to extract a configuration repository file that is described by the document URI and places it in the file named by filename. This method applies to deployment manager configurations only.
Target object
None.Required parameters
- documentURI
- Specifies the document to extract from the configuration repository. The document URI must exist
in the repository. The document URI is relative to the root of the configuration repository, for example:
- /WebSphere/AppServer/config
- app_server_root\config
- filename
- Specifies the filename to extract the document to. The filename must be a valid local filename where the contents of the document are written. If the file that is specified by the filename parameter exists, the extracted file replaces it.
Optional parameters
None.Sample output
The command returns an opaque "digest" object that should be used to check the file back in using the checkin command.
Examples
- Using Jacl:
set obj [$AdminConfig extract cells/MyCell/nodes/MyNode/serverindex.xml /mydir/myfile]
set obj [$AdminConfig extract cells/MyCell/nodes/MyNode/serverindex.xml c:\\mydir\myfile]
- Using Jython:
obj = AdminConfig.extract('cells/MyCell/nodes/MyNode/serverindex.xml','/mydir/myfile')
obj = AdminConfig.extract('cells/MyCell/nodes/MyNode/serverindex.xml','c:\mydir\myfile')
getCrossDocumentValidationEnabled
Use the getCrossDocumentValidationEnabled command to return a message with the current cross-document enablement setting. This method returns true if cross-document validation is enabled.
Target object
None.Required parameters
None.
Optional parameters
None.
Sample output
WASX7188I: Cross-document validation enablement set to true
Examples
- Using Jacl:
$AdminConfig getCrossDocumentValidationEnabled
- Using Jython:
print AdminConfig.getCrossDocumentValidationEnabled()
getid
Use the getid command to return the configuration ID of an object.
Target object
None.Required parameters
- containment path
- Specifies the containment path of interest.
Optional parameters
None.
Sample output
Db2JdbcDriver(cells/testcell/nodes/testnode|resources.xml#JDBCProvider_1)
Examples
- Using Jacl:
$AdminConfig getid /Cell:testcell/Node:testNode/JDBCProvider:Db2JdbcDriver/
- Using Jython:
print AdminConfig.getid('/Cell:testcell/Node:testNode/JDBCProvider:Db2JdbcDriver/')
getObjectName
Use the getObjectName command to return a string version of the object name for the corresponding running MBean. This method returns an empty string if no corresponding running MBean exists.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the object name to return.
Optional parameters
None.
Sample output
WebSphere:cell=mycell,name=server1,mbeanIdentifier=cells/mycell/nodes/mynode/servers/server1/
server.xml#Server_1,type=Server,node=mynode,process=server1,processType=UnManagedProcess
Examples
- Using Jacl:
set server [$AdminConfig getid /Node:mynode/Server:server1/] $AdminConfig getObjectName $server
- Using Jython:
server = AdminConfig.getid('/Node:mynode/Server:server1/') print AdminConfig.getObjectName(server)
getObjectType
Use the getObjectType command to display the object type for the object configuration ID of interest.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the object name to return.
Optional parameters
None.
Examples
- Using Jacl:
set server [$AdminConfig getid /Node:mynode/Server:server1/] $AdminConfig getObjectType $server
- Using Jython:
server = AdminConfig.getid('/Node:mynode/Server:server1/') print AdminConfig.getObjectType(server)
getSaveMode
- overwriteOnConflict - Saves changes even if they conflict with other configuration changes
- rollbackOnConflict - Fails a save operation if changes conflict with other configuration changes. This value is the default.
Target object
None.Required parameters
None.
Optional parameters
None.
Sample output
rollbackOnConflict
Examples
- Using Jacl:
$AdminConfig getSaveMode
- Using Jython:
print AdminConfig.getSaveMode()
getValidationLevel
Use the getValidationLevel command to return the validation that is used when files are extracted from the repository.
Target object
None.Required parameters
None.
Optional parameters
None.
Sample output
WASX7189I: Validation level set to HIGH
Examples
- Using
Jacl:
$AdminConfig getValidationLevel
- Using
Jython:
print AdminConfig.getValidationLevel()
getValidationSeverityResult
Use the getValidationSeverityResult command to return the number of validation messages with the given severity from the most recent validation.
Target object
None.Required parameters
- severity
- Specifies which severity level for which to return the number of validation messages. Specify an integer value 0 - 9.
Optional parameters
None.
Sample output
16
Examples
- Using Jacl:
$AdminConfig getValidationSeverityResult 1
- Using Jython:
print AdminConfig.getValidationSeverityResult(1)
hasChanges
Use the hasChanges command to determine whether unsaved configuration changes exist.
Target object
None.Required parameters
None.
Optional parameters
None.
Sample output
1
if unsaved
configuration changes exist or 0
if unsaved configuration changes do not exist, as
the following example displays:1
Examples
- Using
Jacl:
$AdminConfig hasChanges
- Using
Jython:
print AdminConfig.hasChanges()
help
Use the help command to display static help information for the AdminConfig object.
Target object
None.Required parameters
None.
Optional parameters
None.
Sample output
WASX7053I: The AdminConfig object communicates with the configuration service in a product to manipulate
configuration data for an Application Server installation. The AdminConfig object has commands to list,
create, remove, display, and modify configuration data, as well as commands to display information about
configuration data types.
Most of the commands supported by the AdminConfig object operate in two modes: the default mode is one in which
the AdminConfig object communicates with the Application Server to accomplish its tasks. A local mode is also
possible, in which no server communication takes place. The local mode of operation is invoked by bringing up
the scripting client without a server connected using the command line "-conntype NONE" option or setting the
"com.ibm.ws.scripting.connectionType=NONE" property in the wsadmin.properties file.
The following commands are supported by the AdminConfig object; more detailed information about each of these commands is
available by using the help command of the AdminConfig object and by supplying the name of the command as an argument.
attributes Shows the attributes for a given type
checkin Checks a file into the configuration repository.
convertToCluster Converts a server to be the first member of a new server cluster
create Creates a configuration object, given a type, a parent, and a list of attributes, and
optionally an attribute name for the new object
createClusterMember Creates a new server that is a member of an existing cluster.
createDocument Creates a new document in the configuration repository.
installResourceAdapter Installs a J2C resource adapter with the given RAR file name and an option string in the node.
createUsingTemplate Creates an object using a particular template type.
defaults Displays the default values for the attributes of a given type.
deleteDocument Deletes a document from the configuration repository.
existsDocument Tests for the existence of a document in the configuration repository.
extract Extracts a file from the configuration repository.
getCrossDocumentValidationEnabled Returns true if cross-document validation is enabled.
getid Show the configuration ID of an object, given a string version of its containment
getObjectName Given a configuration ID, returns a string version of the ObjectName
for the corresponding running MBean, if any.
getSaveMode Returns the mode used when "save" is invoked
getValidationLevel Returns the validation that is used when files are extracted from the repository.
getValidationSeverityResult Returns the number of messages of a given severity from the most recent validation.
hasChanges Returns true if unsaved configuration changes exist
help Shows help information
list Lists all the configuration objects of a given type
listTemplates Lists all the available configuration templates of a given type.
modify Changes the specified attributes of a given configuration object
parents Shows the objects which contain a given type
queryChanges Returns a list of unsaved files
remove Removes the specified configuration object
required Displays the required attributes of a given type.
reset Discards the unsaved configuration changes
save Commits the unsaved changes to the configuration repository
setCrossDocumentValidationEnabled Sets the cross-document validation enabled mode.
setSaveMode Changes the mode used when "save" is invoked
setValidationLevel Sets the validation used when files are extracted from the repository.
show Shows the attributes of a given configuration object
showall Recursively shows the attributes of a given configuration
object, and all the objects that are contained within each attribute.
showAttribute Displays only the value for the single attribute that is specified.
types Shows the possible types for configuration
validate Invokes validation
Examples
- Using Jacl:
$AdminConfig help
- Using Jython:
print AdminConfig.help()
installResourceAdapter
Use the installResourceAdapter command to install a Java 2 Connector (J2C) resource adapter with the given Resource Adapter Archive (RAR) file name and an option string in the node. When you edit the installed application with the embedded RAR, existing J2C connection factory, J2C activation specs, and J2C administrative objects only are edited. No new J2C objects are created.
Target object
None.Required parameters
- node
- Specifies the node of interest.
- RAR file name
- Specifies the fully qualified file name of the RAR file that resides in the node that you specify.
Optional parameters
- options
- Specifies more options for installing a resource adapter. The valid options include the
following options:
rar.name
rar.desc
rar.archivePath
rar.classpath
rar.nativePath
rar.threadPoolAlias
rar.propertiesSet
rar.desc
option is a description of the J2CResourceAdapter.The
rar.archivePath
is the name of the path where you extract the file. If you do not specify this option, the archive is extracted to the $\{CONNECTOR_INSTALL_ROOT\} directory. The rar.classpath option is the additional class path.rar.propertiesSet
is constructed with the following:
Each attribute of the property are specified in a set of {}. A property is specified in a set of {}. You can specify multiple properties inname String value String type String *desc String *required true/false * means the item is optional
{}
.
Sample output
myResourceAdapter(cells/mycell/nodes/mynode|resources.xml#J2CResourceAdapter_1)
Examples
- Using Jacl:
$AdminConfig installResourceAdapter /rar/mine.rar mynode{-rar.name myResourceAdapter -rar.desc "My rar file"}
$AdminConfig installResourceAdapter c:/rar/mine.rar mynode {-rar.name myResourceAdapter -rar.desc "My rar file"}
- Using Jython:
print AdminConfig.installResourceAdapter('/rar/mine.rar', 'mynode', '[-rar.name myResourceAdapter -rar.desc "My rar file"]')
print AdminConfig.installResourceAdapter('c:/rar/mine.rar', 'mynode', '[-rar.name myResourceAdapter -rar.desc "My rar file"]')
resourceProperties (name=myName,value=myVal)
into
the resource adapter configuration, run the following commands:-
pSet = [['propertySet',[['resourceProperties',[[['name','myName'], ['type', 'String'], ['value','myVal']]]]]]]
-
myRA =AdminConfig.installResourceAdapter('/query.rar','mynodeCellManager05', ['-rar.desc','mydesc'])
myRA =AdminConfig.installResourceAdapter('c:\query.rar','mynodeCellManager05', ['-rar.desc','mydesc'])
-
AdminConfig.modify(myRA,pSet)
list
Use the list command to return a list of objects of a given type, or narrow down the search query by giving a type and a scoped parent, or giving a type and a wildcard character (*) or Java regular expression (.*) pattern in the command syntax to customize the search query.
Target object
None.Required parameters
- object type
- Specifies the name of the object type. The name of the object type is based on the XML configuration files and does not have to be the same name that the administrative console displays.
Optional parameters
- scope
- Specifies additional search query information using a scoped parent.
- pattern
- Specifies additional search query information using wildcard character (*) or Java regular expressions pattern (.*).
Sample output
Db2JdbcDriver(cells/mycell/nodes/DefaultNode|resources.xml#JDBCProvider_1)
Db2JdbcDriver(cells/mycell/nodes/DefaultNode/servers/deploymentmgr|resources.xml#JDBCProvider_1)
Db2JdbcDriver(cells/mycell/nodes/DefaultNode/servers/nodeAgent|resources.xml#JDBCProvider_1)
Examples
- Using
Jacl:
$AdminConfig list JDBCProvider
- Using
Jython:
print AdminConfig.list('JDBCProvider')
Note: Use single or double quotes.
- Using
Jacl:
$AdminConfig list JDBCProvider derby*
- Using
Jython:
print AdminConfig.list('JDBCProvider', 'derby*')
You can use regular Java expression patterns and wildcard patterns to specify command name for $AdminConfig list, types, and listTemplates functions.
server1
string::- Using
Jacl:
$AdminConfig list Server server1.*
- Using
Jython:
print AdminConfig.list("Server", "server1.*")
The following examples list the server configuration objects by giving an object type and a parent scope configuration id:
- Using
Jacl:
$AdminConfig list Server myNode(cells/myCell/nodes/myNode|node.xml#Node_1)
- Using
Jython:
print AdminConfig.list("Server", "myNode(cells/myCell/nodes/myNode|node.xml#Node_1)")
SSLConfig
:- Using Jacl and regular Java expression
patterns:
$AdminConfig types SSLConfig.*
- Using Jacl and wildcard
patterns:
$AdminConfig types SSLConfig*
- Using Jython and regular Java expression
patterns:
print AdminConfig.types("SSLConfig.*")
- Using Jython and wildcard
patterns:
print AdminConfig.types("SSLConfig*")
listTemplates
Use the listTemplates command to display a list of template object IDs. You can use wildcard characters (*) or Java regular expressions (.*) in the command syntax to customize the search query.
Target object
None.Required parameters
- object type
- Specifies the name of the object type. The name of the object type is based on the XML configuration files and does not have to be the same name that the administrative console displays.
- pattern
- Specifies more search query information by using wildcard characters or Java regular expressions.
Optional parameters
None.Sample output
"Derby JDBC Provider (XA)(templates/servertypes/APPLICATION_SERVER/servers/DeveloperServer|resources.xml#builtin_jdbcprovider)"
"Derby JDBC Provider (XA)(templates/servertypes/APPLICATION_SERVER/servers/defaultZOS|resources.xml#builtin_jdbcprovider)"
"Derby JDBC Provider (XA)(templates/servertypes/APPLICATION_SERVER/servers/default|resources.xml#builtin_jdbcprovider)"
"Derby JDBC Provider (XA)(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_4)"
"Derby JDBC Provider 40 (XA)(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_2)"
"Derby JDBC Provider 40 Only (XA)(templates/system|jdbc-resource-provider-only-templates.xml#JDBCProvider_derby_2)"
"Derby JDBC Provider 40 Only(templates/system|jdbc-resource-provider-only-templates.xml#JDBCProvider_derby_1)"
"Derby JDBC Provider 40(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_Derby_1)"
"Derby JDBC Provider Only (XA)(templates/system|jdbc-resource-provider-only-templates.xml#JDBCProvider_derby_4)"
"Derby JDBC Provider Only(templates/system|jdbc-resource-provider-only-templates.xml#JDBCProvider_derby_3)"
"Derby JDBC Provider(templates/servertypes/APPLICATION_SERVER/servers/DeveloperServer|resources.xml#JDBCProvider_1124467079638)"
"Derby JDBC Provider(templates/system|jdbc-resource-provider-templates.xml#JDBCProvider_derby_3)"
Examples
- Using Jacl:
$AdminConfig listTemplates JDBCProvider
- Using Jython:
print AdminConfig.listTemplates('JDBCProvider')
sybase
string:- Using Jacl:
$AdminConfig listTemplates JDBCProvider sybase*
- Using Jython:
print AdminConfig.listTemplates('JDBCProvider', 'sybase*')
modify
Use the modify command to support the modification of object attributes.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the object to modify.
- attributes
- Specifies the attributes to modify for the configuration ID of interest.
Optional parameters
None.Examples
- Using Jacl:
$AdminConfig modify ConnFactory1(cells/mycell/nodes/DefaultNode/servers/deploymentmgr|resources.xml# GenericJMSConnectionFactory_1) {{userID newID} {password newPW}}
- Using Jython with string attributes:
AdminConfig.modify('ConnFactory1(cells/mycell/nodes/DefaultNode/servers/deploymentmgr|resources.xml# GenericJMSConnectionFactory_1)', '[[userID newID] [password newPW]]')
- Using Jython with object attributes:
AdminConfig.modify('ConnFactory1(cells/mycell/nodes/DefaultNode/servers/deploymentmgr|resources.xml# GenericJMSConnectionFactory_1)', [['userID', 'newID'], ['password', 'newPW']])
parents
Use the parents command to obtain information about object types.
Target object
None.Required parameters
- object type
- Specifies the object type of interest. The name of the object type is based on the XML configuration files and does not have to be the same name that the administrative console displays.
Optional parameters
None.Sample output
Cell
Node
Server
Examples
- Using Jacl:
$AdminConfig parents JDBCProvider
- Using Jython:
print AdminConfig.parents('JDBCProvider')
queryChanges
Use the queryChanges command to return a list of unsaved configuration files.
Target object
None.Required parameters
None.Optional parameters
None.Sample output
WASX7146I: The following configuration files contain unsaved changes:
cells/mycell/nodes/mynode/servers/server1|resources.xml
Examples
- Using Jacl:
$AdminConfig queryChanges
- Using Jython:
print AdminConfig.queryChanges()
remove
Use the remove command to remove a configuration object.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration object of interest.
Optional parameters
None.Examples
- Using Jacl:
set ds [$AdminConfig list DataSource "Default Datasource*"] $AdminConfig remove $ds
- Using Jython:
ds = AdminConfig.list('DataSource', 'Default Datasource*') AdminConfig.remove(ds)
required
Use the required command to display the required attributes that are contained by an object of a certain type.
Target object
None.Required parameters
- type
- Specifies the object type for which to display the required attributes. The name of the object type is based on the XML configuration files. It does not have to be the same name that the administrative console displays.
Optional parameters
None.Sample output
Attribute Type
streamHandlerClassName String
protocol String
Examples
- Using Jacl:
$AdminConfig required URLProvider
- Using Jython:
print AdminConfig.required('URLProvider')
reset
Use the reset command to reset the temporary workspace that holds updates to the configuration.
Target object
None.Required parameters
None.Optional parameters
None.Examples
- Using Jacl:
$AdminConfig reset
- Using Jython:
AdminConfig.reset()
resetAttributes
Use the resetAttributes command to reset specific attributes for the configuration object of interest.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the configuration object of interest.
- attributes
- Specifies the attribute to reset and the value to which the attribute is reset.
Optional parameters
None.Examples
- Using Jacl:
set ds [$AdminConfig list DataSource "Default Datasource*"] $AdminConfig resetAttributes $ds {{"description" "A new description for the data source"}}
- Using Jython:
ds = AdminConfig.list('DataSource', 'Default Datasource*') AdminConfig.resetAttributes(ds, [["description", "A new description for the data source"]])
save
Use the save command to save changes to the configuration repository.
Target object
None.Required parameters
None.Optional parameters
None.Sample output
The save command does not return output.
Examples
- Using Jacl:
$AdminConfig save
- Using Jython:
AdminConfig.save()
setCrossDocumentValidationEnabled
Use
the setCrossDocumentValidationEnabled command to
set the cross-document validation enabled mode. Values include true
or false
.
Target object
None.Required parameters
- flag
- Specifies whether cross-document validation is enabled or disabled.
Specify
true
to enable orfalse
to disable cross-document validation.
Optional parameters
None.Sample output
WASX7188I: Cross-document validation enablement set to true
Examples
- Using Jacl:
$AdminConfig setCrossDocumentValidationEnabled true
- Using Jython:
print AdminConfig.setCrossDocumentValidationEnabled('true')
setSaveMode
Use the setSaveMode command to modify the behavior of the save command.
Target object
None.Required parameters
- save mode
- Specifies the save mode to use. The default value is
rollbackOnConflict
. When the system discovers a conflict while saving, the unsaved changes are not committed. The alternative value isoverwriteOnConflict
, which saves the changes to the configuration repository even if conflicts exist. To useoverwriteOnConflict
as the value of this command, the deployment manager must be enabled for configuration overwrite.
Optional parameters
None.Sample output
The setSaveMode command does not return output.
Examples
- Using Jacl:
$AdminConfig setSaveMode overwriteOnConflict
- Using Jython:
AdminConfig.setSaveMode('overwriteOnConflict')
setValidationLevel
Use the setValidationLevel command to set the validation that is used when files are extracted from the repository.
Target object
None.Required parameters
- level
- Specifies the validation to use. Five validation levels are available:
none
,low
,medium
,high
, orhighest
.
Optional parameters
None.Sample output
WASX7189I: Validation level set to HIGH
Examples
- Using Jacl:
$AdminConfig setValidationLevel high
- Using Jython:
print AdminConfig.setValidationLevel('high')
show
Use the show command to return the top-level attributes of the given object.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the object of interest.
Optional parameters
None.Sample output
[name "Sample Datasource"] [description "Data source for the Sample entity beans"]
Examples
- Using Jacl:
$AdminConfig show Db2JdbcDriver(cells/mycell/nodes/DefaultNode|resources.xmlJDBCProvider_1)
- Using Jython:
print AdminConfig.show('Db2JdbcDriver(cells/mycell/nodes/DefaultNode|resources.xmlJDBCProvider_1)')
showall
Use the showall command to recursively show the attributes of a given configuration object.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the object of interest.
Optional parameters
None.Sample output
The command returns a string that contains the attribute value, as the following examples show:
tcpNoDelay: null
SoTimeout: 0
bytesRead: 6669
{authMechanismPreference BASIC_PASSWORD}
{connectionPool {{agedTimeout 0}
{connectionTimeout 180}
{freePoolDistributionTableSize 0}
{maxConnections 10}
{minConnections 1}
{numberOfFreePoolPartitions 0}
{numberOfSharedPoolPartitions 0}
{numberOfUnsharedPoolPartitions 0}
{properties {}}
{purgePolicy EntirePool}
{reapTime 180}
{stuckThreshold 0}
{stuckTime 0}
{stuckTimerTime 0}
{surgeCreationInterval 0}
{surgeThreshold -1}
{testConnection false}
{testConnectionInterval 0}
{unusedTimeout 1800}}}
{datasourceHelperClassname com.ibm.websphere.rsadapter.DerbyDataStoreHelper}
{description "Datasource for the WebSphere Default Application"}
{diagnoseConnectionUsage false}
{jndiName DefaultDatasource}
{logMissingTransactionContext true}
{manageCachedHandles false}
{name "Default Datasource"}
{properties {}}
{propertySet {{resourceProperties {{{name databaseName}
{required false}
{type java.lang.String}
{value ${APP_INSTALL_ROOT}/${CELL}/DefaultApplication.ear/DefaultDB}} {{name shu
tdownDatabase}
{required false}
{type java.lang.String}
{value {}}} {{name dataSourceName}
{required false}
{type java.lang.String}
{value {}}} {{name description}
{required false}
{type java.lang.String}
{value {}}} {{name connectionAttributes}
{required false}
{type java.lang.String}
{value upgrade=true}} {{name createDatabase}
{required false}
{type java.lang.String}
{value {}}}}}}}
{provider "Derby JDBC Provider(cells/isthmusCell04/nodes/isthmusNode14/servers/s
erver1|resources.xml#JDBCProvider_1183122153343)"}
{providerType "Derby JDBC Provider"}
{relationalResourceAdapter "WebSphere Relational Resource Adapter(cells/isthmusC
ell04/nodes/isthmusNode14/servers/server1|resources.xml#builtin_rra)"}
{statementCacheSize 10}
[datasourceHelperClassname com.ibm.websphere.rsadapter.DerbyDataStoreHelper]
[description "Datasource for the WebSphere Default Application"]
[jndiName DefaultDatasource]
[name "Default Datasource"]
[propertySet [[resourceProperties [[[description "Location of Apache Derby default database."]
[name databaseName]
[type string]
[value ${WAS_INSTALL_ROOT}/bin/DefaultDB]] [[name remoteDataSourceProtocol]
[type string]
[value []]] [[name shutdownDatabase]
[type string]
[value []]] [[name dataSourceName]
[type string]
[value []]] [[name description]
[type string]
[value []]] [[name connectionAttributes]
[type string]
[value []]] [[name createDatabase]
[type string]
[value []]]]]]]
[provider "Apache Derby JDBC Driver(cells/pongo/nodes/pongo/servers/server1|resources.xml#JDBCProvider_1)"]
[relationalResourceAdapter "WebSphere Relational Resource Adapter(cells/pongo/nodes/pongo/servers/server1|
resources.xml#builtin_rra)"]
[statementCacheSize 0]
You might have to convert the Jython
output from a string to a list for further processing.Examples
- Using Jacl:
$AdminConfig showall "Default Datasource(cells/mycell/nodes/DefaultNode/servers/server1:resources.xml#DataSource_1)"
- Using Jython:
print AdminConfig.showall ("Default Datasource(cells/mycell/nodes/DefaultNode/servers/server1:resources.xml#DataSource_1)")
showAttribute
Use the showAttribute command to display only the value for the single attribute that you specify.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the object of interest.
- attribute
- Specifies the attribute to query.
Optional parameters
None.Sample output
mynode
Examples
- Using
Jacl:
set ns [$AdminConfig getid /Node:mynode/] $AdminConfig showAttribute $ns hostName
- Using Jython:
ns = AdminConfig.getid('/Node:mynode/') print AdminConfig.showAttribute(ns, 'hostName')
Before Version 7.0.0.5, the Jython scripting language does not recognize special characters. In addition, when the comma and single space characters occur between attribute parameters, these characters are treated as eliminators and ignored when the attribute value is saved. For example, you might have the following set of Jython commands:
You can use the following command to print the value:value='{"param1","param2"}' serverId=AdminConfig.getid('/Cell:cell_name/Node:node_name/Server:server_name') nameSpace=AdminConfig.create('StringNameSpaceBinding',serverId,[['name','TestName'], ['nameInSpace','TestNameSpace'],['stringToBind',value] ])
that results in the following output:print AdminConfig.showAttribute(nameSpace, 'stringToBind')
In Version 7.0.0.5 and later, the Jython scripting language recognizes the comma if you precede it with a backslash character (\). For example, in the original example set of Jython commands, change the first line to the following command:{"param1" "param2"}
When you print the value, the following output returns:value='{"param1"\,"param2"}'
{"param1","param2"}
types
Use the types command to return a list of the configuration object types that you can manipulate or customize the search query by giving an additional wildcard characters (*) or Java regular expressions (.*) pattern in the command syntax.
Target object
None.Required parameters
None.Optional parameters
- pattern
- Specifies additional search query information using wildcard character (*) or Java regular expressions pattern (.*).
Sample output
AdminService
Agent
ApplicationConfig
ApplicationDeployment
ApplicationServer
AuthMechanism
AuthenticationTarget
AuthorizationConfig
AuthorizationProvider
AuthorizationTableImpl
BackupCluster
CMPConnectionFactory
CORBAObjectNameSpaceBinding
Cell
CellManager
Classloader
ClusterMember
ClusteredTarget
CommonSecureInteropComponent
Examples
- Using Jacl:
$AdminConfig types
- Using
Jython:
print AdminConfig.types()
security
string pattern:- Using
Jacl:
$AdminConfig types *security*
- Using
Jython:
print AdminConfig.types('*security*')
uninstallResourceAdapter
Use the uninstallResourceAdapter command to uninstall a Java 2 Connector (J2C) resource adapter with the given J2C resource adapter configuration ID and an option list. When you remove a J2CResourceAdapter object from the configuration repository, the installed directory is removed at the time of synchronization. A stop request is sent to the J2CResourceAdapter MBean that was removed.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the resource adapter to remove.
Optional parameters
- options list
- Specifies the uninstall options for command. The valid option is
force
. This option forces the uninstallation of the resource adapter without checking whether the resource adapter is being used by an application. The application that is using it is not uninstalled. If you do not specify the force option and the specified resource adapter is still in use, the resource adapter is not uninstalled.
Sample output
WASX7397I: The following J2CResourceAdapter objects are removed:
MyJ2CRA(cells/juniarti/nodes/juniarti|resources.xml#J2CResourceAdapter_1069433028609)
Examples
- Using
Jacl:
set j2cra [$AdminConfig getid /J2CResourceAdapter:MyJ2CRA/] $AdminConfig uninstallResourceAdapter $j2cra {-force}
- Using
Jython:
j2cra = AdminConfig.getid('/J2CResourceAdapter:MyJ2CRA/') print AdminConfig.uninstallResourceAdapter(j2cra, '[-force]')
unsetAttributes
Use the unsetAttributes command to reset specific attributes for a configuration object to the default values.
Target object
None.Required parameters
- configuration ID
- Specifies the configuration ID of the configuration object of interest.
- attributes
- Specifies the attributes to reset to the default values.
Optional parameters
None.Examples
- Using Jacl:
set cluster [$AdminConfig getid /ServerCluster:myCluster] $AdminConfig unsetAttributes $cluster {"enableHA", "preferLocal"}
- Using Jython:
cluster = AdminConfig.getid("/ServerCluster:myCluster") AdminConfig.unsetAttributes(cluster, ["enableHA", "preferLocal"])
validate
Use the validate command to request the configuration validation results based on the files in your workspace, the value of the cross-document validation enabled flag, and the validation level setting. Optionally, you can specify a configuration ID to set the scope. If you specify a configuration ID, the scope of this request is the object named by the configuration ID parameter.
Target object
None.Required parameters
None.Optional parameters
- configuration ID
- Specifies the configuration ID of the object of interest.
Sample output
WASX7193I: Validation results are logged in c:\WebSphere5\AppServer\logs\wsadmin.valout: Total number of messages: 16
WASX7194I: Number of messages of severity 1: 16
Examples
- Using Jacl:
$AdminConfig validate
- Using Jython:
print AdminConfig.validate()