WAS v8.5 > Reference > Commands (wsadmin scripting)Commands for the AdminConfig object using wsadmin.sh
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.
We can start the scripting client without a running server, if you only want to use 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 currently running, do not run the AdminConfig tool in local mode. Configuration changes that are made in local mode are not be reflected in the running server configuration. If you save a conflicting configuration, you could corrupt the configuration.
We can use the Jython list or string syntax to pass parameters to a wsadmin command. If we have a parameter that includes a comma as a character, though, you need to use the Jython string syntax to pass the parameters.
To use the create command, for example, you could enter command similar to the following:
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)
The following commands are available for the AdminConfig object:
- 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
Return a list of the top level attributes for a given type.
Target object None.
Required parameters
- object type
- Name of the object type based on the XML configuration files. The object type does not have to be the same name the dmgr 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
- Jacl:
$AdminConfig attributes ApplicationServer
- Jython:
print AdminConfig.attributes('ApplicationServer')
checkin
Check a file into the configuration repository described by the document Uniform Resource Identifier (URI). This method only applies to deployment manager configurations.
Target object None.
Required parameters
- URI
- The document URI is relative to the root of the configuration repository, for example:
- app_server_root\config
- file name
- Name of the source file to check in.
- opaque object
- Specifies an object 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
- Jacl:
$AdminConfig checkin cells/MyCell/Node/MyNode/serverindex.xml /mydir/myfile $obj
- Jython:
print AdminConfig.checkin('cells/MyCell/Node/MyNode/serverindex.xml', '/mydir/myfile', obj)
convertToCluster
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
- Name of the cluster of interest.
Optional parameters None.
Sample output
myCluster(cells/mycell/clusters/myCluster|cluster.xml#ClusterMember_2)
Examples
- Jacl:
set serverid [$AdminConfig getid /Server:myServer/]
$AdminConfig convertToCluster $serverid myCluster- Jython:
serverid = AdminConfig.getid('/Server:myServer/')
print AdminConfig.convertToCluster(serverid, 'myCluster')
create
Create configuration objects.
Target object None.
Required parameters
- type
- Name of the object type based on the XML configuration files. This parameter value does not have to be the same name the dmgr console displays.
- parent ID
- Configuration ID of the parent object.
- attributes
- Specifies any attributes to add to the configuration ID.
Optional parameters None.
Sample output
This command returns a string of the configuration object name, as this sample output displays:
ds1(cells/mycell/nodes/DefaultNode/servers/server1|resources.xml#DataSource_6)
Examples
- Jacl:
set jdbc1 [$AdminConfig getid /JDBCProvider:jdbc1/]
$AdminConfig create DataSource $jdbc1 {{name ds1}}- Jython string attributes:
jdbc1 = AdminConfig.getid('/JDBCProvider:jdbc1/')
print AdminConfig.create('DataSource', jdbc1, '[[name ds1]]')- Jython with object attributes:
jdbc1 = AdminConfig.getid('/JDBCProvider:jdbc1/')
print AdminConfig.create('DataSource', jdbc1, [['name', 'ds1']])
createClusterMember
Create a new server object on the node the node id parameter specifies. This server is created as a new member of the existing cluster specified by the cluster id parameter, and contains attributes specified in the member attributes parameter. The server is created using the server template specified by the template id attribute, and containing 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 will be identical.
Target object None.
Required parameters
- cluster ID
- Configuration ID of the cluster of interest.
- node ID
- Configuration ID of the node of interest.
- template ID
- 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
This command returns the configuration ID of the newly created cluster member, as the following example displays:
myCluster(cells/mycell/clusters/myCluster|cluster.xml#ClusterMember_2)
Examples
- Jacl:
set clid [$AdminConfig getid /ServerCluster:myCluster/]
set nodeid [$AdminConfig getid /Node:mynode/]
$AdminConfig createClusterMember $clid $nodeid {{memberName newMem1} {weight 5}}- Jython string attributes:
clid = AdminConfig.getid('/ServerCluster:myCluster/')
nodeid = AdminConfig.getid('/Node:mynode/')
print AdminConfig.createClusterMember(clid, nodeid, '[[memberName newMem1] [weight 5]]')- Jython with object attributes:
clid = AdminConfig.getid('/ServerCluster:myCluster/')
nodeid = AdminConfig.getid('/Node:mynode/')
print AdminConfig.createClusterMember(clid, nodeid, [['memberName', 'newMem1'], ['weight', 5]])
createDocument
Create a new document in the configuration repository.
Target object None.
Required parameters
- document URI
- 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
- Jacl:
$AdminConfig createDocument cells/mycell/myfile.xml /mydir/myfile
- Jython with string attributes:
AdminConfig.createDocument('cells/mycell/myfile.xml', 'c:/mydir/myfile')
createUsingTemplate
Create a type of object with the given parent, using a template. We can only use this command for creation of a server with APPLICATION_SERVER type. To create a server with a type other than APPLICATION_SERVER, use the createGenericServer or the createWebServer command.
Target object None.
Required parameters
- type
- Type of object to create.
- parent
- Configuration ID of the parent.
- template
- Configuration ID of an existing object. This object can be a template object returned using the listTemplates command, or any other existing object of the correct type.
Optional parameters
- attributes
- Specifies attribute values for the object. The attributes specified using this parameter override the settings in the template.
Sample output
The command returns the configuration ID of the new object, as the following example displays:
myCluster(cells/mycell/clusters/myCluster|cluster.xml#ClusterMember_2)
Examples
- Jacl:
set node [$AdminConfig getid /Node:mynode/] set templ [$AdminConfig listTemplates JDBCProvider "DB2 JDBC Provider (XA)"] $AdminConfig createUsingTemplate JDBCProvider $node {{name newdriver}} $templ- 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)- 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
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
- Type of object to return. The name of the object type specified is based on the XML configuration files. This name does not have to be the same name the dmgr console displays.
Optional parameters None.
Sample output
The command returns string containing a list of attributes with its type and value, as the following example displays:
Attribute Type Default usingMultiRowSchema Boolean false maxInMemorySessionCount Integer 1000 allowOverflow Boolean true scheduleInvalidation Boolean false writeFrequency ENUM writeInterval Integer 1.0 writeContents ENUM invalidationTimeout Integer 30 invalidationSchedule InvalidationScheduleExamples
- Jacl:
$AdminConfig defaults TuningParams
- Jython:
print AdminConfig.defaults('TuningParams')
deleteDocument
Delete a document from the configuration repository.
Target object None.
Required parameters
- documentURI
- Document to delete from the repository.
Optional parameters None.
Examples
- Jacl:
$AdminConfig deleteDocument cells/mycell/myfile.xml
- Jython:
AdminConfig.deleteDocument('cells/mycell/myfile.xml')
existsDocument
Test for the existence of a document in the configuration repository.
Target object None.
Required parameters
- documentURI
- Document to test for in the repository.
Optional parameters None.
Sample output
The command returns a true value if the document exists, as the following example displays:
1
Examples
- Jacl:
$AdminConfig existsDocument cells/mycell/myfile.xml
- Jython:
print AdminConfig.existsDocument('cells/mycell/myfile.xml')
extract
Extract a configuration repository file described by the document URI and places it in the file named by filename. This method only applies to deployment manager configurations.
Target object None.
Required parameters
- documentURI
- 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
- filename
- 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 specified by the filename parameter exists, the extracted file replaces it.
Optional parameters None.
Sample output
The command returns an opaque "digest" object which should be used to check the file back in using the checkin command.
Examples
- Jacl:
set obj [$AdminConfig extract cells/MyCell/nodes/MyNode/serverindex.xml /mydir/myfile]
- Jython:
obj = AdminConfig.extract('cells/MyCell/nodes/MyNode/serverindex.xml','/mydir/myfile')
getCrossDocumentValidationEnabled
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
The command returns string containing the message with the cross-document validation setting, as the following example displays:
WASX7188I: Cross-document validation enablement set to true
Examples
- Jacl:
$AdminConfig getCrossDocumentValidationEnabled
- Jython:
print AdminConfig.getCrossDocumentValidationEnabled()
getid
Return the configuration ID of an object.
Target object None.
Required parameters
- containment path
- Containment path of interest.
Optional parameters
None.
Sample output
The command returns configuration ID for an object described by the containment path, as the following example displays:
Db2JdbcDriver(cells/testcell/nodes/testnode|resources.xml#JDBCProvider_1)
Examples
- Jacl:
$AdminConfig getid /Cell:testcell/Node:testNode/JDBCProvider:Db2JdbcDriver/
- Jython:
print AdminConfig.getid('/Cell:testcell/Node:testNode/JDBCProvider:Db2JdbcDriver/')
getObjectName
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
- Configuration ID of the object name to return.
Optional parameters
None.
Sample output
The command returns a string containing the object name, as the following example displays:
WebSphere:cell=mycell,name=server1,mbeanIdentifier=cells/mycell/nodes/mynode/servers/server1/ server.xml#Server_1,type=Server,node=mynode,process=server1,processType=UnManagedProcessExamples
- Jacl:
set server [$AdminConfig getid /Node:mynode/Server:server1/] $AdminConfig getObjectName $server- Jython:
server = AdminConfig.getid('/Node:mynode/Server:server1/') print AdminConfig.getObjectName(server)
getObjectType
Display the object type for the object configuration ID of interest.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the object name to return.
Optional parameters
None.
Examples
- Jacl:
set server [$AdminConfig getid /Node:mynode/Server:server1/] $AdminConfig getObjectType $server- Jython:
server = AdminConfig.getid('/Node:mynode/Server:server1/') print AdminConfig.getObjectType(server)
getSaveMode
Return the mode used when we invoke a save command. The command returns one of the following possible values:
- 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
The command returns a string containing the current save mode setting, as the following example displays:
rollbackOnConflict
Examples
- Jacl:
$AdminConfig getSaveMode
- Jython:
print AdminConfig.getSaveMode()
getValidationLevel
Return the validation used when files are extracted from the repository.
Target object None.
Required parameters
None.
Optional parameters
None.
Sample output
The command returns a string containing the validation level, as the following example displays:
WASX7189I: Validation level set to HIGH
Examples
- Jacl:
$AdminConfig getValidationLevel
- Jython:
print AdminConfig.getValidationLevel()
getValidationSeverityResult
Return the number of validation messages with the given severity from the most recent validation.
Target object None.
Required parameters
- severity
- Which severity level for which to return the number of validation messages. Specify an integer value between 0 and 9.
Optional parameters
None.
Sample output
The command returns a string that indicates the number of validation messages of the given severity, as the following example displays:
16
Examples
- Jacl:
$AdminConfig getValidationSeverityResult 1
- Jython:
print AdminConfig.getValidationSeverityResult(1)
hasChanges
Determine if unsaved configuration changes exist.
Target object None.
Required parameters
None.
Optional parameters
None.
Sample output
The command returns 1 if unsaved configuration changes exist or 0 if unsaved configuration changes do not exist, as the following example displays:
1
Examples
- Jacl:
$AdminConfig hasChanges
- Jython:
print AdminConfig.hasChanges()
help
Display static help information for the AdminConfig object.
Target object None.
Required parameters
None.
Optional parameters
None.
Sample output
The command returns a list of options for the help command.
Examples
- Jacl:
$AdminConfig help
- Jython:
print AdminConfig.help()
installResourceAdapter
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, only existing J2C connection factory, J2C activation specs, and J2C administrative objects will be edited. No new J2C objects will be created.
Target object None.
Required parameters
- node
- Node of interest.
- RAR file name
- Fully qualified file name of the RAR file that resides in the node specified.
Optional parameters
- options
- Specifies additional 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
The rar.name option is the name for the J2C resource adapter. If we do not specify this option, the display name in the RAR deployment descriptor is used. If that name is not specified, the RAR file name is used. The rar.desc option is a description of the J2CResourceAdapter.
The rar.archivePath is the name of the path where you extract the file. If we 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:
name String value String type String *desc String *required true/false * means the item is optionalEach attribute of the property are specified in a set of {}. A property is specified in a set of {}. We can specify multiple properties in {}.Sample output
The command returns the configuration ID of the new J2CResourceAdapter object:
myResourceAdapter(cells/mycell/nodes/mynode|resources.xml#J2CResourceAdapter_1)
Examples
- Jacl:
$AdminConfig installResourceAdapter /rar/mine.rar mynode{-rar.name myResourceAdapter -rar.desc "My rar file"}
- Jython:
print AdminConfig.installResourceAdapter('/rar/mine.rar', 'mynode', '[-rar.name myResourceAdapter -rar.desc "My rar file"]')
To add a String into the resource adapter configuration...
resourceProperties (name=myName,value=myVal)
pSet = [['propertySet',[['resourceProperties',[[['name','myName'], ['type', 'String'], ['value','myVal']]]]]]]
myRA =AdminConfig.installResourceAdapter('/query.rar','mynodeCellManager05', ['-rar.desc','mydesc'])
AdminConfig.modify(myRA,pSet)
list
Return a list of objects of a given type, possibly scoped by a parent. We can use wildcard characters (*) or Java regular expressions (.*) in the command syntax to customize the search query.
Target object None.
Required parameters
- object type
- 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 the dmgr console displays.
- pattern
- Specifies additional search query information using wildcard characters or Java regular expressions.
Optional parameters
None.
Sample output
The command returns a list of objects:
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
The following examples list each JDBC provider configuration object:
- Jacl: AdminConfig list JDBCProvider
- Jython: print AdminConfig.list('JDBCProvider')
The following examples list each JDBC provider configuration object that begin with the derby string:
- Jacl: $AdminConfig list JDBCProvider derby*
- Jython: print AdminConfig.list('JDBCProvider', 'derby*')
We can use regular Java expression patterns and wildcard patterns to specify command name for $AdminConfig list, types and listTemplates functions.
The following examples list the configuration objects of type server starting from server1:
- Jacl and regular Java expression patterns:
$AdminConfig list Server server1.*
- Jacl and wildcard patterns:
$AdminConfig list Server server1*
- Jython and regular Java expression patterns::
print AdminConfig.list("Server", "server1.*")
- Jython and wildcard patterns:
print AdminConfig.list("Server", "server1*")
The following examples list each find configuration object of that starts with SSLConfig:
- Jacl and regular Java expression patterns:
$AdminConfig types SSLConfig.*
- Jacl and wildcard patterns:
$AdminConfig types SSLConfig*
- Jython and regular Java expression patterns:
print AdminConfig.types("SSLConfig.*")
- Jython and wildcard patterns:
print AdminConfig.types("SSLConfig*")
listTemplates
Display a list of template object IDs. We can use wildcard characters (*) or Java regular expressions (.*) in the command syntax to customize the search query.
Target object None.
Required parameters
- object type
- 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 the dmgr console displays.
- pattern
- Specifies additional search query information using wildcard characters or Java regular expressions.
Optional parameters None.
Sample output
The example displays a list of all the JDBCProvider templates available on the system:
"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
The following examples return each JDBC provider template:
- Jacl:
$AdminConfig listTemplates JDBCProvider
- Jython:
print AdminConfig.listTemplates('JDBCProvider')
The following examples return each JDBC provider template that begins with the sybase string:
- Jacl:
$AdminConfig listTemplates JDBCProvider sybase*
- Jython:
print AdminConfig.listTemplates('JDBCProvider', 'sybase*')
modify
Support the modification of object attributes.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the object to modify.
- attributes
- Attributes to modify for the configuration ID of interest.
Optional parameters None.
Examples
- Jacl:
$AdminConfig modify ConnFactory1(cells/mycell/nodes/DefaultNode/servers/deploymentmgr|resources.xml# GenericJMSConnectionFactory_1) {{userID newID} {password newPW}}- Jython with string attributes:
AdminConfig.modify('ConnFactory1(cells/mycell/nodes/DefaultNode/servers/deploymentmgr|resources.xml# GenericJMSConnectionFactory_1)', '[[userID newID] [password newPW]]')- Jython with object attributes:
AdminConfig.modify('ConnFactory1(cells/mycell/nodes/DefaultNode/servers/deploymentmgr|resources.xml# GenericJMSConnectionFactory_1)', [['userID', 'newID'], ['password', 'newPW']])
parents
Obtain information about object types.
Target object None.
Required parameters
- object type
- 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 the dmgr console displays.
Optional parameters None.
Sample output
The example displays a list of object types:
Cell Node ServerExamples
- Jacl:
$AdminConfig parents JDBCProvider
- Jython:
print AdminConfig.parents('JDBCProvider')
queryChanges
Return a list of unsaved configuration files.
Target object None.
Required parameters None.
Optional parameters None.
Sample output
The example displays a string containing a list of files with unsaved changes:
WASX7146I: The following configuration files contain unsaved changes: cells/mycell/nodes/mynode/servers/server1|resources.xmlExamples
- Jacl:
$AdminConfig queryChanges
- Jython:
print AdminConfig.queryChanges()
remove
Remove a configuration object.
Target object None.
Required parameters
- configuration ID
- Configuration object of interest.
Optional parameters None.
Examples
- Jacl:
set ds [$AdminConfig list DataSource "Default Datasource*"] $AdminConfig remove $ds- Jython:
ds = AdminConfig.list('DataSource', 'Default Datasource*') AdminConfig.remove(ds)
required
Display the required attributes that are contained by an object of a certain type.
Target object None.
Required parameters
- type
- 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 the dmgr console displays.
Optional parameters None.
Sample output
The example displays a string containing a list of the required attributes with its type:
Attribute Type streamHandlerClassName String protocol StringExamples
- Jacl:
$AdminConfig required URLProvider
- Jython:
print AdminConfig.required('URLProvider')
reset
Reset the temporary workspace that holds updates to the configuration.
Target object None.
Required parameters None.
Optional parameters None.
Examples
- Jacl:
$AdminConfig reset
- Jython:
AdminConfig.reset()
resetAttributes
Reset specific attributes for the configuration object of interest.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the configuration object of interest.
- attributes
- Attribute to reset and the value to which the attribute is reset.
Optional parameters None.
Examples
- Jacl:
set ds [$AdminConfig list DataSource "Default Datasource*"]
$AdminConfig resetAttributes $ds {{"description" "A new description for the data source"}}- Jython:
ds = AdminConfig.list('DataSource', 'Default Datasource*')
AdminConfig.resetAttributes(ds, [["description", "A new description for the data source"]])
save
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
- Jacl:
$AdminConfig save
- Jython:
AdminConfig.save()
setCrossDocumentValidationEnabled
Set the cross-document validation enabled mode. Values include true or false.
Target object None.
Required parameters
- flag
- Whether cross-document validation is enabled or disabled. Specify true to enable or false to disable cross-document validation.
Optional parameters None.
Sample output
The command returns a status statement for cross-document validation, as the following example displays:
WASX7188I: Cross-document validation enablement set to true
Examples
- Jacl:
$AdminConfig setCrossDocumentValidationEnabled true
- Jython:
print AdminConfig.setCrossDocumentValidationEnabled('true')
setSaveMode
Modify the behavior of the save command.
Target object None.
Required parameters
- save mode
- Save mode to use. Default is rollbackOnConflict. When the system discovers a conflict while saving, the unsaved changes are not committed. The alternative value is overwriteOnConflict, which saves the changes to the configuration repository even if conflicts exist. To use overwriteOnConflict 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
- Jacl:
$AdminConfig setSaveMode overwriteOnConflict
- Jython:
AdminConfig.setSaveMode('overwriteOnConflict')
setValidationLevel
Set the validation used when files are extracted from the repository.
Target object None.
Required parameters
- level
- Validation to use. Five validation levels are available: none, low, medium, high, or highest.
Optional parameters None.
Sample output
The command returns a string containing the validation level setting, as the following example displays:
WASX7189I: Validation level set to HIGH
Examples
- Jacl:
$AdminConfig setValidationLevel high
- Jython:
print AdminConfig.setValidationLevel('high')
show
Return the top-level attributes of the given object.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the object of interest.
Optional parameters None.
Sample output
The command returns a string containing the attribute value, as the following example displays:
[name "Sample Datasource"] [description "Data source for the Sample entity beans"]
Examples
- Jacl:
$AdminConfig show Db2JdbcDriver(cells/mycell/nodes/DefaultNode|resources.xmlJDBCProvider_1)
- Jython:
print AdminConfig.show('Db2JdbcDriver(cells/mycell/nodes/DefaultNode|resources.xmlJDBCProvider_1)')
showall
Recursively show the attributes of a given configuration object.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the object of interest.
Optional parameters None.
Sample output
The command returns a string containing the attribute value, as the following examples show:
Jacl:
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}Jython:
[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
- Jacl:
$AdminConfig showall "Default Datasource(cells/mycell/nodes/DefaultNode/servers/server1:resources.xml#DataSource_1)"
- Jython:
print AdminConfig.showall ("Default Datasource(cells/mycell/nodes/DefaultNode/servers/server1:resources.xml#DataSource_1)")
showAttribute
Display only the value for the single attribute specified.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the object of interest.
- attribute
- Attribute to query.
Optional parameters None.
Sample output
The output of this command is different from the output of the show command when a single attribute is specified. The showAttribute command does not display a list containing the attribute name and value. It only displays the attribute value, as the following example displays:
mynode
Examples
- Jacl:
set ns [$AdminConfig getid /Node:mynode/]
$AdminConfig showAttribute $ns hostName- Jython:
ns = AdminConfig.getid('/Node:mynode/')
print AdminConfig.showAttribute(ns, 'hostName')Prior to v7.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 deliminators and ignored when the attribute value is saved. For example, you might have the following set of Jython commands:
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] ])You can use the following command to print the value:
print AdminConfig.showAttribute(nameSpace, 'stringToBind')
which results in the following output:{"param1" "param2"}
In v7.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:value='{"param1"\,"param2"}'
When you print the value, the following output returns:{"param1","param2"}
types
Return a list of the configuration object types that we can manipulate. We can use wildcard characters (*) or Java regular expressions (.*) in the command syntax to customize the search query.
Target object None.
Required parameters None.
Optional parameters None.
Sample output
The command returns a list of object types, as the following example displays:
AdminService Agent ApplicationConfig ApplicationDeployment ApplicationServer AuthMechanism AuthenticationTarget AuthorizationConfig AuthorizationProvider AuthorizationTableImpl BackupCluster CMPConnectionFactory CORBAObjectNameSpaceBinding Cell CellManager Classloader ClusterMember ClusteredTarget CommonSecureInteropComponentExamples
The following examples return each object type in your configuration:
- Jacl:
$AdminConfig types
- Jython:
print AdminConfig.types()
The following examples return each object type in your configuration containing the security string:
- Jacl:
$AdminConfig types *security*
- Jython:
print AdminConfig.types('*security*')
uninstallResourceAdapter
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 will be removed at the time of synchronization. A stop request will be sent to the J2CResourceAdapter MBean that was removed.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the resource adapter to remove.
Optional parameters
- options list
- 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 will not be uninstalled. If we do not specify the force option and the specified resource adapter is still in use, the resource adapter is not uninstalled.
Sample output
The command returns the configuration ID of the J2C resource adapter that is removed, as the following example displays:
WASX7397I: The following J2CResourceAdapter objects are removed: MyJ2CRA(cells/juniarti/nodes/juniarti|resources.xml#J2CResourceAdapter_1069433028609)
Examples
- Jacl:
set j2cra [$AdminConfig getid /J2CResourceAdapter:MyJ2CRA/]
$AdminConfig uninstallResourceAdapter $j2cra {-force}- Jython:
j2cra = AdminConfig.getid('/J2CResourceAdapter:MyJ2CRA/')
print AdminConfig.uninstallResourceAdapter(j2cra, '[-force]')
unsetAttributes
Reset specific attributes for a configuration object to the default values.
Target object None.
Required parameters
- configuration ID
- Configuration ID of the configuration object of interest.
- attributes
- Attributes to reset to the default values.
Optional parameters None.
Examples
- Jacl:
set cluster [$AdminConfig getid /ServerCluster:myCluster] $AdminConfig unsetAttributes $cluster {"enableHA", "preferLocal"}
- Jython:
cluster = AdminConfig.getid("/ServerCluster:myCluster") AdminConfig.unsetAttributes(cluster, ["enableHA", "preferLocal"])
validate
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, we can specify a configuration ID to set the scope. If we 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
- Configuration ID of the object of interest.
Sample output
The command returns a string containing the results of the validation, as the following example displays:
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
- Jacl:
$AdminConfig validate
- Jython:
print AdminConfig.validate()
Related
Use the wsadmin scripting AdminConfig object for scripted administration