Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use the wsadmin scripting AdminTask object for scripted administration
Invoke an administrative command in interactive mode using wsadmin scripting
These steps demonstrate how to invoke an administrative command in interactive mode.
This topic describes how to invoking an administrative command in interactive mode.
To invoke an administrative command in batch mode, see the topic on invoking a command batch mode.
Procedure
- Invoke the AdminTask object commands interactively, in a script, or use the wsadmin -c command from an operating system command prompt.
See the topic on starting the wsadmin scripting client.
- Invoke an administrative command in interactive mode by issuing one of the following commands:
Use the following command invocation to enter interactive mode without providing another input in the command invocation:
### Jacl
$AdminTask commandName {-interactive}### Jython
AdminTask.commandName('[-interactive]')Use the following command invocation to enter interactive mode using an administrative command that takes a target object. You do not have to provide a target object to enter interactive mode. Target objects provided in the command invocation will be applied to the command and displayed as the current target object value during interactive prompting.
### Jacl
$AdminTask commandName targetObject {-interactive}### Jython
AdminTask.commandName(targetObject, '[-interactive]')Use the following command invocation to enter interactive mode for an administrative command that takes options. You do not have to provide other options to enter interactive mode. Options provided in the command invocation are applied to the command and the option values will be displayed as the current values during interactive prompting.
### Jacl
$AdminTask commandName {-interactive commandOptions}### Jython
AdminTask.commandName('[-interactive commandOptions]')Use the following command invocation to enter interactive mode for an administrative command that has a target object and options. You do not have to specify a target object to enter interactive mode. The values specified are applied to the command before the command data is displayed. As a result, the values specified will be displayed as the current values during interactive prompting.
### Jacl
$AdminTask commandName targetObject {-interactive commandOptions}### Jython
AdminTask.commandName(targetObject, '[-interactive commandOptions]')
AdminTask -interactive targetObject option description. Invoke a command from a wsadmin command line.
$ is a Jacl operator for substituting a variable name with its value AdminTask is an object that supports administrative command management commandName is the name of the administrative command to invoke targetObject is the target object string for the invoked administrative command. The expect target object varies with each admin command. Consult the online help on the invoked administrative command to learn more about what to specify as target object. -interactive is the interactive option commandOptions is the command option that is available for the associated administrative command. Available command options are different for each administrative command. View the online help for the invoked administrative command to obtain more information about which options are available. Arguments and steps that are listed on the online administrative command help are specified as command options. Each option consists of a dash followed immediately by an option name, and then followed by an option value if the option requires a value. For example, using the output of the following online help for the createJ2CConnectionFactory command: 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: NoneIn this example, five options are available:
- -connectionFactoryInterface
- -name
- -jndiName
- -description
- -authDataAlias
Each option requires a value. Three of the options are required and are denoted with a star (*).
Example
The following example invokes an administrative command in interactive mode by specifying the -interactive option:
### Jacl
$AdminTask createJ2CConnectionFactory {-interactive}### Jython
AdminTask.createJ2CConnectionFactory('[-interactive]')Example output:
Create a J2C connection factory *The J2C resource adapter: "WebSphere Relational ResourceAdapter (cells/myCell/nodes/myNode|resources.xml#builtin_rra)" A connection factory interface (connectionFactoryInterface):javax.resource.cci.ConnectionFactory *Name (name): myJ2CCF *The JNDI name (jndiName): j2c/cf Description (description): authentication data alias (authDataAlias): create J2C connection factory F (Finish) C (Cancel) Select [F, C]: [F] myJ2CCF(cells/myCell/nodes/myNode|resources.xml#J2CConnectionFactory_1069690568269)The following example invokes an administrative command using the –interactive option with a target object specified in the command invocation:
### Jacl
set ra [$AdminConfig getid /J2CResourceAdapter:myResourceAdapter/] $AdminTask createJ2CConnectionFactory $ra {-interactive}### Jython
ra = AdminConfig.getid('/J2CResourceAdapter:myResourceAdapter/') AdminTask.createJ2CConnectionFactory(ra, '[-interactive]')Example output:
Create a J2C connection factory *The J2C resource adapter: ["WebSphere Relational ResourceAdapter (cells/myCell/nodes/myNode|resources.xml#builtin_rra)"] A connection factory interface (connectionFactoryInterface): javax.resource.cci.ConnectionFactory *Name (name): myJ2CCF *The JNDI name (jndiName): j2c/cf Description (description): authentication data alias (authDataAlias): create J2C Connection Factory F (Finish) C (Cancel) Select [F, C]: [F] myJ2CCF(cells/myCell/nodes/myNode|resources.xml#J2CConnectionFactory_1069690568269)The following example invokes an administrative command using the –interactive option where both the target object and the additional command options are specified in the command invocation:
### Jacl
set ra [$AdminConfig getid /J2CResourceAdapter:myResourceAdapter/] $AdminTask createJ2CConnectionFactory $ra {-name myNewCF -interactive}### Jython
ra = AdminConfig.getid('/J2CResourceAdapter:myResourceAdapter/') AdminTask.createJ2CConnectionFactory(ra, '[-name myNewCF -interactive]')Example output:
Create a J2C connection factory *The J2C resource adapter: ["WebSphere Relational ResourceAdapter (cells/myCell/nodes/myNode|resources.xml#builtin_rra)"] A connection factory interface (connectionFactoryInterface):javax.resource.cci.ConnectionFactory *Name (name): [myNewCF] *The JNDI name (jndiName): j2c/cf Description (description): authentication data alias (authDataAlias): create J2C Connection Factory F (Finish) C (Cancel) Select [F, C]: [F] myNewCF(cells/myCell/nodes/myNode|resources.xml#J2CConnectionFactory_3839439380269)
Related
Administrative command interactive mode environment using wsadmin.sh
Invoke an administrative command in batch mode using wsadmin.sh
Start the wsadmin scripting client using wsadmin.sh