AdminConfig object for scripted administration

Use the AdminConfig object to invoke configuration commands and to create or change elements of the WebSphere Application Server configuration.

You 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 will receive a message that you are running in the local mode. If a server is currently running it is not recommended to run the AdminConfig tool in local mode.

The following public commands are available for the AdminConfig object:

attributes
Returns a list of the top level attributes for a given type.
Parameters: 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.

Returns: a list of attributes

Example usage:

Using Jacl:

$AdminConfig attributes ApplicationServer

Example output:

"properties Property*" "serverSecurity ServerSecurity" 
"server Server@" "id Long" "stateManagement StateManageable" 
"name String" "moduleVisibility EEnumLiteral(MODULE, 
COMPATIBILITY, SERVER, APPLICATION)" "services Service*" 
"statisticsProvider StatisticsProvider" 

checkin
Checks a file, that the document URI describes, into the configuration repository.

Note: This method only applies to deployment manager configurations.

Parameters: document URI, filename, opaque object
Returns: none

Example usage:

Using Jacl:

$AdminConfig checkin cells/MyCell/Node/MyNode/serverindex.xml \mydir\myfile $obj

The document URI is relative to the root of the configuration repository, for example, c:\WebSphere\AppServer\config\WebSphere\AppServer\config. The file specified by filename is used as the source of the file to check. The opaque object is an object that the extract command of the AdminConfig object returns by a prior call.

convertToCluster
Converts a server so that it is the first member of a new ServerCluster.
Parameters: server ID, cluster name
Returns: the configuration ID of the new cluster

Example usage:

Using Jacl:

set serverid [$AdminConfig getid /Server:myServer/]
$AdminConfig convertToCluster $serverid myCluster

Example output:

