AdminConfig

 


Contents

  1. Overview
  2. attributes
  3. checkin
  4. contents
  5. convertToCluster
  6. create
  7. createClusterMember
  8. createDocument
  9. createUsingTemplate
  10. defaults
  11. deleteDocument
  12. existsDocument
  13. extract
  14. getCrossDocumentValidationEnabled
  15. getid
  16. getObjectName
  17. getSaveMode
  18. getValidationLevel
  19. getValidationSeverityResult
  20. hasChanges
  21. help
  22. installResourceAdapter
  23. list
  24. listTemplates
  25. modify
  26. parents
  27. queryChanges
  28. remove
  29. required
  30. reset
  31. save
  32. setCrossDocumentValidationEnabled
  33. setSaveMode
  34. setValidationLevel
  35. show
  36. showall
  37. showAttribute
  38. types
  39. validate

See Also:

  1. Sample scripts

 


Overview

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

One can start wsadmin.sh without a running server, if you only want to use local operations. To run in local mode, use the -conntype NONE option to start wsadmin.sh. 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 methods are available for the AdminConfig object:

 

attributes

Returns a list of the top level attributes for a given type.

Arguments: object type from XML configuration file
Returns: a list of attributes

Example Usage

$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.

This method only applies to deployment manager configurations.

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

Example Usage

$AdminConfig checkin cells/MyCell/Node/MyNode/serverindex.xml c:\\mydir\myfile $obj
The document URI is relative to the root of the configuration repository, for example, c:\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.

 

contents

Obtains information about object types.

Arguments: Object type from XML configuration file
Returns: List of object types

Example Usage

$AdminConfig contents JDBCProvider
Example output:

{DataSource DataSource}
{WAS40DataSource WAS40DataSource}

 

convertToCluster

Converts a server so that it is the first member of a new ServerCluster.

Arguments: server id, cluster name
Returns: the configuration id of the new cluster

Example Usage

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

Example output:

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

 

create

Creates configuration objects.

Arguments: type, parent ID, attributes from XML configuration file
Returns: a string with configuration object names

Example Usage

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

Example output:

