使用 wsadmin 脚本编制获取联机帮助
对于管理命令,可以从联机帮助的三个级别中进行选择。
开始之前
启动 wsadmin 工具。
关于此任务
顶级帮助提供 AdminTask 对象以及关联的命令的一般信息。第二级别帮助提供有关所有可用的管理命令和命令组的信息。第三级别帮助提供有关命令组、命令或步骤的特定帮助。特定于命令组的帮助提供针对指定的命令组以及属于该关联组的命令的描述。特定于命令的帮助提供指定的命令、关联的参数以及步骤的描述。特定于步骤的帮助提供指定步骤和关联的参数的描述。对于特定于命令和步骤的帮助,必需参数在帮助输出中是以星号(*)来标记的。
过程
- 要获取一般帮助,请运行 help 命令。 使用 Jacl:
$AdminTask help
使用 Jython:print AdminTask.help()
示例输出:WASX8001I: The AdminTask object enables the execution of available admin commands. AdminTask commands operate in two modes: the default mode is one which AdminTask communicates with the WebSphere server to accomplish its task. A local mode is also available, in which no server communication takes place. The local mode of operation is invoked by bringing up the scripting client using the command line "-conntype NONE" option or setting the "com.ibm.ws.scripting.connectiontype=NONE" property in wsadmin.properties file. The number of admin commands varies and depends on your WebSphere install. Use the following help commands to obtain a list of supported commands and their parameters: help -commands Lists all the admin commands help -commands <pattern> Lists admin commands matching with wildcard "pattern" help -commandGroups Lists all the admin command groups help -commandGroups <pattern> Lists admin command groups matching with wildcard "pattern" help commandName Displays detailed information for the specified command help commandName stepName Displays detailed information for the specified step belonging to the specified command help commandGroupName Displays detailed information for the specified command group There are various flavors to invoke an admin command: commandName Invokes an admin command that does not require any argument. commandName targetObject Invokes an admin command with the specified target object string, for example, the configuration object name of a resource adapter. The expected target object varies with the admin command invoked. Use help command to get information on the target object of an admin command. commandName options Invokes an admin command with the specified option strings. This invocation syntax is used to invoke an admin command that does not require a target object. It is also used to enter interactive mode if "-interactive" mode is included in the options string. commandName targetObject options Invokes an admin command with the specified target object and options strings. If "-interactive" is included in the options string, then interactive mode is entered. The target object and options strings vary depending on the admin command invoked. Use help command to get information on the target object and options.
- 要列示可用的命令组,请带有 -commandGroups 参数来运行 help 命令。 使用 Jacl:
$AdminTask help -commandGroups
使用 Jython:print AdminTask.help('-commandGroups')
示例输出:WASX8005I: Available admin command groups: AdminAgentNode - Admin Agent Managed Node related tasks AdminAgentSecurityCommands - Commands used to configure security related items during Admin Agent registration. AdminReports - Admin configuration reports AdminSDKCmds - Admin commands related to pluggable SDKs AdministrativeJobs - This command group contains all the job management commands . AppManagementCommands - Application management commands. ...
- 要列示可用的命令,请带有 -commands 参数来运行 help 命令。 使用 Jacl:
$AdminTask help -commands
使用 Jython:print AdminTask.help('-commands')
示例输出:WASX8004I: Available administrative commands: copyResourceAdapter - copy the specified J2C resource adapter to the specified scope createCluster - Creates a new application server cluster. createClusterMember - Creates a new member of an application server cluster. createJ2CConnectionFactory - Create a J2C connection factory deleteCluster - Delete the configuration of an application server cluster. deleteClusterMember - Deletes a member from an application server cluster. listConnectionFactoryInterfaces - list all of the defined connection factory interfaces on the specified J2C resource adapter. listJ2CConnectionFactories - List J2C connection factories that have a specified connection factory interface defined in the specified J2C resouce adapter createJ2CAdminObject - Create a J2C administrative object. listAdminObjectInterfaces - List all the defined administrative object interfaces on the specified J2C resource adapter. interface on the specified J2C resource adapter. listJ2CAdminObjects - List the J2C administrative objects that have a specified administrative object interface defined in the specified J2C resource adapter. createJ2CActivationSpec - Create a J2C activation specification. listMessageListenerTypes - list all of the defined messageListener type on the specified J2C resource adapter. listJ2CActivationSpecs - List the J2C activation specifications that have a specified message listener type defined in the specified J2C resource adapter.
- 要获取命令组的相关帮助,请带有组名来运行 help 命令。 使用 Jacl:
$AdminTask help JCAManagement
使用 Jython:print AdminTask.help('JCAManagement')
示例输出:WASX8007I: Detailed help for command group: JCAManagement Description: A group of administrative commands that help to configure Java 2 Connector Architecture (J2C)-related resources. Commands: createJ2CConnectionFactory - Create a J2C connection factory listConnectionFactoryInterfaces - list all of the defined connection factory interfaces on the specified J2C resource adapter. listJ2CConnectionFactories - List J2C connection factories that have a specified connection factory interface defined in the specified J2C resouce adapter. createJ2CAdminObject - Create a J2C administrative object. listAdminObjectInterfaces - List all the defined administrative object interfaces on the specified J2C resource adapter. listJ2CAdminObjects - List the J2C administrative objects that have a specified administrative object interface defined in the specified J2C resource adapter. createJ2CActivationSpec - Create a J2C activation specification. listMessageListenerTypes - list all of the defined message listener types on the specified J2C resource adapter. listJ2CActivationSpecs - List the J2C activation specifications that have a specified message listener type defined in the specified J2C resource adapter. copyResourceAdapter - copy the specified J2C resource adapter to the specified scope.
- 要获取管理命令的相关帮助,请带有参数名来运行 help 命令。 使用 Jacl:
$AdminTask help createJ2CConnectionFactory
使用 Jython:print AdminTask.help('createJ2CConnectionFactory')
示例输出:在前面列示的特定于命令的帮助输出中,管理命令分为三个输入区域:目标对象、参数和步骤。根据管理命令,每个区域都可能需要输入。如果一个区域(只包含目标对象的描述的目标对象区域除外)需要输入,那么每个输入都由它的名称和描述来描述。您以批处理方式使用管理命令时,可以使用驻留在参数区域中的任何输入名称作为参数名。WASX8006I: Detailed help for command: createJ2CConnectionFactory Description: Create a J2C connection factory *Target object: The parent J2C resource adapter of the created J2C connection factory. Arguments: *connectionFactoryInterface - A connection factory interface that is defined in the deployment description of the parent J2C resource adapter. *name - The name of the J2C connection factory. *jndiName - The JNDI name of the created J2C connection factory. description - The description for the created J2C connection factory. authDataAlias - the authentication data alias of the created J2C connection factory. Steps: None
如果需要输入,那么名称前面有星号(*)。如果区域不需要输入,那么用 None 标记。以下示例使用 createJ2CConnectionFactory 命令的帮助输出:- 目标对象区域需要 J2CResourceAdapter 的配置对象名。
- 在参数区域中有五个输入,其中有三个必须输入值。参数名是 connectionFactoryInterface、name、jndiName、description 和 authDataAlias。在选项字符串中,这些名称用作参数名来以批处理方式运行管理命令,例如:
请参阅“使用 wsadmin 脚本编制的管理命令调用语法”以获取关于指定参数选项的更多信息。-connectionFactoryInterface javax.resource.cci.ConnectionFactory -name newConnectionFactory -jndiName CF/newConnectionFactory
- 没有步骤与此管理命令相关联。
- 要获取有关命令步骤的帮助,请使用特定于步骤的帮助。 特定于步骤的帮助提供了下列数据:
- 命令步骤的描述。
- 表明此步骤是否支持集合的信息。集合包含相同类型的对象。在命令步骤中,集合包含具有相同参数集的对象。
- 有关每个步骤参数以及它的名称和描述的信息。如果需要步骤参数,那么名称前面有星号(*)。
以下示例获取有关命令步骤的帮助:
使用 Jacl:$AdminTask help createCluster clusterConfig
使用 Jython:print AdminTask.help('createCluster', 'clusterConfig')
示例输出:WASX8013I: Detailed help for step: clusterConfig Description: Specifies the configuration of the new server cluster. Collection: No Arguments: *clusterName - Name of server cluster. preferLocal - Enables node-scoped routing optimization for the cluster.
本示例指示有关 clusterConfig 步骤的以下信息:- 此步骤不支持集合。对于 clusterName 参数和 perferLocal 参数,只支持一个参数值集。
- 此步骤包含两个输入参数,其中一个参数指示为必需的。必需参数是 clusterName,而非必需参数是 preferLocal。提供步骤参数值的语法对于不同的命令参数值是不同的。您必须提供步骤的所有参数值,并且必须完全按照特定于步骤的帮助中显示的顺序提供这些值。对于不需要指定值的任何可选参数,请输入双引号 ("") 来替代值。如果命令步骤是集合类型(例如,它可能包含多个对象,其中每个对象具有相同的参数集),那么您可以指定多个对象,并用它自已的一对花括号括住每个对象。要以批处理方式运行管理命令,并且要在选项字符串中包括此步骤,请使用以下语法:
使用 Jacl:
-clusterConfig {{newCluster false}}
使用 Jython:
请参阅“使用 wsadmin 脚本编制的管理命令调用语法”以获取关于指定参数选项的更多信息。-clusterConfig [[newCluster false]]
- 使用通配符来搜索获取特定命令的帮助。
可以使用 Java 正则表达式模式或通配符模式来指定 AdminTask.help('-commands') 和 AdminConfig list、types 和 listTemplates 功能的命令名称。
- 要使用 Java 正则表达式模式来搜索以 create 开头的管理命令名称,请指定:
print AdminTask.help("-commands", "create.*")
- 要使用通配符搜索模式来搜索以 create 开头的管理命令名称,请指定:
print AdminTask.help("-commands", "create*")
- 要使用 Java 表达式模式来搜索包含 SSLConfig 的管理命令名称,请指定:
print AdminTask.help("-commands", ".*SSLConfig.*")
- 要使用通配符搜索模式来搜索包含 SSLConfig 的管理命令名称,请指定:
print AdminTask.help("-commands", "*SSLConfig*")
- 要使用 Java 正则表达式模式来搜索以 create 开头的管理命令名称,请指定:


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_gethelp
文件名:txml_gethelp.html