myCluster(cells/mycell/clusters/myCluster:cluster.xml#ClusterMember_2

create
Creates configuration objects.
Parameters using Jacl: type -- java.lang.String; parent ID -- java.lang.String; attributes -- java.lang.String
Returns: a string with configuration object names

Note: The name of the object type that you input here is the one based on the XML configuration files. It does not have to be the same name that the administrative console displays.

Example usage:

Using Jacl:

set jdbc1 [$AdminConfig getid /JDBCProvider:jdbc1/]
$AdminConfig create DataSource $jdbc1 {{name ds1}}

Example output:

ds1(cells/mycell/nodes/DefaultNode/servers/server1:resources.xml#DataSource_6)

createClusterMember
Creates a new server as a member of an existing cluster.

This method creates 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 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 contains the name specified by the memberName attribute. The memberName attribute is required.

Parameters using Jacl: cluster ID -- java.lang.String; node ID -- java.lang.String; member attributes -- java.lang.String
Returns: the configuration ID of the new cluster member

Note: The name of the object type that you input here is the one based on the XML configuration files. It does not have to be the same name that the administrative console displays.

Example usage:

Using Jacl:

set clid [$AdminConfig getid /ServerCluster:myCluster/]
set nodeid [$AdminConfig getid /Node:mynode/]
$AdminConfig createClusterMember $clid $nodeid {{memberName newMem1} {weight 5}}

Example output:

myCluster(cells/mycell/clusters/myCluster:cluster.xml#ClusterMember_2)

createDocument
Creates a new document in the configuration repository.

The documentURI parameter names the document to create in the repository. The filename parameter must be a valid local file name where the contents of the document exist.

Parameters: documentURI, filename
Returns: none

Example usage:

Using Jacl:

$AdminConfig createDocument cells/mycell/myfile.xml \mydir\\myfile

createUsingTemplate
Creates a type of object with the given parent, using a template.
Parameters using Jacl: type -- java.lang.String; parent id -- java.lang.String; attributes -- java.lang.String; template ID -- java.lang.String
Returns: the configuration ID of a new object

Example usage:

Using Jacl:

set node [$AdminConfig getid /Node:mynode/]
set templ [$AdminConfig listTemplates JDBCProvider "DB2 JDBC Provider (XA)"]
$AdminConfig createUsingTemplate JDBCProvider $node {{name newdriver}} $templ 

defaults
Displays 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.

Parameters: type

Note: The name of the object type that you input here is the one based on the XML configuration files. It does not have to be the same name that the administrative console displays.

Returns: a string containing a list of attributes with its type and value

Example usage:

Using Jacl:

$AdminConfig defaults TuningParams

Example 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

deleteDocument
Deletes a document from the configuration repository.

The documentURI parameter names the document that will be deleted from the repository.

Parameters: documentURI
Returns: none

Example usage:

Using Jacl:

$AdminConfig deleteDocument cells/mycell/myfile.xml

existsDocument
Tests for the existence of a document in the configuration repository.

The documentURI parameter names the document to test in the repository.

Parameters: documentURI
Returns: a true value if the document exists

Example usage:

Using Jacl:

$AdminConfig existsDocument cells/mycell/myfile.xml

Example output:

1

extract
Extracts a configuration repository file described by document URI and places it in the file named by filename.

Note: This method only applies to deployment manager configurations.

Parameters: document URI, filename
Returns: an opaue java.lang.Object to use when checking in the file

Example usage:

Using Jacl:

set obj [$AdminConfig extract cells/MyCell/Node/MyNode/serverindex.xml \mydir\myfile]

The document URI is relative to the root of the configuration repository, for example, c:\WebSphere\AppServer\config\WebSphere\AppServer\config. If the file specified by filename exists, the extracted file replaces it.

getCrossDocumentValidationEnabled
Returns a message with the current cross-document enablement setting.

This method returns true if cross-document validation is enabled.

Parameters: none
Returns: a string containing the message with the cross-document validation setting

Example usage:

Using Jacl:

$AdminConfig getCrossDocumentValidationEnabled

Example output:

WASX7188I: Cross-document validation enablement set to true

getid
Returns the configuration id of an object.
Parameters: containment path
Returns: the configuration id for an object described by the given containment path

Example usage:

Using Jacl:

$AdminConfig getid /Cell:testcell/Node:testNode/JDBCProvider:Db2JdbcDriver/

Example output:

Db2JdbcDriver(cells/testcell/nodes/testnode/resources.xml#JDBCProvider_1)

getObjectName
Returns a string version of the object name for the corresponding running MBean.

This method returns an empty string if there is no corresponding running MBean.

Parameters: configuration id
Returns: a string containing the object name

Example usage:

Using Jacl:

set server [$AdminConfig getid /Node:mynode/Server:server1/]
$AdminConfig getObjectName $server

Example 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

getSaveMode
Returns the mode used when you invoke a save command.

Possible values include the following:

  • overwriteOnConflict - saves changes even if they conflict with other configuration changes
  • rollbackOnConflict - causes a save operation to fail if changes conflict with other configuration changes. This value is the default.

Parameters: none
Returns: a string containing the current save mode setting

Example usage:

Using Jacl:

$AdminConfig getSaveMode

Example output:

rollbackOnConflict

getValidationLevel
Returns the validation used when files are extracted from the repository.
Parameters: none
Returns: a string containing the validation level

Example usage:

Using Jacl:

$AdminConfig getValidationLevel

Example output:

WASX7189I: Validation level set to HIGH

getValidationSeverityResult
Returns the number of validation messages with the given severity from the most recent validation.
Parameters: severity
Returns: a string indicating the number of validation messages of the given severity

Example usage:

Using Jacl:

$AdminConfig getValidationSeverityResult 1

Example output:

16

hasChanges
Returns true if unsaved configuration changes exist.
Parameters: none
Returns: a string indicating if unsaved configuration changes exist

Example usage:

Using Jacl:

$AdminConfig hasChanges

Example output:

1

help
Displays static help information for the AdminConfig object.
Parameters: none
Returns: a list of options

Example usage:

Using Jacl:

$AdminConfig help

Example output:

WASX7053I: The AdminConfig object communicates with the
        Config Service in a WebSphere server to manipulate configuration data
        for a WebSphere installation.  AdminConfig 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 AdminConfig operate in two modes:
        the default mode is one in which AdminConfig communicates with the
        WebSphere 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 with
        no server connected using the command line "-conntype NONE" option
        or setting the "com.ibm.ws.scripting.connectionType=NONE" property in
        the wsadmin.properties.

        The following commands are supported by AdminConfig; more detailed
        information about each of these commands is available by using the
        "help" command of AdminConfig and supplying the name of the command
        as an argument.

attributes      Show the attributes for a given type
checkin         Check a file into the the config repository.
convertToCluster
                converts a server to be the first member of a
                new ServerCluster
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 config 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 attributes of a given type.
deleteDocument  Deletes a document from the config repository.
existsDocument  Tests for the existence of a document in the config repository.
extract         Extract a file from the config repository.
getCrossDocumentValidationEnabled
                Returns true if cross-document validation is enabled.
getid           Show the configId of an object, given a string version of
                its containment
getObjectName   Given a config id, return 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 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            Show help information
list            Lists all configuration objects of a given type
listTemplates   Lists all available configuration templates of a given
                type.
modify          Change specified attributes of a given configuration object
parents         Show 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           Discard unsaved configuration changes
save            Commit 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            Show the attributes of a given configuration object
showall         Recursively show the attributes of a given configuration
                object, and all the objects contained within each attribute.
showAttribute   Displays only the value for the single attribute specified.
types           Show the possible types for configuration
validate        Invokes validation

installResourceAdapter
Installs a J2C resource adapter with the given RAR file name and an option string in the node.

The RAR file name is the fully qualified file name that resides in the node that you specify. The valid options include the following:

  • rar.name
  • rar.desc
  • rar.archivePath
  • rar.classpath
  • rar.nativePath
All options are optional. The rar.name option is the name for the J2CResourceAdapter. If you do not specify this option, the display name in the rar deployment descriptor is used. If that 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 the file is to be extracted. If you do not specify this option, the archive will be extracted to the $\{CONNECTOR_INSTALL_ROOT\} directory. The rar.classpath is the additional class path.

Parameters: rar file name, node, options
Returns: the configuration id of new J2CResourceAdapter object

Example usage:

Using Jacl:

$AdminConfig installResourceAdapter /rar/mine.rar {-rar.name myResourceAdapter -rar.desc "My rar file"} mynode

Example output:

myResourceAdapter(cells/mycell/nodes/mynode:resources.xml#J2CResourceAdapter_1)

list
Returns a list of objects of a given type, possibly scoped by a parent.
Parameters: 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.

Returns: a list of objects

Example usage:

Using Jacl:

$AdminConfig list JDBCProvider

Example 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) 

listTemplates
Displays a list of template object IDs.
Parameters: 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.

Returns: a list of template IDs

Example usage:

Using Jacl:

$AdminConfig listTemplates JDBCProvider

This example displays a list of all JDBCProvider templates available on the system.

modify
Supports modification of object attributes.
Parameters using Jacl: object -- java.lang.String; attributes -- java.lang.String
Returns: none

Example usage:

Using Jacl:

$AdminConfig modify ConnFactory1(cells/mycell/nodes/DefaultNode/servers/deploymentmgr/resources.xml#GenericJMSConnectionFactory_1) {{userID newID} {password newPW}}

parents
Obtains information about object types.
Parameters: 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.

Returns: a list of object types

Example usage:

Using Jacl:

$AdminConfig parents JDBCProvider

Example output:

Cell
Node
Server

queryChanges
Returns a list of unsaved configuration files.
Parameters: none
Returns: a string containing a list of files with unsaved changes

Example usage:

Using Jacl:

$AdminConfig queryChanges

Example output:

WASX7146I: The following configuration files contain unsaved changes:
cells/mycell/nodes/mynode/servers/server1/resources.xml

remove
Removes a configuration object.
Parameters: object
Returns: none

Example usage:

Using Jacl:

$AdminConfig remove ds1(cells/mycell/nodes/DefaultNode/servers/server1:resources.xml#DataSource_6)

required
Displays the required attributes contained by an object of a certain type.
Parameters: type

Note: The name of the object type that you input here is the one based on the XML configuration files. It does not have to be the same name that the administrative console displays.

Returns: a string containing a list of required attributes with its type

Example usage:

Using Jacl:

$AdminConfig required URLProvider

Example output:

Attribute                       Type
streamHandlerClassName          String
protocol                        String

reset
Resets the temporary workspace that holds updates to the configuration.
Parameters: none
Returns: none

Example usage:

Using Jacl:

$AdminConfig reset

save
Saves changes in the configuration repository.
Parameters: none
Returns: none

Example usage:

Using Jacl:

$AdminConfig save

setCrossDocumentValidationEnabled
Sets the cross-document validation enabled mode. Values include true or false.
Parameters: flag
Returns: none

Example usage:

Using Jacl:

$AdminConfig setCrossDocumentValidationEnabled true

setSaveMode
Allows you to toggle the behavior of the save command. The default is rollbackOnConflict. When a conflict is discovered while saving, the unsaved changes are not committed. The alternative is overwriteOnConflict which saves the changes to the configuration repository even if there are conflicts.
Parameters: mode
Returns: none

Example usage:

Using Jacl:

$AdminConfig setSaveMode overwriteOnConflict

setValidationLevel
Sets the validation used when files are extracted from the repository.

There are five validation levels: none, low, medium, high, or highest.

Parameters: level
Returns: a string containing the validation level setting

Example usage:

Using Jacl:

$AdminConfig setValidationLevel high

Example output:

WASX7189I: Validation level set to HIGH

show
Returns the top level attributes of the given object.
Parameters: object, attributes
Returns: a string containing the attribute value

Example usage:

Using Jacl:

$AdminConfig show Db2JdbcDriver(cells/mycell/nodes/DefaultNode/resources.xm#JDBCProvider_1)

Example output with Jacl:

{name "Sample Datasource"} {description "Data source for the Sample entity beans"}  

showall
Recursively shows the attributes of a given configuration object.
Parameters: object, attributes
Returns: a string containing the attribute value

Example usage:

Using Jacl:

$AdminConfig showall "Default Datasource(cells/mycell/nodes/DefaultNode/servers/server1:resources.xml#DataSource_1)

Example output with Jacl:

{authMechanismPreference BASIC_PASSWORD}
{category default}
{connectionPool {{agedTimeout 0}
{connectionTimeout 1000}
{maxConnections 30}
{minConnections 1}
{purgePolicy FailingConnectionOnly}
{reapTime 180}
{unusedTimeout 1800}}}
{datasourceHelperClassname com.ibm.websphere.rsadapter.CloudscapeDataStoreHelper}
{description "Datasource for the WebSphere Default Application"}
{jndiName DefaultDatasource}
{name "Default Datasource"}
{propertySet {{resourceProperties {{{description "Location of Cloudscape default database."}
{name databaseName}
{type java.lang.String}
{value ${WAS_INSTALL_ROOT}/bin/DefaultDB}} {{name remoteDataSourceProtocol}
{type java.lang.String}
{value {}}} {{name shutdownDatabase}
{type java.lang.String}
{value {}}} {{name dataSourceName}
{type java.lang.String}
{value {}}} {{name description}
{type java.lang.String}
{value {}}} {{name connectionAttributes}
{type java.lang.String}
{value {}}} {{name createDatabase}
{type java.lang.String}
{value {}}}}}}}
{provider "Cloudscape 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}

showAttribute
Displays only the value for the single attribute that you specify.

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 that contains the attribute name and value. It only displays the attribute value.

Parameters: config id, attribute
Returns: a string containing the attribute value

Example usage:

Using Jacl:

set ns [$AdminConfig getid /Node:mynode/]
$AdminConfig showAttribute $ns hostName

Example output:

mynode

types
Returns a list of the configuration object types that you can manipulate.
Parameters: none
Returns: a list of object types

Example usage:

Using Jacl:

$AdminConfig types

Example output:

AdminService
Agent
ApplicationConfig
ApplicationDeployment
ApplicationServer
AuthMechanism
AuthenticationTarget
AuthorizationConfig
AuthorizationProvider
AuthorizationTableImpl
BackupCluster
CMPConnectionFactory
CORBAObjectNameSpaceBinding
Cell
CellManager
Classloader
ClusterMember
ClusteredTarget
CommonSecureInteropComponent

validate
Invokes validation.

This command requests 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 config id parameter.

Parameters: config id (optional)
Returns: a string containing results of validation

Example usage:

Using Jacl:

$AdminConfig validate

Example output:

WASX7193I: Validation results are logged in \WebSphere5\AppServer\logs\wsadmin.valout: Total number of messages: 16
WASX7194I: Number of messages of severity 1: 16


Related concepts
Jacl
Related reference
AdminApp object for scripted administration
AdminControl object for scripted administration
Help object for scripted administration



Searchable topic ID:   rxml_adminconfig1
Last updated: Jun 21, 2007 9:56:50 PM CDT    WebSphere Application Server for z/OS, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/rxml_adminconfig1.html

Library | Support | Terms of Use | Feedback