ds1(cells/cellname/nodes/DefaultNode/servers/servername: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 argument specifies. This server is created as a new member of the existing cluster specified by the cluster id argument, and contains attributes specified in the member attributes argument. 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.

Arguments: cluster id, node id, member attributes - Name derived from XML configuration files.
Returns: the configuration id of the new cluster member

Example Usage

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

Example output:

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

 

createDocument

Creates a new document in the configuration repository.

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

Arguments: documentURI, filename
Returns: none

Example Usage

$AdminConfig createDocument cells/cellname/myfile.xml c:\\mydir\\myfile

 

createUsingTemplate

Creates a type of object with the given parent, using a template.

Arguments: type, parent id, attributes, template ID
Returns: the configuration ID of a new object

Example Usage

set node [$AdminConfig getid /Node:nodename/]
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.

Arguments: type from XML configuration file
Returns: a string containing a list of attributes with its type and value

Example Usage

$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 argument names the document that will be deleted from the repository.

Arguments: documentURI
Returns: none

Example Usage

$AdminConfig deleteDocument cells/cellname/myfile.xml

 

existsDocument

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

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

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

Example Usage

$AdminConfig existsDocument cells/cellname/myfile.xml

Example output:

1

 

extract

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

This method only applies to deployment manager configurations.

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

Example Usage

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

The document URI is relative to the root of the configuration repository, for example, c:\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.

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

Example Usage

$AdminConfig getCrossDocumentValidationEnabled

Example output:

WASX7188I: Cross-document validation enablement set to true

 

getid

Returns the configuration id of an object.

Arguments: containment path
Returns: the configuration id for an object described by the given containment path

Example Usage

$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.

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

Example Usage

set server [$AdminConfig getid /Node:nodename/Server:servername/]
$AdminConfig getObjectName $server

 

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.

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

Example Usage

$AdminConfig getSaveMode

Example output:

rollbackOnConflict

 

getValidationLevel

Returns the validation used when files are extracted from the repository.

Arguments: none
Returns: a string containing the validation level

Example Usage

$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.

Arguments: severity
Returns: a string indicating the number of validation messages of the given severity

Example Usage

$AdminConfig getValidationSeverityResult 1

Example output:

16

 

hasChanges

Returns true if unsaved configuration changes exist.

Arguments: none
Returns: a string indicating if unsaved configuration changes exist

Example Usage

$AdminConfig hasChanges
Example output:

1

 

help

Displays static help information for the AdminConfig object.

Arguments: none
Returns: a list of options

Example Usage

$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 wsadmin.sh 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.

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

Example Usage

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

Example output:

myResourceAdapter(cells/cellname/nodes/nodename:resources.xml#J2CResourceAdapter_1)

 

list

Returns a list of objects of a given type, possibly scoped by a parent.

Arguments: Object type - Name derived from XML configuration file
Returns: List of objects

Example Usage

set xJDBCProvider $AdminConfig list JDBCProvider
set servers [$AdminConfig list Server $node]
Example output:

Db2JdbcDriver(cells/cellname/nodes/DefaultNode/resources.xml#JDBCProvider_1) Db2JdbcDriver(cells/cellname/nodes/DefaultNode/servers/deploymentmgr/resources.xml#JDBCProvider_1) Db2JdbcDriver(cells/cellname/nodes/DefaultNode/servers/nodeAgent/resources.xml#JDBCProvider_1)

 

listTemplates

Displays a list of template object IDs.

Arguments: Object type - Name derived from XML configuration files.
Returns: a list of template IDs

Example Usage

$AdminConfig listTemplates JDBCProvider

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

 

modify

Supports modification of object attributes.

Argurments: object, attributes
Returns: none

Example Usage

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

 

parents

Obtains information about object types.

Arguments: Object type - Name derived from XML configuration files.
Returns: List of object types

Example Usage

$AdminConfig parents JDBCProvider
Example output:

Cell Node Server

 

queryChanges

Returns a list of unsaved configuration files.

Arguments: none
Returns: a string containing a list of files with unsaved changes

Example Usage

$AdminConfig queryChanges
Example output:

WASX7146I: The following configuration files contain unsaved changes:
cells/cellname/nodes/nodename/servers/servername/resources.xml

 

remove

Removes a configuration object.

Arguments: object
Returns: none

Example Usage

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

 

required

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

Argument: type from XML configuration file
Returns: a string containing a list of required attributes with its type

Example Usage

$AdminConfig required URLProvider
Example output:

Attribute                       Type
streamHandlerClassName          String
protocol                        String

 

reset

Resets the temporary workspace that holds updates to the configuration.

Arguments: none
Returns: none

Example Usage

$AdminConfig reset

 

save

Saves changes in the configuration repository.

Arguments: none
Returns: none

Example Usage

$AdminConfig save

 

setCrossDocumentValidationEnabled

Sets the cross-document validation enabled mode. Values include true or false .

Argument: flag
Returns: none

Example Usage

$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.

Arguments: mode
Returns: none

Example Usage

$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 .

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

Example Usage

$AdminConfig setValidationLevel high

Example output:

WASX7189I: Validation level set to HIGH

 

show

Returns the top level attributes of the given object.

Arguments: object, attributes
Returns: a string containing the attribute value

Example Usage

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

Example output:

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

 

showall

Recursively shows the attributes of a given configuration object.

Arguments: object, attributes
Returns: a string containing the attribute value

Example Usage

$showall "Default Datasource(cells/cellname/nodes/DefaultNode/servers/servername:resources.xml#DataSource_1)

 

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.

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

Example Usage

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

Example output:

nodename

 

types

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

Arguments: none
Returns: List of object types

Example Usage

$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. The scope of this request is the object named by the config id argument.

Argument: config id
Returns: a string containing results of validation

Example Usage

$AdminConfig validate

Example 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

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.